mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
added system.typed and system.untyped aliases
This commit is contained in:
@@ -76,6 +76,10 @@ type
|
||||
void* {.magic: "VoidType".} ## meta type to denote the absence of any type
|
||||
auto* = expr
|
||||
any* = distinct auto
|
||||
untyped* {.magic: Expr.} ## meta type to denote an expression that
|
||||
## is not resolved (for templates)
|
||||
typed* {.magic: Stmt.} ## meta type to denote an expression that
|
||||
## is resolved (for templates)
|
||||
|
||||
SomeSignedInt* = int|int8|int16|int32|int64
|
||||
## type class matching all signed integer types
|
||||
|
||||
@@ -3,12 +3,12 @@ discard """
|
||||
line: 18
|
||||
errormsg: "undeclared identifier: \'b\'"
|
||||
"""
|
||||
template declareInScope(x: expr, t: typeDesc): stmt {.immediate.} =
|
||||
template declareInScope(x: untyped, t: typeDesc): untyped {.immediate.} =
|
||||
var x: t
|
||||
|
||||
template declareInNewScope(x: expr, t: typeDesc): stmt {.immediate.} =
|
||||
|
||||
template declareInNewScope(x: untyped, t: typeDesc): untyped {.immediate.} =
|
||||
# open a new scope:
|
||||
block:
|
||||
block:
|
||||
var x: t
|
||||
|
||||
declareInScope(a, int)
|
||||
|
||||
2
todo.txt
2
todo.txt
@@ -2,8 +2,6 @@ version 0.10.4
|
||||
==============
|
||||
|
||||
- make 'nil' work for 'add' and 'len'
|
||||
- introduce typed/untyped types
|
||||
|
||||
|
||||
version 1.0
|
||||
===========
|
||||
|
||||
@@ -69,6 +69,10 @@ News
|
||||
spacing around binary operators. Later versions of the language will parse
|
||||
these as unary operators instead so that ``echo $foo`` finally can do what
|
||||
people expect it to do.
|
||||
- ``system.untyped`` and ``system.typed`` have been introduced as aliases
|
||||
for ``expr`` and ``stmt``. The new names capture the semantics much better
|
||||
and most likely ``expr`` and ``stmt`` will be deprecated in favor of the
|
||||
new names.
|
||||
|
||||
|
||||
Language Additions
|
||||
|
||||
Reference in New Issue
Block a user