fixes #1809; implements overloading based on 'var T'
This commit is contained in:
parent
1592067566
commit
d4bca58b7d
4 changed files with 149 additions and 154 deletions
|
|
@ -24,7 +24,7 @@ type
|
||||||
ppEof = 1, # end of compiled pattern
|
ppEof = 1, # end of compiled pattern
|
||||||
ppOr, # we could short-cut the evaluation for 'and' and 'or',
|
ppOr, # we could short-cut the evaluation for 'and' and 'or',
|
||||||
ppAnd, # but currently we don't
|
ppAnd, # but currently we don't
|
||||||
ppNot,
|
ppNot,
|
||||||
ppSym,
|
ppSym,
|
||||||
ppAtom,
|
ppAtom,
|
||||||
ppLit,
|
ppLit,
|
||||||
|
|
@ -56,7 +56,7 @@ proc whichAlias*(p: PSym): TAliasRequest =
|
||||||
proc compileConstraints(p: PNode, result: var TPatternCode) =
|
proc compileConstraints(p: PNode, result: var TPatternCode) =
|
||||||
case p.kind
|
case p.kind
|
||||||
of nkCallKinds:
|
of nkCallKinds:
|
||||||
if p.sons[0].kind != nkIdent:
|
if p.sons[0].kind != nkIdent:
|
||||||
patternError(p.sons[0])
|
patternError(p.sons[0])
|
||||||
return
|
return
|
||||||
let op = p.sons[0].ident
|
let op = p.sons[0].ident
|
||||||
|
|
@ -168,8 +168,8 @@ proc checkForSideEffects(n: PNode): TSideEffectAnalysis =
|
||||||
elif ret == seUnknown and result == seNoSideEffect:
|
elif ret == seUnknown and result == seNoSideEffect:
|
||||||
result = seUnknown
|
result = seUnknown
|
||||||
|
|
||||||
type
|
type
|
||||||
TAssignableResult* = enum
|
TAssignableResult* = enum
|
||||||
arNone, # no l-value and no discriminant
|
arNone, # no l-value and no discriminant
|
||||||
arLValue, # is an l-value
|
arLValue, # is an l-value
|
||||||
arLocalLValue, # is an l-value, but local var; must not escape
|
arLocalLValue, # is an l-value, but local var; must not escape
|
||||||
|
|
@ -183,26 +183,26 @@ proc isAssignable*(owner: PSym, n: PNode): TAssignableResult =
|
||||||
of nkSym:
|
of nkSym:
|
||||||
# don't list 'skLet' here:
|
# don't list 'skLet' here:
|
||||||
if n.sym.kind in {skVar, skResult, skTemp}:
|
if n.sym.kind in {skVar, skResult, skTemp}:
|
||||||
if owner != nil and owner.id == n.sym.owner.id and
|
if owner != nil and owner.id == n.sym.owner.id and
|
||||||
sfGlobal notin n.sym.flags:
|
sfGlobal notin n.sym.flags:
|
||||||
result = arLocalLValue
|
result = arLocalLValue
|
||||||
else:
|
else:
|
||||||
result = arLValue
|
result = arLValue
|
||||||
of nkDotExpr:
|
of nkDotExpr:
|
||||||
if skipTypes(n.sons[0].typ, abstractInst-{tyTypeDesc}).kind in
|
|
||||||
{tyVar, tyPtr, tyRef}:
|
|
||||||
result = arLValue
|
|
||||||
else:
|
|
||||||
result = isAssignable(owner, n.sons[0])
|
|
||||||
if result != arNone and sfDiscriminant in n.sons[1].sym.flags:
|
|
||||||
result = arDiscriminant
|
|
||||||
of nkBracketExpr:
|
|
||||||
if skipTypes(n.sons[0].typ, abstractInst-{tyTypeDesc}).kind in
|
if skipTypes(n.sons[0].typ, abstractInst-{tyTypeDesc}).kind in
|
||||||
{tyVar, tyPtr, tyRef}:
|
{tyVar, tyPtr, tyRef}:
|
||||||
result = arLValue
|
result = arLValue
|
||||||
else:
|
else:
|
||||||
result = isAssignable(owner, n.sons[0])
|
result = isAssignable(owner, n.sons[0])
|
||||||
of nkHiddenStdConv, nkHiddenSubConv, nkConv:
|
if result != arNone and sfDiscriminant in n.sons[1].sym.flags:
|
||||||
|
result = arDiscriminant
|
||||||
|
of nkBracketExpr:
|
||||||
|
if skipTypes(n.sons[0].typ, abstractInst-{tyTypeDesc}).kind in
|
||||||
|
{tyVar, tyPtr, tyRef}:
|
||||||
|
result = arLValue
|
||||||
|
else:
|
||||||
|
result = isAssignable(owner, n.sons[0])
|
||||||
|
of nkHiddenStdConv, nkHiddenSubConv, nkConv:
|
||||||
# Object and tuple conversions are still addressable, so we skip them
|
# Object and tuple conversions are still addressable, so we skip them
|
||||||
# XXX why is 'tyOpenArray' allowed here?
|
# XXX why is 'tyOpenArray' allowed here?
|
||||||
if skipTypes(n.typ, abstractPtrs-{tyTypeDesc}).kind in
|
if skipTypes(n.typ, abstractPtrs-{tyTypeDesc}).kind in
|
||||||
|
|
@ -211,9 +211,9 @@ proc isAssignable*(owner: PSym, n: PNode): TAssignableResult =
|
||||||
elif compareTypes(n.typ, n.sons[1].typ, dcEqIgnoreDistinct):
|
elif compareTypes(n.typ, n.sons[1].typ, dcEqIgnoreDistinct):
|
||||||
# types that are equal modulo distinction preserve l-value:
|
# types that are equal modulo distinction preserve l-value:
|
||||||
result = isAssignable(owner, n.sons[1])
|
result = isAssignable(owner, n.sons[1])
|
||||||
of nkHiddenDeref, nkDerefExpr:
|
of nkHiddenDeref, nkDerefExpr, nkHiddenAddr:
|
||||||
result = arLValue
|
result = arLValue
|
||||||
of nkObjUpConv, nkObjDownConv, nkCheckedFieldExpr:
|
of nkObjUpConv, nkObjDownConv, nkCheckedFieldExpr:
|
||||||
result = isAssignable(owner, n.sons[0])
|
result = isAssignable(owner, n.sons[0])
|
||||||
of nkCallKinds:
|
of nkCallKinds:
|
||||||
# builtin slice keeps lvalue-ness:
|
# builtin slice keeps lvalue-ness:
|
||||||
|
|
@ -221,24 +221,27 @@ proc isAssignable*(owner: PSym, n: PNode): TAssignableResult =
|
||||||
else:
|
else:
|
||||||
discard
|
discard
|
||||||
|
|
||||||
|
proc isLValue*(n: PNode): bool =
|
||||||
|
isAssignable(nil, n) in {arLValue, arLocalLValue}
|
||||||
|
|
||||||
proc matchNodeKinds*(p, n: PNode): bool =
|
proc matchNodeKinds*(p, n: PNode): bool =
|
||||||
# matches the parameter constraint 'p' against the concrete AST 'n'.
|
# matches the parameter constraint 'p' against the concrete AST 'n'.
|
||||||
# Efficiency matters here.
|
# Efficiency matters here.
|
||||||
var stack {.noinit.}: array[0..MaxStackSize, bool]
|
var stack {.noinit.}: array[0..MaxStackSize, bool]
|
||||||
# empty patterns are true:
|
# empty patterns are true:
|
||||||
stack[0] = true
|
stack[0] = true
|
||||||
var sp = 1
|
var sp = 1
|
||||||
|
|
||||||
template push(x: bool) =
|
template push(x: bool) =
|
||||||
stack[sp] = x
|
stack[sp] = x
|
||||||
inc sp
|
inc sp
|
||||||
|
|
||||||
let code = p.strVal
|
let code = p.strVal
|
||||||
var pc = 1
|
var pc = 1
|
||||||
while true:
|
while true:
|
||||||
case TOpcode(code[pc])
|
case TOpcode(code[pc])
|
||||||
of ppEof: break
|
of ppEof: break
|
||||||
of ppOr:
|
of ppOr:
|
||||||
stack[sp-2] = stack[sp-1] or stack[sp-2]
|
stack[sp-2] = stack[sp-1] or stack[sp-2]
|
||||||
dec sp
|
dec sp
|
||||||
of ppAnd:
|
of ppAnd:
|
||||||
|
|
@ -264,4 +267,4 @@ proc matchNodeKinds*(p, n: PNode): bool =
|
||||||
of ppNoSideEffect: push checkForSideEffects(n) != seSideEffect
|
of ppNoSideEffect: push checkForSideEffects(n) != seSideEffect
|
||||||
inc pc
|
inc pc
|
||||||
result = stack[sp-1]
|
result = stack[sp-1]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -191,21 +191,6 @@ proc complexDisambiguation(a, b: PType): int =
|
||||||
for i in 1 .. <a.len: x += a.sons[i].sumGeneric
|
for i in 1 .. <a.len: x += a.sons[i].sumGeneric
|
||||||
for i in 1 .. <b.len: y += b.sons[i].sumGeneric
|
for i in 1 .. <b.len: y += b.sons[i].sumGeneric
|
||||||
result = x - y
|
result = x - y
|
||||||
when false:
|
|
||||||
proc betterThan(a, b: PType): bool {.inline.} = a.sumGeneric > b.sumGeneric
|
|
||||||
|
|
||||||
if a.len > 1 and b.len > 1:
|
|
||||||
let aa = a.sons[1].sumGeneric
|
|
||||||
let bb = b.sons[1].sumGeneric
|
|
||||||
var a = a
|
|
||||||
var b = b
|
|
||||||
|
|
||||||
if aa < bb: swap(a, b)
|
|
||||||
# all must be better
|
|
||||||
for i in 2 .. <min(a.len, b.len):
|
|
||||||
if not a.sons[i].betterThan(b.sons[i]): return 0
|
|
||||||
# a must be longer or of the same length as b:
|
|
||||||
result = a.len - b.len
|
|
||||||
|
|
||||||
proc cmpCandidates*(a, b: TCandidate): int =
|
proc cmpCandidates*(a, b: TCandidate): int =
|
||||||
result = a.exactMatches - b.exactMatches
|
result = a.exactMatches - b.exactMatches
|
||||||
|
|
@ -1463,6 +1448,12 @@ proc matchesAux(c: PContext, n, nOrig: PNode,
|
||||||
else:
|
else:
|
||||||
m.state = csNoMatch
|
m.state = csNoMatch
|
||||||
return
|
return
|
||||||
|
if formal.typ.kind == tyVar:
|
||||||
|
if n.isLValue:
|
||||||
|
inc(m.genericMatches, 100)
|
||||||
|
else:
|
||||||
|
m.state = csNoMatch
|
||||||
|
return
|
||||||
|
|
||||||
var
|
var
|
||||||
# iterates over formal parameters
|
# iterates over formal parameters
|
||||||
|
|
|
||||||
4
todo.txt
4
todo.txt
|
|
@ -3,7 +3,6 @@ version 0.10.4
|
||||||
|
|
||||||
- improve GC-unsafety warnings
|
- improve GC-unsafety warnings
|
||||||
- make 'nil' work for 'add' and 'len'
|
- make 'nil' work for 'add' and 'len'
|
||||||
- get rid of 'mget'; aka priority of 'var' needs to be 'var{lvalue}'
|
|
||||||
- disallow negative indexing
|
- disallow negative indexing
|
||||||
- improve the parser; deal with echo $foo gotcha
|
- improve the parser; deal with echo $foo gotcha
|
||||||
|
|
||||||
|
|
@ -59,9 +58,9 @@ Bugs
|
||||||
version 0.9.x
|
version 0.9.x
|
||||||
=============
|
=============
|
||||||
|
|
||||||
|
- pragmas need 'bindSym' support
|
||||||
- allow simple read accesses to global variables --> difficult to ensure that
|
- allow simple read accesses to global variables --> difficult to ensure that
|
||||||
no data races happen
|
no data races happen
|
||||||
- pragmas need 'bindSym' support
|
|
||||||
- pragmas need re-work: 'push' is dangerous, 'hasPragma' does not work
|
- pragmas need re-work: 'push' is dangerous, 'hasPragma' does not work
|
||||||
reliably with user-defined pragmas
|
reliably with user-defined pragmas
|
||||||
- memory manager: add a measure of fragmentation
|
- memory manager: add a measure of fragmentation
|
||||||
|
|
@ -76,7 +75,6 @@ version 0.9.X
|
||||||
=============
|
=============
|
||||||
|
|
||||||
- macros as type pragmas
|
- macros as type pragmas
|
||||||
- document how lazy overloading resolution works
|
|
||||||
- document NimMain and check whether it works for threading
|
- document NimMain and check whether it works for threading
|
||||||
|
|
||||||
GC
|
GC
|
||||||
|
|
|
||||||
229
web/news.txt
229
web/news.txt
|
|
@ -4,7 +4,7 @@ News
|
||||||
|
|
||||||
..
|
..
|
||||||
2015-03-01 Version 0.10.4 released
|
2015-03-01 Version 0.10.4 released
|
||||||
=================================
|
==================================
|
||||||
|
|
||||||
|
|
||||||
Changes affecting backwards compatibility
|
Changes affecting backwards compatibility
|
||||||
|
|
@ -23,7 +23,7 @@ News
|
||||||
- *arrow like* operators are not right associative anymore.
|
- *arrow like* operators are not right associative anymore.
|
||||||
- Typeless parameters are now only allowed in templates and macros. The old
|
- Typeless parameters are now only allowed in templates and macros. The old
|
||||||
way turned out to be too error-prone.
|
way turned out to be too error-prone.
|
||||||
|
|
||||||
Language Additions
|
Language Additions
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
|
|
@ -46,7 +46,7 @@ News
|
||||||
- Ordinary parameters can follow after a varargs parameter. This means the
|
- Ordinary parameters can follow after a varargs parameter. This means the
|
||||||
following is finally accepted by the compiler:
|
following is finally accepted by the compiler:
|
||||||
|
|
||||||
.. code-block:: nim
|
.. code-block:: nim
|
||||||
template takesBlock(a, b: int, x: varargs[expr]; blck: stmt) =
|
template takesBlock(a, b: int, x: varargs[expr]; blck: stmt) =
|
||||||
blck
|
blck
|
||||||
echo a, b
|
echo a, b
|
||||||
|
|
@ -54,6 +54,17 @@ News
|
||||||
takesBlock 1, 2, "some", 0.90, "random stuff":
|
takesBlock 1, 2, "some", 0.90, "random stuff":
|
||||||
echo "yay"
|
echo "yay"
|
||||||
|
|
||||||
|
- Overloading by 'var T' is now finally possible:
|
||||||
|
|
||||||
|
.. code-block:: nim
|
||||||
|
proc varOrConst(x: var int) = echo "var"
|
||||||
|
proc varOrConst(x: int) = echo "const"
|
||||||
|
|
||||||
|
var x: int
|
||||||
|
varOrConst(x) # "var"
|
||||||
|
varOrConst(45) # "const"
|
||||||
|
|
||||||
|
|
||||||
Library additions
|
Library additions
|
||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
|
|
@ -61,8 +72,8 @@ News
|
||||||
- Added multipart param to httpclient's ``post`` and ``postContent`` together
|
- Added multipart param to httpclient's ``post`` and ``postContent`` together
|
||||||
with a ``newMultipartData`` proc.
|
with a ``newMultipartData`` proc.
|
||||||
- Added `%*` operator for JSON.
|
- Added `%*` operator for JSON.
|
||||||
- The compiler is now a Nimble package.
|
- The compiler is now available as Nimble package for c2nim.
|
||||||
-
|
|
||||||
|
|
||||||
Bugfixes
|
Bugfixes
|
||||||
--------
|
--------
|
||||||
|
|
@ -103,8 +114,7 @@ News
|
||||||
(`#1866 <https://github.com/Araq/Nim/issues/1866>`_).
|
(`#1866 <https://github.com/Araq/Nim/issues/1866>`_).
|
||||||
- Fixed "Incorrect assembler generated"
|
- Fixed "Incorrect assembler generated"
|
||||||
(`#1907 <https://github.com/Araq/Nim/issues/1907>`_)
|
(`#1907 <https://github.com/Araq/Nim/issues/1907>`_)
|
||||||
- Fixed "Expression templates that define macros are unusable in some contexts
|
- Fixed "Expression templates that define macros are unusable in some contexts"
|
||||||
"
|
|
||||||
(`#1903 <https://github.com/Araq/Nim/issues/1903>`_)
|
(`#1903 <https://github.com/Araq/Nim/issues/1903>`_)
|
||||||
- Fixed "a second level generic subclass causes the compiler to crash"
|
- Fixed "a second level generic subclass causes the compiler to crash"
|
||||||
(`#1919 <https://github.com/Araq/Nim/issues/1919>`_)
|
(`#1919 <https://github.com/Araq/Nim/issues/1919>`_)
|
||||||
|
|
@ -116,8 +126,7 @@ News
|
||||||
(`#1838 <https://github.com/Araq/Nim/issues/1838>`_)
|
(`#1838 <https://github.com/Araq/Nim/issues/1838>`_)
|
||||||
- Fixed "ICE with template"
|
- Fixed "ICE with template"
|
||||||
(`#1915 <https://github.com/Araq/Nim/issues/1915>`_)
|
(`#1915 <https://github.com/Araq/Nim/issues/1915>`_)
|
||||||
- Fixed "include the tool directory in the installer as it is required by koch
|
- Fixed "include the tool directory in the installer as it is required by koch"
|
||||||
"
|
|
||||||
(`#1947 <https://github.com/Araq/Nim/issues/1947>`_)
|
(`#1947 <https://github.com/Araq/Nim/issues/1947>`_)
|
||||||
- Fixed "Can't compile if file location contains spaces on Windows"
|
- Fixed "Can't compile if file location contains spaces on Windows"
|
||||||
(`#1955 <https://github.com/Araq/Nim/issues/1955>`_)
|
(`#1955 <https://github.com/Araq/Nim/issues/1955>`_)
|
||||||
|
|
@ -151,14 +160,11 @@ News
|
||||||
(`#2039 <https://github.com/Araq/Nim/issues/2039>`_)
|
(`#2039 <https://github.com/Araq/Nim/issues/2039>`_)
|
||||||
- Fixed "Macros fail to compile when compiled with --os:standalone"
|
- Fixed "Macros fail to compile when compiled with --os:standalone"
|
||||||
(`#2041 <https://github.com/Araq/Nim/issues/2041>`_)
|
(`#2041 <https://github.com/Araq/Nim/issues/2041>`_)
|
||||||
- Fixed "Reading from {.compileTime.} variables can cause code generation to f
|
- Fixed "Reading from {.compileTime.} variables can cause code generation to fail"
|
||||||
ail"
|
|
||||||
(`#2022 <https://github.com/Araq/Nim/issues/2022>`_)
|
(`#2022 <https://github.com/Araq/Nim/issues/2022>`_)
|
||||||
- Fixed "Passing overloaded symbols to templates fails inside generic procedur
|
- Fixed "Passing overloaded symbols to templates fails inside generic procedures"
|
||||||
es"
|
|
||||||
(`#1988 <https://github.com/Araq/Nim/issues/1988>`_)
|
(`#1988 <https://github.com/Araq/Nim/issues/1988>`_)
|
||||||
- Fixed "Compiling iterator with object assignment in release mode causes "var
|
- Fixed "Compiling iterator with object assignment in release mode causes "var not init""
|
||||||
not init""
|
|
||||||
(`#2023 <https://github.com/Araq/Nim/issues/2023>`_)
|
(`#2023 <https://github.com/Araq/Nim/issues/2023>`_)
|
||||||
- Fixed "calling a large number of macros doing some computation fails"
|
- Fixed "calling a large number of macros doing some computation fails"
|
||||||
(`#1989 <https://github.com/Araq/Nim/issues/1989>`_)
|
(`#1989 <https://github.com/Araq/Nim/issues/1989>`_)
|
||||||
|
|
@ -196,8 +202,7 @@ es"
|
||||||
(`#2102 <https://github.com/Araq/Nim/issues/2102>`_)
|
(`#2102 <https://github.com/Araq/Nim/issues/2102>`_)
|
||||||
- Fixed "hint[path] = off not working in nim.cfg"
|
- Fixed "hint[path] = off not working in nim.cfg"
|
||||||
(`#2103 <https://github.com/Araq/Nim/issues/2103>`_)
|
(`#2103 <https://github.com/Araq/Nim/issues/2103>`_)
|
||||||
- Fixed "compiler crashes when getting a tuple from a sequence of generic tupl
|
- Fixed "compiler crashes when getting a tuple from a sequence of generic tuples"
|
||||||
es"
|
|
||||||
(`#2121 <https://github.com/Araq/Nim/issues/2121>`_)
|
(`#2121 <https://github.com/Araq/Nim/issues/2121>`_)
|
||||||
- Fixed "nim check hangs with when"
|
- Fixed "nim check hangs with when"
|
||||||
(`#2123 <https://github.com/Araq/Nim/issues/2123>`_)
|
(`#2123 <https://github.com/Araq/Nim/issues/2123>`_)
|
||||||
|
|
@ -225,13 +230,11 @@ es"
|
||||||
(`#2216 <https://github.com/Araq/Nim/issues/2216>`_)
|
(`#2216 <https://github.com/Araq/Nim/issues/2216>`_)
|
||||||
- Fixed "--threads:on breaks async"
|
- Fixed "--threads:on breaks async"
|
||||||
(`#2074 <https://github.com/Araq/Nim/issues/2074>`_)
|
(`#2074 <https://github.com/Araq/Nim/issues/2074>`_)
|
||||||
- Fixed "Type mismatch not always caught, can generate bad code for C backend.
|
- Fixed "Type mismatch not always caught, can generate bad code for C backend."
|
||||||
"
|
|
||||||
(`#2169 <https://github.com/Araq/Nim/issues/2169>`_)
|
(`#2169 <https://github.com/Araq/Nim/issues/2169>`_)
|
||||||
- Fixed "Failed C compilation when storing proc to own type in object"
|
- Fixed "Failed C compilation when storing proc to own type in object"
|
||||||
(`#2233 <https://github.com/Araq/Nim/issues/2233>`_)
|
(`#2233 <https://github.com/Araq/Nim/issues/2233>`_)
|
||||||
- Fixed "Unknown line/column number in constant declaration type conversion er
|
- Fixed "Unknown line/column number in constant declaration type conversion error"
|
||||||
ror"
|
|
||||||
(`#2252 <https://github.com/Araq/Nim/issues/2252>`_)
|
(`#2252 <https://github.com/Araq/Nim/issues/2252>`_)
|
||||||
- Fixed "Adding {.compile.} fails if nimcache already exists."
|
- Fixed "Adding {.compile.} fails if nimcache already exists."
|
||||||
(`#2247 <https://github.com/Araq/Nim/issues/2247>`_)
|
(`#2247 <https://github.com/Araq/Nim/issues/2247>`_)
|
||||||
|
|
@ -466,8 +469,8 @@ Bugfixes
|
||||||
2014-12-09 New website design!
|
2014-12-09 New website design!
|
||||||
==============================
|
==============================
|
||||||
|
|
||||||
A brand new website including an improved forum is now live.
|
A brand new website including an improved forum is now live.
|
||||||
All thanks go to Philip Witte and
|
All thanks go to Philip Witte and
|
||||||
Dominik Picheta, Philip Witte for the design of the website (together with
|
Dominik Picheta, Philip Witte for the design of the website (together with
|
||||||
the logo) as well as the HTML and CSS code for his template, and Dominik Picheta
|
the logo) as well as the HTML and CSS code for his template, and Dominik Picheta
|
||||||
for integrating Philip's design with Nim's forum. We're sure you will
|
for integrating Philip's design with Nim's forum. We're sure you will
|
||||||
|
|
@ -534,7 +537,7 @@ Library Additions
|
||||||
- ``sequtils.distnct`` has been renamed to ``sequtils.deduplicate``.
|
- ``sequtils.distnct`` has been renamed to ``sequtils.deduplicate``.
|
||||||
- Added ``algorithm.reversed``
|
- Added ``algorithm.reversed``
|
||||||
- Added ``uri.combine`` and ``uri.parseUri``.
|
- Added ``uri.combine`` and ``uri.parseUri``.
|
||||||
- Some sockets procedures now support a ``SafeDisconn`` flag which causes
|
- Some sockets procedures now support a ``SafeDisconn`` flag which causes
|
||||||
them to handle disconnection errors and not raise them.
|
them to handle disconnection errors and not raise them.
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -549,7 +552,7 @@ unfortunately some do not fulfill our quality standards yet.**
|
||||||
Prebuilt binaries and instructions for building from source are available
|
Prebuilt binaries and instructions for building from source are available
|
||||||
on the `download page <download.html>`_.
|
on the `download page <download.html>`_.
|
||||||
|
|
||||||
This release includes about
|
This release includes about
|
||||||
`1400 changes <https://github.com/Araq/Nimrod/compare/v0.9.2...v0.9.4>`_
|
`1400 changes <https://github.com/Araq/Nimrod/compare/v0.9.2...v0.9.4>`_
|
||||||
in total including various bug
|
in total including various bug
|
||||||
fixes, new languages features and standard library additions and improvements.
|
fixes, new languages features and standard library additions and improvements.
|
||||||
|
|
@ -608,10 +611,10 @@ Note that this feature has been implemented with Nimrod's macro system and so
|
||||||
Syntactic sugar for anonymous procedures has also been introduced. It too has
|
Syntactic sugar for anonymous procedures has also been introduced. It too has
|
||||||
been implemented as a macro. The following shows some simple usage of the new
|
been implemented as a macro. The following shows some simple usage of the new
|
||||||
syntax:
|
syntax:
|
||||||
|
|
||||||
.. code-block::nim
|
.. code-block::nim
|
||||||
import future
|
import future
|
||||||
|
|
||||||
var s = @[1, 2, 3, 4, 5]
|
var s = @[1, 2, 3, 4, 5]
|
||||||
echo(s.map((x: int) => x * 5))
|
echo(s.map((x: int) => x * 5))
|
||||||
|
|
||||||
|
|
@ -638,14 +641,14 @@ Library Additions
|
||||||
Changes affecting backwards compatibility
|
Changes affecting backwards compatibility
|
||||||
-----------------------------------------
|
-----------------------------------------
|
||||||
|
|
||||||
- The scoping rules for the ``if`` statement changed for better interaction
|
- The scoping rules for the ``if`` statement changed for better interaction
|
||||||
with the new syntactic construct ``(;)``.
|
with the new syntactic construct ``(;)``.
|
||||||
- ``OSError`` family of procedures has been deprecated. Procedures with the same
|
- ``OSError`` family of procedures has been deprecated. Procedures with the same
|
||||||
name but which take different parameters have been introduced. These procs now
|
name but which take different parameters have been introduced. These procs now
|
||||||
require an error code to be passed to them. This error code can be retrieved
|
require an error code to be passed to them. This error code can be retrieved
|
||||||
using the new ``OSLastError`` proc.
|
using the new ``OSLastError`` proc.
|
||||||
- ``os.parentDir`` now returns "" if there is no parent dir.
|
- ``os.parentDir`` now returns "" if there is no parent dir.
|
||||||
- In CGI scripts stacktraces are shown to the user only
|
- In CGI scripts stacktraces are shown to the user only
|
||||||
if ``cgi.setStackTraceStdout`` is used.
|
if ``cgi.setStackTraceStdout`` is used.
|
||||||
- The symbol binding rules for clean templates changed: ``bind`` for any
|
- The symbol binding rules for clean templates changed: ``bind`` for any
|
||||||
symbol that's not a parameter is now the default. ``mixin`` can be used
|
symbol that's not a parameter is now the default. ``mixin`` can be used
|
||||||
|
|
@ -679,7 +682,7 @@ Compiler Additions
|
||||||
evaluation.
|
evaluation.
|
||||||
- ``--gc:none`` produces warnings when code uses the GC.
|
- ``--gc:none`` produces warnings when code uses the GC.
|
||||||
- A ``union`` pragma for better C interoperability is now supported.
|
- A ``union`` pragma for better C interoperability is now supported.
|
||||||
- A ``packed`` pragma to control the memory packing/alignment of fields in
|
- A ``packed`` pragma to control the memory packing/alignment of fields in
|
||||||
an object.
|
an object.
|
||||||
- Arrays can be annotated to be ``unchecked`` for easier low level
|
- Arrays can be annotated to be ``unchecked`` for easier low level
|
||||||
manipulations of memory.
|
manipulations of memory.
|
||||||
|
|
@ -728,13 +731,13 @@ as the cover story in the February 2014 issue of Dr. Dobb's Journal.
|
||||||
Andreas Rumpf presented *Nimrod: A New Approach to Metaprogramming* at
|
Andreas Rumpf presented *Nimrod: A New Approach to Metaprogramming* at
|
||||||
`Strange Loop 2013<https://thestrangeloop.com/sessions/nimrod-a-new-approach-to-meta-programming>`_.
|
`Strange Loop 2013<https://thestrangeloop.com/sessions/nimrod-a-new-approach-to-meta-programming>`_.
|
||||||
The `video and slides<http://www.infoq.com/presentations/nimrod>`_
|
The `video and slides<http://www.infoq.com/presentations/nimrod>`_
|
||||||
of the talk are now available.
|
of the talk are now available.
|
||||||
|
|
||||||
|
|
||||||
2013-05-20 New website design!
|
2013-05-20 New website design!
|
||||||
==============================
|
==============================
|
||||||
|
|
||||||
A brand new website is now live. All thanks go to Philip Witte and
|
A brand new website is now live. All thanks go to Philip Witte and
|
||||||
Dominik Picheta, Philip Witte for the design of the website (together with
|
Dominik Picheta, Philip Witte for the design of the website (together with
|
||||||
the logo) as well as the HTML and CSS code for his template, and Dominik Picheta
|
the logo) as well as the HTML and CSS code for his template, and Dominik Picheta
|
||||||
for integrating Philip's design with the ``nimweb`` utility. We're sure you will
|
for integrating Philip's design with the ``nimweb`` utility. We're sure you will
|
||||||
|
|
@ -750,7 +753,7 @@ to any other release.
|
||||||
|
|
||||||
This release brings with it many new features and bug fixes, a list of which
|
This release brings with it many new features and bug fixes, a list of which
|
||||||
can be seen later. One of the major new features is the effect system together
|
can be seen later. One of the major new features is the effect system together
|
||||||
with exception tracking which allows for checked exceptions and more,
|
with exception tracking which allows for checked exceptions and more,
|
||||||
for further details check out the `manual <manual.html#effect-system>`_.
|
for further details check out the `manual <manual.html#effect-system>`_.
|
||||||
Another major new feature is the introduction of statement list expressions,
|
Another major new feature is the introduction of statement list expressions,
|
||||||
more details on these can be found `here <manual.html#statement-list-expression>`_.
|
more details on these can be found `here <manual.html#statement-list-expression>`_.
|
||||||
|
|
@ -763,12 +766,12 @@ Bugfixes
|
||||||
--------
|
--------
|
||||||
|
|
||||||
- The old GC never collected cycles correctly. Fixed but it can cause
|
- The old GC never collected cycles correctly. Fixed but it can cause
|
||||||
performance regressions. However you can deactivate the cycle collector
|
performance regressions. However you can deactivate the cycle collector
|
||||||
with ``GC_disableMarkAndSweep`` and run it explicitly at an appropriate time
|
with ``GC_disableMarkAndSweep`` and run it explicitly at an appropriate time
|
||||||
or not at all. There is also a new GC you can activate
|
or not at all. There is also a new GC you can activate
|
||||||
with ``--gc:markAndSweep`` which does not have this problem but is slower in
|
with ``--gc:markAndSweep`` which does not have this problem but is slower in
|
||||||
general and has no realtime guarantees.
|
general and has no realtime guarantees.
|
||||||
- ``cast`` for floating point types now does the bitcast as specified in the
|
- ``cast`` for floating point types now does the bitcast as specified in the
|
||||||
manual. This breaks code that erroneously uses ``cast`` to convert different
|
manual. This breaks code that erroneously uses ``cast`` to convert different
|
||||||
floating point values.
|
floating point values.
|
||||||
- SCGI module's performance has been improved greatly, it will no longer block
|
- SCGI module's performance has been improved greatly, it will no longer block
|
||||||
|
|
@ -779,7 +782,7 @@ Bugfixes
|
||||||
Library Additions
|
Library Additions
|
||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
- There is a new experimental mark&sweep GC which can be faster (or much
|
- There is a new experimental mark&sweep GC which can be faster (or much
|
||||||
slower) than the default GC. Enable with ``--gc:markAndSweep``.
|
slower) than the default GC. Enable with ``--gc:markAndSweep``.
|
||||||
- Added ``system.onRaise`` to support a condition system.
|
- Added ``system.onRaise`` to support a condition system.
|
||||||
- Added ``system.locals`` that provides access to a proc's locals.
|
- Added ``system.locals`` that provides access to a proc's locals.
|
||||||
|
|
@ -816,41 +819,41 @@ Compiler Additions
|
||||||
to be turned on explicitly via ``--warning[ShadowIdent]:on``.
|
to be turned on explicitly via ``--warning[ShadowIdent]:on``.
|
||||||
- The compiler now supports almost every pragma in a ``push`` pragma.
|
- The compiler now supports almost every pragma in a ``push`` pragma.
|
||||||
- Generic converters have been implemented.
|
- Generic converters have been implemented.
|
||||||
- Added a **highly experimental** ``noforward`` pragma enabling a special
|
- Added a **highly experimental** ``noforward`` pragma enabling a special
|
||||||
compilation mode that largely eliminates the need for forward declarations.
|
compilation mode that largely eliminates the need for forward declarations.
|
||||||
|
|
||||||
Language Additions
|
Language Additions
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
- ``case expressions`` are now supported.
|
- ``case expressions`` are now supported.
|
||||||
- Table constructors now mimic more closely the syntax of the ``case``
|
- Table constructors now mimic more closely the syntax of the ``case``
|
||||||
statement.
|
statement.
|
||||||
- Nimrod can now infer the return type of a proc from its body.
|
- Nimrod can now infer the return type of a proc from its body.
|
||||||
- Added a ``mixin`` declaration to affect symbol binding rules in generics.
|
- Added a ``mixin`` declaration to affect symbol binding rules in generics.
|
||||||
- Exception tracking has been added and the ``doc2`` command annotates possible
|
- Exception tracking has been added and the ``doc2`` command annotates possible
|
||||||
exceptions for you.
|
exceptions for you.
|
||||||
- User defined effects ("tags") tracking has been added and the ``doc2``
|
- User defined effects ("tags") tracking has been added and the ``doc2``
|
||||||
command annotates possible tags for you.
|
command annotates possible tags for you.
|
||||||
- Types can be annotated with the new syntax ``not nil`` to explicitly state
|
- Types can be annotated with the new syntax ``not nil`` to explicitly state
|
||||||
that ``nil`` is not allowed. However currently the compiler performs no
|
that ``nil`` is not allowed. However currently the compiler performs no
|
||||||
advanced static checking for this; for now it's merely for documentation
|
advanced static checking for this; for now it's merely for documentation
|
||||||
purposes.
|
purposes.
|
||||||
- An ``export`` statement has been added to the language: It can be used for
|
- An ``export`` statement has been added to the language: It can be used for
|
||||||
symbol forwarding so client modules don't have to import a module's
|
symbol forwarding so client modules don't have to import a module's
|
||||||
dependencies explicitly.
|
dependencies explicitly.
|
||||||
- Overloading based on ASTs has been implemented.
|
- Overloading based on ASTs has been implemented.
|
||||||
- Generics are now supported for multi methods.
|
- Generics are now supported for multi methods.
|
||||||
- Objects can be initialized via an *object constructor expression*.
|
- Objects can be initialized via an *object constructor expression*.
|
||||||
- There is a new syntactic construct ``(;)`` unifying expressions and
|
- There is a new syntactic construct ``(;)`` unifying expressions and
|
||||||
statements.
|
statements.
|
||||||
- You can now use ``from module import nil`` if you want to import the module
|
- You can now use ``from module import nil`` if you want to import the module
|
||||||
but want to enforce fully qualified access to every symbol in ``module``.
|
but want to enforce fully qualified access to every symbol in ``module``.
|
||||||
|
|
||||||
|
|
||||||
Notes for the future
|
Notes for the future
|
||||||
--------------------
|
--------------------
|
||||||
|
|
||||||
- The scope rules of ``if`` statements will change in 0.9.4. This affects the
|
- The scope rules of ``if`` statements will change in 0.9.4. This affects the
|
||||||
``=~`` pegs/re templates.
|
``=~`` pegs/re templates.
|
||||||
- The ``sockets`` module will become a low-level wrapper of OS-specific socket
|
- The ``sockets`` module will become a low-level wrapper of OS-specific socket
|
||||||
functions. All the high-level features of the current ``sockets`` module
|
functions. All the high-level features of the current ``sockets`` module
|
||||||
|
|
@ -894,14 +897,14 @@ Library Additions
|
||||||
assignments.
|
assignments.
|
||||||
- Added ``system.eval`` that can execute an anonymous block of code at
|
- Added ``system.eval`` that can execute an anonymous block of code at
|
||||||
compile time as if was a macro.
|
compile time as if was a macro.
|
||||||
- Added ``system.staticExec`` and ``system.gorge`` for compile-time execution
|
- Added ``system.staticExec`` and ``system.gorge`` for compile-time execution
|
||||||
of external programs.
|
of external programs.
|
||||||
- Added ``system.staticRead`` as a synonym for ``system.slurp``.
|
- Added ``system.staticRead`` as a synonym for ``system.slurp``.
|
||||||
- Added ``macros.emit`` that can emit an arbitrary computed string as nimrod
|
- Added ``macros.emit`` that can emit an arbitrary computed string as nimrod
|
||||||
code during compilation.
|
code during compilation.
|
||||||
- Added ``strutils.parseEnum``.
|
- Added ``strutils.parseEnum``.
|
||||||
- Added ``json.%`` constructor operator.
|
- Added ``json.%`` constructor operator.
|
||||||
- The stdlib can now be avoided to a point where C code generation for 16bit
|
- The stdlib can now be avoided to a point where C code generation for 16bit
|
||||||
micro controllers is feasible.
|
micro controllers is feasible.
|
||||||
- Added module ``oids``.
|
- Added module ``oids``.
|
||||||
- Added module ``endians``.
|
- Added module ``endians``.
|
||||||
|
|
@ -917,7 +920,7 @@ Library Additions
|
||||||
- Added ``strutils.continuesWith``.
|
- Added ``strutils.continuesWith``.
|
||||||
- Added ``system.getStackTrace``.
|
- Added ``system.getStackTrace``.
|
||||||
- Added ``system.||`` for parallel ``for`` loop support.
|
- Added ``system.||`` for parallel ``for`` loop support.
|
||||||
- The GC supports (soft) realtime systems via ``GC_setMaxPause``
|
- The GC supports (soft) realtime systems via ``GC_setMaxPause``
|
||||||
and ``GC_step`` procs.
|
and ``GC_step`` procs.
|
||||||
- The sockets module now supports ssl through the OpenSSL library, ``recvLine``
|
- The sockets module now supports ssl through the OpenSSL library, ``recvLine``
|
||||||
is now much more efficient thanks to the newly implemented sockets buffering.
|
is now much more efficient thanks to the newly implemented sockets buffering.
|
||||||
|
|
@ -928,14 +931,14 @@ Library Additions
|
||||||
only support fixed length arrays).
|
only support fixed length arrays).
|
||||||
- Added ``system.compiles`` which can be used to check whether a type supports
|
- Added ``system.compiles`` which can be used to check whether a type supports
|
||||||
some operation.
|
some operation.
|
||||||
- Added ``strutils.format``, ``subexes.format`` which use the
|
- Added ``strutils.format``, ``subexes.format`` which use the
|
||||||
new ``varargs`` type.
|
new ``varargs`` type.
|
||||||
- Added module ``fsmonitor``.
|
- Added module ``fsmonitor``.
|
||||||
|
|
||||||
Changes affecting backwards compatibility
|
Changes affecting backwards compatibility
|
||||||
-----------------------------------------
|
-----------------------------------------
|
||||||
|
|
||||||
- On Windows filenames and paths are supposed to be in UTF-8.
|
- On Windows filenames and paths are supposed to be in UTF-8.
|
||||||
The ``system``, ``os``, ``osproc`` and ``memfiles`` modules use the wide
|
The ``system``, ``os``, ``osproc`` and ``memfiles`` modules use the wide
|
||||||
string versions of the WinAPI. Use the ``-d:useWinAnsi`` switch to revert
|
string versions of the WinAPI. Use the ``-d:useWinAnsi`` switch to revert
|
||||||
back to the old behaviour which uses the Ansi string versions.
|
back to the old behaviour which uses the Ansi string versions.
|
||||||
|
|
@ -960,21 +963,21 @@ Changes affecting backwards compatibility
|
||||||
- Deprecated ``nimrod pretty`` as it never worked good enough and has some
|
- Deprecated ``nimrod pretty`` as it never worked good enough and has some
|
||||||
inherent problems.
|
inherent problems.
|
||||||
- The integer promotion rules changed; the compiler is now less picky in some
|
- The integer promotion rules changed; the compiler is now less picky in some
|
||||||
situations and more picky in other situations: In particular implicit
|
situations and more picky in other situations: In particular implicit
|
||||||
conversions from ``int`` to ``int32`` are now forbidden.
|
conversions from ``int`` to ``int32`` are now forbidden.
|
||||||
- ``system.byte`` is now an alias for ``uint8``; it used to be an alias
|
- ``system.byte`` is now an alias for ``uint8``; it used to be an alias
|
||||||
to ``int8``.
|
to ``int8``.
|
||||||
- ``bind`` expressions in templates are not properly supported anymore. Use
|
- ``bind`` expressions in templates are not properly supported anymore. Use
|
||||||
the declarative ``bind`` statement instead.
|
the declarative ``bind`` statement instead.
|
||||||
- The default calling convention for a procedural **type** is now ``closure``,
|
- The default calling convention for a procedural **type** is now ``closure``,
|
||||||
for procs it remains ``nimcall`` (which is compatible to ``closure``).
|
for procs it remains ``nimcall`` (which is compatible to ``closure``).
|
||||||
Activate the warning ``ImplicitClosure`` to make the compiler list the
|
Activate the warning ``ImplicitClosure`` to make the compiler list the
|
||||||
occurrences of proc types which are affected.
|
occurrences of proc types which are affected.
|
||||||
- The Nimrod type system now distinguishes ``openarray`` from ``varargs``.
|
- The Nimrod type system now distinguishes ``openarray`` from ``varargs``.
|
||||||
- Templates are now ``hygienic``. Use the ``dirty`` pragma to get the old
|
- Templates are now ``hygienic``. Use the ``dirty`` pragma to get the old
|
||||||
behaviour.
|
behaviour.
|
||||||
- Objects that have no ancestor are now implicitly ``final``. Use
|
- Objects that have no ancestor are now implicitly ``final``. Use
|
||||||
the ``inheritable`` pragma to introduce new object roots apart
|
the ``inheritable`` pragma to introduce new object roots apart
|
||||||
from ``TObject``.
|
from ``TObject``.
|
||||||
- Macros now receive parameters like templates do; use the ``callsite`` builtin
|
- Macros now receive parameters like templates do; use the ``callsite`` builtin
|
||||||
to gain access to the invocation AST.
|
to gain access to the invocation AST.
|
||||||
|
|
@ -985,14 +988,14 @@ Compiler Additions
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
- Win64 is now an officially supported target.
|
- Win64 is now an officially supported target.
|
||||||
- The Nimrod compiler works on BSD again, but has some issues
|
- The Nimrod compiler works on BSD again, but has some issues
|
||||||
as ``os.getAppFilename`` and ``os.getAppDir`` cannot work reliably on BSD.
|
as ``os.getAppFilename`` and ``os.getAppDir`` cannot work reliably on BSD.
|
||||||
- The compiler can detect and evaluate calls that can be evaluated at compile
|
- The compiler can detect and evaluate calls that can be evaluated at compile
|
||||||
time for optimization purposes with the ``--implicitStatic`` command line
|
time for optimization purposes with the ``--implicitStatic`` command line
|
||||||
option or pragma.
|
option or pragma.
|
||||||
- The compiler now generates marker procs that the GC can use instead of RTTI.
|
- The compiler now generates marker procs that the GC can use instead of RTTI.
|
||||||
This speeds up the GC quite a bit.
|
This speeds up the GC quite a bit.
|
||||||
- The compiler now includes a new advanced documentation generator
|
- The compiler now includes a new advanced documentation generator
|
||||||
via the ``doc2`` command. This new generator uses all of the semantic passes
|
via the ``doc2`` command. This new generator uses all of the semantic passes
|
||||||
of the compiler and can thus generate documentation for symbols hiding in
|
of the compiler and can thus generate documentation for symbols hiding in
|
||||||
macros.
|
macros.
|
||||||
|
|
@ -1011,7 +1014,7 @@ Language Additions
|
||||||
- Added ``global`` pragma that can be used to introduce new global variables
|
- Added ``global`` pragma that can be used to introduce new global variables
|
||||||
from within procs.
|
from within procs.
|
||||||
- ``when`` expressions are now allowed just like ``if`` expressions.
|
- ``when`` expressions are now allowed just like ``if`` expressions.
|
||||||
- The precedence for operators starting with ``@`` is different now
|
- The precedence for operators starting with ``@`` is different now
|
||||||
allowing for *sigil-like* operators.
|
allowing for *sigil-like* operators.
|
||||||
- Stand-alone ``finally`` and ``except`` blocks are now supported.
|
- Stand-alone ``finally`` and ``except`` blocks are now supported.
|
||||||
- Macros and templates can now be invoked as pragmas.
|
- Macros and templates can now be invoked as pragmas.
|
||||||
|
|
@ -1019,7 +1022,7 @@ Language Additions
|
||||||
- Unsigned integer types have been added.
|
- Unsigned integer types have been added.
|
||||||
- The integer promotion rules changed.
|
- The integer promotion rules changed.
|
||||||
- Nimrod now tracks proper intervals for ``range`` over some built-in operators.
|
- Nimrod now tracks proper intervals for ``range`` over some built-in operators.
|
||||||
- In parameter lists a semicolon instead of a comma can be used to improve
|
- In parameter lists a semicolon instead of a comma can be used to improve
|
||||||
readability: ``proc divmod(a, b: int; resA, resB: var int)``.
|
readability: ``proc divmod(a, b: int; resA, resB: var int)``.
|
||||||
- A semicolon can now be used to have multiple simple statements on a single
|
- A semicolon can now be used to have multiple simple statements on a single
|
||||||
line: ``inc i; inc j``.
|
line: ``inc i; inc j``.
|
||||||
|
|
@ -1061,9 +1064,9 @@ Bugfixes
|
||||||
Changes affecting backwards compatibility
|
Changes affecting backwards compatibility
|
||||||
-----------------------------------------
|
-----------------------------------------
|
||||||
|
|
||||||
- Removed deprecated ``os.AppendFileExt``, ``os.executeShellCommand``,
|
- Removed deprecated ``os.AppendFileExt``, ``os.executeShellCommand``,
|
||||||
``os.iterOverEnvironment``, ``os.pcDirectory``, ``os.pcLinkToDirectory``,
|
``os.iterOverEnvironment``, ``os.pcDirectory``, ``os.pcLinkToDirectory``,
|
||||||
``os.SplitPath``, ``os.extractDir``, ``os.SplitFilename``,
|
``os.SplitPath``, ``os.extractDir``, ``os.SplitFilename``,
|
||||||
``os.extractFileTrunk``, ``os.extractFileExt``, ``osproc.executeProcess``,
|
``os.extractFileTrunk``, ``os.extractFileExt``, ``osproc.executeProcess``,
|
||||||
``osproc.executeCommand``.
|
``osproc.executeCommand``.
|
||||||
- Removed deprecated ``parseopt.init``, ``parseopt.getRestOfCommandLine``.
|
- Removed deprecated ``parseopt.init``, ``parseopt.getRestOfCommandLine``.
|
||||||
|
|
@ -1073,7 +1076,7 @@ Changes affecting backwards compatibility
|
||||||
- ``implies`` is no keyword anymore.
|
- ``implies`` is no keyword anymore.
|
||||||
- The ``is`` operator is now the ``of`` operator.
|
- The ``is`` operator is now the ``of`` operator.
|
||||||
- The ``is`` operator is now used to check type equivalence in generic code.
|
- The ``is`` operator is now used to check type equivalence in generic code.
|
||||||
- The ``pure`` pragma for procs has been renamed to ``noStackFrame``.
|
- The ``pure`` pragma for procs has been renamed to ``noStackFrame``.
|
||||||
- The threading API has been completely redesigned.
|
- The threading API has been completely redesigned.
|
||||||
- The ``unidecode`` module is now thread-safe and its interface has changed.
|
- The ``unidecode`` module is now thread-safe and its interface has changed.
|
||||||
- The ``bind`` expression is deprecated, use a ``bind`` declaration instead.
|
- The ``bind`` expression is deprecated, use a ``bind`` declaration instead.
|
||||||
|
|
@ -1083,13 +1086,13 @@ Changes affecting backwards compatibility
|
||||||
- Changed exception handling/error reporting for ``os.removeFile`` and
|
- Changed exception handling/error reporting for ``os.removeFile`` and
|
||||||
``os.removeDir``.
|
``os.removeDir``.
|
||||||
- The algorithm for searching and loading configuration files has been changed.
|
- The algorithm for searching and loading configuration files has been changed.
|
||||||
- Operators now have diffent precedence rules: Assignment-like operators
|
- Operators now have diffent precedence rules: Assignment-like operators
|
||||||
(like ``*=``) are now special-cased.
|
(like ``*=``) are now special-cased.
|
||||||
- The fields in ``TStream`` have been renamed to have an ``Impl`` suffix
|
- The fields in ``TStream`` have been renamed to have an ``Impl`` suffix
|
||||||
because they should not be used directly anymore.
|
because they should not be used directly anymore.
|
||||||
Wrapper procs have been created that should be used instead.
|
Wrapper procs have been created that should be used instead.
|
||||||
- ``export`` is now a keyword.
|
- ``export`` is now a keyword.
|
||||||
- ``assert`` is now implemented in pure Nimrod as a template; it's easy
|
- ``assert`` is now implemented in pure Nimrod as a template; it's easy
|
||||||
to implement your own assertion templates with ``system.astToStr``.
|
to implement your own assertion templates with ``system.astToStr``.
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1102,7 +1105,7 @@ Language Additions
|
||||||
- Return types may be of the type ``var T`` to return an l-value.
|
- Return types may be of the type ``var T`` to return an l-value.
|
||||||
- The error pragma can now be used to mark symbols whose *usage* should trigger
|
- The error pragma can now be used to mark symbols whose *usage* should trigger
|
||||||
a compile-time error.
|
a compile-time error.
|
||||||
- There is a new ``discardable`` pragma that can be used to mark a routine
|
- There is a new ``discardable`` pragma that can be used to mark a routine
|
||||||
so that its result can be discarded implicitly.
|
so that its result can be discarded implicitly.
|
||||||
- Added a new ``noinit`` pragma to prevent automatic initialization to zero
|
- Added a new ``noinit`` pragma to prevent automatic initialization to zero
|
||||||
of variables.
|
of variables.
|
||||||
|
|
@ -1113,7 +1116,7 @@ Language Additions
|
||||||
- ``bind`` (used for symbol binding in templates and generics) is now a
|
- ``bind`` (used for symbol binding in templates and generics) is now a
|
||||||
declarative statement.
|
declarative statement.
|
||||||
- Nimrod now supports single assignment variables via the ``let`` statement.
|
- Nimrod now supports single assignment variables via the ``let`` statement.
|
||||||
- Iterators named ``items`` and ``pairs`` are implicitly invoked when
|
- Iterators named ``items`` and ``pairs`` are implicitly invoked when
|
||||||
an explicit iterator is missing.
|
an explicit iterator is missing.
|
||||||
- The slice assignment ``a[i..j] = b`` where ``a`` is a sequence or string
|
- The slice assignment ``a[i..j] = b`` where ``a`` is a sequence or string
|
||||||
now supports *splicing*.
|
now supports *splicing*.
|
||||||
|
|
@ -1131,9 +1134,9 @@ Compiler Additions
|
||||||
definitions.
|
definitions.
|
||||||
- Added a ``--nimcache:PATH`` configuration option for control over the output
|
- Added a ``--nimcache:PATH`` configuration option for control over the output
|
||||||
directory for generated code.
|
directory for generated code.
|
||||||
- The ``--genScript`` option now produces different compilation scripts
|
- The ``--genScript`` option now produces different compilation scripts
|
||||||
which do not contain absolute paths.
|
which do not contain absolute paths.
|
||||||
- Added ``--cincludes:dir``, ``--clibdir:lib`` configuration options for
|
- Added ``--cincludes:dir``, ``--clibdir:lib`` configuration options for
|
||||||
modifying the C compiler's header/library search path in cross-platform way.
|
modifying the C compiler's header/library search path in cross-platform way.
|
||||||
- Added ``--clib:lib`` configuration option for specifying additional
|
- Added ``--clib:lib`` configuration option for specifying additional
|
||||||
C libraries to be linked.
|
C libraries to be linked.
|
||||||
|
|
@ -1148,7 +1151,7 @@ Compiler Additions
|
||||||
are declared with the ``TaintedString`` string type. If the taint
|
are declared with the ``TaintedString`` string type. If the taint
|
||||||
mode is turned on it is a distinct string type which helps to detect input
|
mode is turned on it is a distinct string type which helps to detect input
|
||||||
validation errors.
|
validation errors.
|
||||||
- The compiler now supports the compilation cache via ``--symbolFiles:on``.
|
- The compiler now supports the compilation cache via ``--symbolFiles:on``.
|
||||||
This potentially speeds up compilations by an order of magnitude, but is
|
This potentially speeds up compilations by an order of magnitude, but is
|
||||||
still highly experimental!
|
still highly experimental!
|
||||||
- Added ``--import:file`` and ``--include:file`` configuration options
|
- Added ``--import:file`` and ``--include:file`` configuration options
|
||||||
|
|
@ -1160,7 +1163,7 @@ Compiler Additions
|
||||||
for ``on|off`` switches in pragmas. In order to not break existing code,
|
for ``on|off`` switches in pragmas. In order to not break existing code,
|
||||||
``on`` and ``off`` are now aliases for ``true`` and ``false`` and declared
|
``on`` and ``off`` are now aliases for ``true`` and ``false`` and declared
|
||||||
in the system module.
|
in the system module.
|
||||||
- The compiler finally supports **closures**. This is a preliminary
|
- The compiler finally supports **closures**. This is a preliminary
|
||||||
implementation, which does not yet support nestings deeper than 1 level
|
implementation, which does not yet support nestings deeper than 1 level
|
||||||
and still has many known bugs.
|
and still has many known bugs.
|
||||||
|
|
||||||
|
|
@ -1168,7 +1171,7 @@ Compiler Additions
|
||||||
Library Additions
|
Library Additions
|
||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
- Added ``system.allocShared``, ``system.allocShared0``,
|
- Added ``system.allocShared``, ``system.allocShared0``,
|
||||||
``system.deallocShared``, ``system.reallocShared``.
|
``system.deallocShared``, ``system.reallocShared``.
|
||||||
- Slicing as implemented by the system module now supports *splicing*.
|
- Slicing as implemented by the system module now supports *splicing*.
|
||||||
- Added explicit channels for thread communication.
|
- Added explicit channels for thread communication.
|
||||||
|
|
@ -1182,8 +1185,8 @@ Library Additions
|
||||||
- Added ``os.isAbsolute``, ``os.dynLibFormat``, ``os.isRootDir``,
|
- Added ``os.isAbsolute``, ``os.dynLibFormat``, ``os.isRootDir``,
|
||||||
``os.parentDirs``.
|
``os.parentDirs``.
|
||||||
- Added ``parseutils.interpolatedFragments``.
|
- Added ``parseutils.interpolatedFragments``.
|
||||||
- Added ``macros.treeRepr``, ``macros.lispRepr``, ``macros.dumpTree``,
|
- Added ``macros.treeRepr``, ``macros.lispRepr``, ``macros.dumpTree``,
|
||||||
``macros.dumpLisp``, ``macros.parseExpr``, ``macros.parseStmt``,
|
``macros.dumpLisp``, ``macros.parseExpr``, ``macros.parseStmt``,
|
||||||
``macros.getAst``.
|
``macros.getAst``.
|
||||||
- Added ``locks`` core module for more flexible locking support.
|
- Added ``locks`` core module for more flexible locking support.
|
||||||
- Added ``irc`` module.
|
- Added ``irc`` module.
|
||||||
|
|
@ -1195,7 +1198,7 @@ Library Additions
|
||||||
- Added ``actors`` module.
|
- Added ``actors`` module.
|
||||||
- Added ``algorithm`` module for generic ``sort``, ``reverse`` etc. operations.
|
- Added ``algorithm`` module for generic ``sort``, ``reverse`` etc. operations.
|
||||||
- Added ``osproc.startCmd``, ``osproc.execCmdEx``.
|
- Added ``osproc.startCmd``, ``osproc.execCmdEx``.
|
||||||
- The ``osproc`` module now uses ``posix_spawn`` instead of ``fork``
|
- The ``osproc`` module now uses ``posix_spawn`` instead of ``fork``
|
||||||
and ``exec`` on Posix systems. Define the symbol ``useFork`` to revert to
|
and ``exec`` on Posix systems. Define the symbol ``useFork`` to revert to
|
||||||
the old implementation.
|
the old implementation.
|
||||||
- Added ``intsets.assign``.
|
- Added ``intsets.assign``.
|
||||||
|
|
@ -1230,20 +1233,20 @@ Bugfixes
|
||||||
Changes affecting backwards compatibility
|
Changes affecting backwards compatibility
|
||||||
-----------------------------------------
|
-----------------------------------------
|
||||||
|
|
||||||
- Operators starting with ``^`` are now right-associative and have the highest
|
- Operators starting with ``^`` are now right-associative and have the highest
|
||||||
priority.
|
priority.
|
||||||
- Deprecated ``os.getApplicationFilename``: Use ``os.getAppFilename`` instead.
|
- Deprecated ``os.getApplicationFilename``: Use ``os.getAppFilename`` instead.
|
||||||
- Deprecated ``os.getApplicationDir``: Use ``os.getAppDir`` instead.
|
- Deprecated ``os.getApplicationDir``: Use ``os.getAppDir`` instead.
|
||||||
- Deprecated ``system.copy``: Use ``substr`` or string slicing instead.
|
- Deprecated ``system.copy``: Use ``substr`` or string slicing instead.
|
||||||
- Changed and documented how generalized string literals work: The syntax
|
- Changed and documented how generalized string literals work: The syntax
|
||||||
``module.re"abc"`` is now supported.
|
``module.re"abc"`` is now supported.
|
||||||
- Changed the behaviour of ``strutils.%``, ``ropes.%``
|
- Changed the behaviour of ``strutils.%``, ``ropes.%``
|
||||||
if both notations ``$#`` and ``$i`` are involved.
|
if both notations ``$#`` and ``$i`` are involved.
|
||||||
- The ``pegs`` and ``re`` modules distinguish between ``replace``
|
- The ``pegs`` and ``re`` modules distinguish between ``replace``
|
||||||
and ``replacef`` operations.
|
and ``replacef`` operations.
|
||||||
- The pointer dereference operation ``p^`` is deprecated and might become
|
- The pointer dereference operation ``p^`` is deprecated and might become
|
||||||
``^p`` in later versions or be dropped entirely since it is rarely used.
|
``^p`` in later versions or be dropped entirely since it is rarely used.
|
||||||
Use the new notation ``p[]`` in the rare cases where you need to
|
Use the new notation ``p[]`` in the rare cases where you need to
|
||||||
dereference a pointer explicitly.
|
dereference a pointer explicitly.
|
||||||
- ``system.readFile`` does not return ``nil`` anymore but raises an ``EIO``
|
- ``system.readFile`` does not return ``nil`` anymore but raises an ``EIO``
|
||||||
exception instead.
|
exception instead.
|
||||||
|
|
@ -1259,15 +1262,15 @@ Language Additions
|
||||||
- Case statement branches support constant sets for programming convenience.
|
- Case statement branches support constant sets for programming convenience.
|
||||||
- Tuple unpacking is not enforced in ``for`` loops anymore.
|
- Tuple unpacking is not enforced in ``for`` loops anymore.
|
||||||
- The compiler now supports array, sequence and string slicing.
|
- The compiler now supports array, sequence and string slicing.
|
||||||
- A field in an ``enum`` may be given an explicit string representation.
|
- A field in an ``enum`` may be given an explicit string representation.
|
||||||
This yields more maintainable code than using a constant
|
This yields more maintainable code than using a constant
|
||||||
``array[TMyEnum, string]`` mapping.
|
``array[TMyEnum, string]`` mapping.
|
||||||
- Indices in array literals may be explicitly given, enhancing readability:
|
- Indices in array literals may be explicitly given, enhancing readability:
|
||||||
``[enumValueA: "a", enumValueB: "b"]``.
|
``[enumValueA: "a", enumValueB: "b"]``.
|
||||||
- Added thread support via the ``threads`` core module and
|
- Added thread support via the ``threads`` core module and
|
||||||
the ``--threads:on`` command line switch.
|
the ``--threads:on`` command line switch.
|
||||||
- The built-in iterators ``system.fields`` and ``system.fieldPairs`` can be
|
- The built-in iterators ``system.fields`` and ``system.fieldPairs`` can be
|
||||||
used to iterate over any field of a tuple. With this mechanism operations
|
used to iterate over any field of a tuple. With this mechanism operations
|
||||||
like ``==`` and ``hash`` are lifted to tuples.
|
like ``==`` and ``hash`` are lifted to tuples.
|
||||||
- The slice ``..`` is now a first-class operator, allowing code like:
|
- The slice ``..`` is now a first-class operator, allowing code like:
|
||||||
``x in 1000..100_000``.
|
``x in 1000..100_000``.
|
||||||
|
|
@ -1277,12 +1280,12 @@ Compiler Additions
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
- The compiler supports IDEs via the new group of ``idetools`` command line
|
- The compiler supports IDEs via the new group of ``idetools`` command line
|
||||||
options.
|
options.
|
||||||
- The *interactive mode* (REPL) has been improved and documented for the
|
- The *interactive mode* (REPL) has been improved and documented for the
|
||||||
first time.
|
first time.
|
||||||
- The compiler now might use hashing for string case statements depending
|
- The compiler now might use hashing for string case statements depending
|
||||||
on the number of string literals in the case statement.
|
on the number of string literals in the case statement.
|
||||||
|
|
||||||
|
|
||||||
Library Additions
|
Library Additions
|
||||||
-----------------
|
-----------------
|
||||||
|
|
@ -1304,11 +1307,11 @@ Library Additions
|
||||||
``\title``, ``\white``.
|
``\title``, ``\white``.
|
||||||
- Pegs support the new built-in ``\skip`` operation.
|
- Pegs support the new built-in ``\skip`` operation.
|
||||||
- Pegs support the ``$`` and ``^`` anchors.
|
- Pegs support the ``$`` and ``^`` anchors.
|
||||||
- Additional operations were added to the ``complex`` module.
|
- Additional operations were added to the ``complex`` module.
|
||||||
- Added ``strutils.formatFloat``, ``strutils.formatBiggestFloat``.
|
- Added ``strutils.formatFloat``, ``strutils.formatBiggestFloat``.
|
||||||
- Added unary ``<`` for nice looking excluding upper bounds in ranges.
|
- Added unary ``<`` for nice looking excluding upper bounds in ranges.
|
||||||
- Added ``math.floor``.
|
- Added ``math.floor``.
|
||||||
- Added ``system.reset`` and a version of ``system.open`` that
|
- Added ``system.reset`` and a version of ``system.open`` that
|
||||||
returns a ``TFile`` and raises an exception in case of an error.
|
returns a ``TFile`` and raises an exception in case of an error.
|
||||||
- Added a wrapper for ``redis``.
|
- Added a wrapper for ``redis``.
|
||||||
- Added a wrapper for ``0mq`` via the ``zmq`` module.
|
- Added a wrapper for ``0mq`` via the ``zmq`` module.
|
||||||
|
|
@ -1334,12 +1337,12 @@ Bugfixes
|
||||||
- Bugfix: Passing a ``ref`` pointer to the untyped ``pointer`` type is invalid.
|
- Bugfix: Passing a ``ref`` pointer to the untyped ``pointer`` type is invalid.
|
||||||
- Bugfix: Updated ``keyval`` example.
|
- Bugfix: Updated ``keyval`` example.
|
||||||
- Bugfix: ``system.splitChunk`` still contained code for debug output.
|
- Bugfix: ``system.splitChunk`` still contained code for debug output.
|
||||||
- Bugfix: ``dialogs.ChooseFileToSave`` uses ``STOCK_SAVE`` instead of
|
- Bugfix: ``dialogs.ChooseFileToSave`` uses ``STOCK_SAVE`` instead of
|
||||||
``STOCK_OPEN`` for the GTK backend.
|
``STOCK_OPEN`` for the GTK backend.
|
||||||
- Bugfix: Various bugs concerning exception handling fixed.
|
- Bugfix: Various bugs concerning exception handling fixed.
|
||||||
- Bugfix: ``low(somestring)`` crashed the compiler.
|
- Bugfix: ``low(somestring)`` crashed the compiler.
|
||||||
- Bugfix: ``strutils.endsWith`` lacked range checking.
|
- Bugfix: ``strutils.endsWith`` lacked range checking.
|
||||||
- Bugfix: Better detection for AMD64 on Mac OS X.
|
- Bugfix: Better detection for AMD64 on Mac OS X.
|
||||||
|
|
||||||
|
|
||||||
Changes affecting backwards compatibility
|
Changes affecting backwards compatibility
|
||||||
|
|
@ -1348,7 +1351,7 @@ Changes affecting backwards compatibility
|
||||||
- Reversed parameter order for ``os.copyFile`` and ``os.moveFile``!!!
|
- Reversed parameter order for ``os.copyFile`` and ``os.moveFile``!!!
|
||||||
- Procs not marked as ``procvar`` cannot only be passed to a procvar anymore,
|
- Procs not marked as ``procvar`` cannot only be passed to a procvar anymore,
|
||||||
unless they are used in the same module.
|
unless they are used in the same module.
|
||||||
- Deprecated ``times.getStartMilsecs``: Use ``epochTime`` or ``cpuTime``
|
- Deprecated ``times.getStartMilsecs``: Use ``epochTime`` or ``cpuTime``
|
||||||
instead.
|
instead.
|
||||||
- Removed ``system.OpenFile``.
|
- Removed ``system.OpenFile``.
|
||||||
- Removed ``system.CloseFile``.
|
- Removed ``system.CloseFile``.
|
||||||
|
|
@ -1357,7 +1360,7 @@ Changes affecting backwards compatibility
|
||||||
- Removed ``strutils.splitLinesSeq``.
|
- Removed ``strutils.splitLinesSeq``.
|
||||||
- Removed ``strutils.splitSeq``.
|
- Removed ``strutils.splitSeq``.
|
||||||
- Removed ``strutils.toString``.
|
- Removed ``strutils.toString``.
|
||||||
- If a DLL cannot be loaded (via the ``dynlib`` pragma) ``EInvalidLibrary``
|
- If a DLL cannot be loaded (via the ``dynlib`` pragma) ``EInvalidLibrary``
|
||||||
is not raised anymore. Instead ``system.quit()`` is called. This is because
|
is not raised anymore. Instead ``system.quit()`` is called. This is because
|
||||||
raising an exception requires heap allocations. However the memory manager
|
raising an exception requires heap allocations. However the memory manager
|
||||||
might be contained in the DLL that failed to load.
|
might be contained in the DLL that failed to load.
|
||||||
|
|
@ -1367,19 +1370,19 @@ Changes affecting backwards compatibility
|
||||||
Additions
|
Additions
|
||||||
---------
|
---------
|
||||||
|
|
||||||
- The ``{.compile: "file.c".}`` pragma uses a CRC check to see if the file
|
- The ``{.compile: "file.c".}`` pragma uses a CRC check to see if the file
|
||||||
needs to be recompiled.
|
needs to be recompiled.
|
||||||
- Added ``system.reopen``.
|
- Added ``system.reopen``.
|
||||||
- Added ``system.getCurrentException``.
|
- Added ``system.getCurrentException``.
|
||||||
- Added ``system.appType``.
|
- Added ``system.appType``.
|
||||||
- Added ``system.compileOption``.
|
- Added ``system.compileOption``.
|
||||||
- Added ``times.epochTime`` and ``times.cpuTime``.
|
- Added ``times.epochTime`` and ``times.cpuTime``.
|
||||||
- Implemented explicit type arguments for generics.
|
- Implemented explicit type arguments for generics.
|
||||||
- Implemented ``{.size: sizeof(cint).}`` pragma for enum types. This is useful
|
- Implemented ``{.size: sizeof(cint).}`` pragma for enum types. This is useful
|
||||||
for interfacing with C.
|
for interfacing with C.
|
||||||
- Implemented ``{.pragma.}`` pragma for user defined pragmas.
|
- Implemented ``{.pragma.}`` pragma for user defined pragmas.
|
||||||
- Implemented ``{.extern.}`` pragma for better control of name mangling.
|
- Implemented ``{.extern.}`` pragma for better control of name mangling.
|
||||||
- The ``importc`` and ``exportc`` pragmas support format strings:
|
- The ``importc`` and ``exportc`` pragmas support format strings:
|
||||||
``proc p{.exportc: "nim_$1".}`` exports ``p`` as ``nim_p``. This is useful
|
``proc p{.exportc: "nim_$1".}`` exports ``p`` as ``nim_p``. This is useful
|
||||||
for user defined pragmas.
|
for user defined pragmas.
|
||||||
- The standard library can be built as a DLL. Generating DLLs has been
|
- The standard library can be built as a DLL. Generating DLLs has been
|
||||||
|
|
@ -1387,7 +1390,7 @@ Additions
|
||||||
- Added ``expat`` module.
|
- Added ``expat`` module.
|
||||||
- Added ``json`` module.
|
- Added ``json`` module.
|
||||||
- Added support for a *Tiny C* backend. Currently this only works on Linux.
|
- Added support for a *Tiny C* backend. Currently this only works on Linux.
|
||||||
You need to bootstrap with ``-d:tinyc`` to enable Tiny C support. Nimrod
|
You need to bootstrap with ``-d:tinyc`` to enable Tiny C support. Nimrod
|
||||||
can then execute code directly via ``nimrod run myfile``.
|
can then execute code directly via ``nimrod run myfile``.
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1406,9 +1409,9 @@ Bugfixes
|
||||||
zeros.
|
zeros.
|
||||||
- Fixed a bug in ``os.setFilePermissions`` for Windows.
|
- Fixed a bug in ``os.setFilePermissions`` for Windows.
|
||||||
- An overloadable symbol can now have the same name as an imported module.
|
- An overloadable symbol can now have the same name as an imported module.
|
||||||
- Fixed a serious bug in ``strutils.cmpIgnoreCase``.
|
- Fixed a serious bug in ``strutils.cmpIgnoreCase``.
|
||||||
- Fixed ``unicode.toUTF8``.
|
- Fixed ``unicode.toUTF8``.
|
||||||
- The compiler now rejects ``'\n'`` (use ``"\n"`` instead).
|
- The compiler now rejects ``'\n'`` (use ``"\n"`` instead).
|
||||||
- ``times.getStartMilsecs()`` now works on Mac OS X.
|
- ``times.getStartMilsecs()`` now works on Mac OS X.
|
||||||
- Fixed a bug in ``pegs.match`` concerning start offsets.
|
- Fixed a bug in ``pegs.match`` concerning start offsets.
|
||||||
- Lots of other little bugfixes.
|
- Lots of other little bugfixes.
|
||||||
|
|
@ -1440,14 +1443,14 @@ Additions
|
||||||
- Added ``graphics`` module.
|
- Added ``graphics`` module.
|
||||||
- Added ``colors`` module.
|
- Added ``colors`` module.
|
||||||
- Many wrappers now do not contain redundant name prefixes (like ``GTK_``,
|
- Many wrappers now do not contain redundant name prefixes (like ``GTK_``,
|
||||||
``lua``). The old wrappers are still available in ``lib/oldwrappers``.
|
``lua``). The old wrappers are still available in ``lib/oldwrappers``.
|
||||||
You can change your configuration file to use these.
|
You can change your configuration file to use these.
|
||||||
- Triple quoted strings allow for ``"`` in more contexts.
|
- Triple quoted strings allow for ``"`` in more contexts.
|
||||||
- ``""`` within raw string literals stands for a single quotation mark.
|
- ``""`` within raw string literals stands for a single quotation mark.
|
||||||
- Arguments to ``openArray`` parameters can be left out.
|
- Arguments to ``openArray`` parameters can be left out.
|
||||||
- More extensive subscript operator overloading. (To be documented.)
|
- More extensive subscript operator overloading. (To be documented.)
|
||||||
- The documentation generator supports the ``.. raw:: html`` directive.
|
- The documentation generator supports the ``.. raw:: html`` directive.
|
||||||
- The Pegs module supports back references via the notation ``$capture_index``.
|
- The Pegs module supports back references via the notation ``$capture_index``.
|
||||||
|
|
||||||
|
|
||||||
Changes affecting backwards compatibility
|
Changes affecting backwards compatibility
|
||||||
|
|
@ -1455,9 +1458,9 @@ Changes affecting backwards compatibility
|
||||||
|
|
||||||
- Overloading of the subscript operator only works if the type does not provide
|
- Overloading of the subscript operator only works if the type does not provide
|
||||||
a built-in one.
|
a built-in one.
|
||||||
- The search order for libraries which is affected by the ``path`` option
|
- The search order for libraries which is affected by the ``path`` option
|
||||||
has been reversed, so that the project's path is searched before
|
has been reversed, so that the project's path is searched before
|
||||||
the standard library's path.
|
the standard library's path.
|
||||||
- The compiler does not include a Pascal parser for bootstrapping purposes any
|
- The compiler does not include a Pascal parser for bootstrapping purposes any
|
||||||
more. Instead there is a ``pas2nim`` tool that contains the old functionality.
|
more. Instead there is a ``pas2nim`` tool that contains the old functionality.
|
||||||
- The procs ``os.copyFile`` and ``os.moveFile`` have been deprecated
|
- The procs ``os.copyFile`` and ``os.moveFile`` have been deprecated
|
||||||
|
|
@ -1484,7 +1487,7 @@ Bugfixes
|
||||||
- Method call syntax for iterators works again (``for x in lines.split()``).
|
- Method call syntax for iterators works again (``for x in lines.split()``).
|
||||||
- Fixed a typo in ``removeDir`` for POSIX that lead to an infinite recursion.
|
- Fixed a typo in ``removeDir`` for POSIX that lead to an infinite recursion.
|
||||||
- The compiler now checks that module filenames are valid identifiers.
|
- The compiler now checks that module filenames are valid identifiers.
|
||||||
- Empty patterns for the ``dynlib`` pragma are now possible.
|
- Empty patterns for the ``dynlib`` pragma are now possible.
|
||||||
- ``os.parseCmdLine`` returned wrong results for trailing whitespace.
|
- ``os.parseCmdLine`` returned wrong results for trailing whitespace.
|
||||||
- Inconsequent tuple usage (using the same tuple with and without named fields)
|
- Inconsequent tuple usage (using the same tuple with and without named fields)
|
||||||
does not crash the code generator anymore.
|
does not crash the code generator anymore.
|
||||||
|
|
@ -1513,11 +1516,11 @@ Changes affecting backwards compatibility
|
||||||
has changed.
|
has changed.
|
||||||
- ``os.splitFile(".xyz")`` now returns ``("", ".xyz", "")`` instead of
|
- ``os.splitFile(".xyz")`` now returns ``("", ".xyz", "")`` instead of
|
||||||
``("", "", ".xyz")``. So filenames starting with a dot are handled
|
``("", "", ".xyz")``. So filenames starting with a dot are handled
|
||||||
differently.
|
differently.
|
||||||
- ``strutils.split(s: string, seps: set[char])`` never yields the empty string
|
- ``strutils.split(s: string, seps: set[char])`` never yields the empty string
|
||||||
anymore. This behaviour is probably more appropriate for whitespace splitting.
|
anymore. This behaviour is probably more appropriate for whitespace splitting.
|
||||||
- The compiler now stops after the ``--version`` command line switch.
|
- The compiler now stops after the ``--version`` command line switch.
|
||||||
- Removed support for enum inheritance in the parser; enum inheritance has
|
- Removed support for enum inheritance in the parser; enum inheritance has
|
||||||
never been documented anyway.
|
never been documented anyway.
|
||||||
- The ``msg`` field of ``system.E_base`` has now the type ``string``, instead
|
- The ``msg`` field of ``system.E_base`` has now the type ``string``, instead
|
||||||
of ``cstring``. This improves memory safety.
|
of ``cstring``. This improves memory safety.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue