* O(1) concatenation of singly- and doubly linked lists. There is also new `toSinglyLinkedList` and `toDoublyLinkedList` functions for conversion from `openArray`s, similarly to `toHashSet` or `toTable`. * Add `sequtils` import to runnable examples with `toSeq`. * Added missing call to runnable examples. * Add .since annotation, changelog, and tests. * Rename `lists.concat` as an overload to `lists.append`. * Renamed `append` to `add` in lists. * Remove faulty `add` for `DoublyLinkedList`s. * Improved tests for lists. * `lists.add` moves the second list; added `lists.copy` for shallow copy. * More tests for `lists.add` and `lists.copy`. * More compact tests for lists with templates. * List concatenation with copying (`add`) and moving (tentatively `addMove`) * Renamed `addMove` to `addMoved`; renamed arguments according to the style guide. * Added extended example to `lists.copy`. * Corrected .since annotations to 1.6 * Add .since annotation, changelog, and tests. * Rename `lists.concat` as an overload to `lists.append`. * Renamed `append` to `add` in lists. * Remove faulty `add` for `DoublyLinkedList`s. * `lists.add` moves the second list; added `lists.copy` for shallow copy. * More tests for `lists.add` and `lists.copy`. * List concatenation with copying (`add`) and moving (tentatively `addMove`) * Renamed `addMove` to `addMoved`; renamed arguments according to the style guide. * Since declarations changed to (1,5,1). * Add .since annotation, changelog, and tests. * Rename `lists.concat` as an overload to `lists.append`. * Renamed `append` to `add` in lists. * Remove faulty `add` for `DoublyLinkedList`s. * `lists.add` moves the second list; added `lists.copy` for shallow copy. * More tests for `lists.add` and `lists.copy`. * List concatenation with copying (`add`) and moving (tentatively `addMove`) * Renamed `addMove` to `addMoved`; renamed arguments according to the style guide. * Changelog update. * Fix rebasing errors. * Self-adding with `lists.addMove` results in a cycle now. Added some extra tests.
4 KiB
v1.6.x - yyyy-mm-dd
Standard library additions and changes
-
Make
{.requiresInit.}pragma to work fordistincttypes. -
Added a macros
enumLenfor returning the number of items in an enum to thetypetraits.nimmodule. -
preludenow works with the JavaScript target. -
Added
almostEqualinmathfor comparing two float values using a machine epsilon. -
The JSON module can now handle integer literals and floating point literals of arbitrary length and precision. Numbers that do not fit the underlying
BiggestIntorBiggestFloatfields are kept as string literals and one can use external BigNum libraries to handle these. TheparseFloatfamily of functions also has now optionalrawIntegersandrawFloatsparameters that can be used to enforce that all integer or float literals remain in the "raw" string form so that client code can easily treat small and large numbers uniformly. -
Added an overload for the
collectmacro that inferes the container type based on the syntax of the last expression. Works with std seqs, tables and sets. -
Added
randStatetemplate that exposes the default random number generator. Useful for library authors. -
Added std/enumutils module containing
genEnumCaseStmtmacro that generates case statement to parse string to enum. -
Removed deprecated
iupmodule from stdlib, it has already moved to nimble. -
nodejsbackend now supports osenv:getEnv,putEnv,envPairs,delEnv,existsEnv. -
doAssertRaisesnow correctly handles foreign exceptions. -
Added
asyncdispatch.activeDescriptorsthat returns the number of currently active async event handles/file descriptors. -
--gc:orcis now 10% faster than previously for common workloads. If you have trouble with its changed behavior, compile with-d:nimOldOrc. -
os.FileInfo(returned bygetFileInfo) now containsblockSize, determining preferred I/O block size for this file object. -
reprnow doesn't insert trailing newline; previous behavior was very inconsistent, see #16034. Use-d:nimLegacyReprWithNewlinefor previous behavior. -
Added
**to jsffi. -
writeStackTraceis available in JS backend now. -
strscans.scanfnow supports parsing single characters. -
strscans.scanTupleadded which usesstrscans.scanfinternally, returning a tuple which can be unpacked for easier usage ofscanf. -
Added
setutils.toSetthat can take any iterable and convert it to a built-in set, if the iterable yields a built-in settable type. -
Added
math.isNaN. -
echoanddebugEchowill now raiseIOErrorif writing to stdout fails. Previous behavior silently ignored errors. See #16366. Use-d:nimLegacyEchoNoRaisefor previous behavior. -
Added new operations for singly- and doubly linked lists:
lists.toSinglyLinkedListandlists.toDoublyLinkedListconvert fromopenArrays;lists.copyimplements shallow copying;lists.addconcatenates two lists - an O(1) variation that consumes its argument,addMoved, is also supplied.
Language changes
-
nimscriptnow handlesexcept Exception as e. -
The
cstringdoesn't support[]=operator in JS backend. -
nil dereference is not allowed at compile time.
cast[ptr int](nil)[]is rejected at compile time.
Compiler changes
-
Added
--declaredlocsto show symbol declaration location in messages. -
Source+Edit links now appear on top of every docgen'd page when
nim doc --git.url:url ...is given. -
Added
nim --eval:cmdto evaluate a command directly, seenim --help. -
VM now supports
addr(mystring[ind])(index + index assignment) -
Type mismatch errors now show more context, use
-d:nimLegacyTypeMismatchfor previous behavior.
Tool changes
- The rst parser now supports markdown table syntax.
Known limitations:
- cell alignment is not supported, i.e. alignment annotations in a delimiter
row (
:---,:--:,---:) are ignored, - every table row must start with
|, e.g.| cell 1 | cell 2 |.
- cell alignment is not supported, i.e. alignment annotations in a delimiter
row (