: body
syntax (RFC #405) are now opt-in via
experimental:flexibleOptionalParams
.macros.parseExpr
and macros.parseStmt
now accept an optional
filename argument for more informative errors.colors
expanded with missing colors from the CSS color standard.lists.SinglyLinkedList
being broken after removing the last node (#19353).nnkTypeSection
nodes as well as nnkTypeDef
,
allowing multiple type definitions to be injected in place of the original type definition. import macros
macro multiply(amount: static int, s: untyped): untyped =
let name = $s[0].basename
result = newNimNode(nnkTypeSection)
for i in 1 .. amount:
result.add(newTree(nnkTypeDef, ident(name & $i), s[1], s[2]))
type
Foo = object
Bar {.multiply: 3.} = object
x, y, z: int
Baz = object
# becomes
type
Foo = object
Bar1 = object
x, y, z: int
Bar2 = object
x, y, z: int
Bar3 = object
x, y, z: int
Baz = object
caseStmtMacros
to use them.nim
can now compile version 1.4.0 as follows: nim c --lib:lib --stylecheck:off compiler/nim
,
without requiring -d:nimVersion140
which is now a noop.
--styleCheck
now only applies to the current package.
The gc
switch has been renamed to mm
("memory management") in order to reflect the
reality better. (Nim moved away from all techniques based on "tracing".)
Nim now supports Nimble version 0.14 which added support for lock-files. This is done by
a simple configuration change setting that you can do yourself too. In $nim/config/nim.cfg
replace pkgs
by pkgs2
.
There is a new switch --nimMainPrefix:prefix
to influence the NimMain
that the
compiler produces. This is particularly useful for generating static libraries.