2.3 KiB
v1.8.x - yyyy-mm-dd
Changes affecting backward compatibility
-
The
Math.truncpolyfill for targeting Internet Explorer was previously emitted for every JavaScript output file except if the symbolnodejswas defined via-d:nodejs. Now, it is only emitted if the symbolnimJsMathTruncPolyfillis defined. If you are targeting Internet Explorer, you may choose to enable this option or define your ownMath.truncpolyfill using theemitpragma. Nim usesMath.truncfor the division and modulo operators for integers. -
Optional parameters in combination with
: bodysyntax (RFC #405) are now opt-in viaexperimental:flexibleOptionalParams.
Standard library additions and changes
macros.parseExprandmacros.parseStmtnow accept an optional filename argument for more informative errors.
std/smtp
- Sends
ehlofirst. If the mail server does not understand, it sendsheloas a fallback.
Language changes
-
Pragma macros on type definitions can now return
nnkTypeSectionnodes as well asnnkTypeDef, 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 -
Case statement macros are no longer experimental, meaning you no longer need to enable the experimental switch
caseStmtMacrosto use them.
Compiler changes
nimcan now compile version 1.4.0 as follows:nim c --lib:lib --stylecheck:off compiler/nim, without requiring-d:nimVersion140which is now a noop.
Tool changes
- The
gcswitch has been renamed tomm("memory management") in order to reflect the reality better. (Nim moved away from all techniques based on "tracing".)