diff options
author | Araq <rumpf_a@web.de> | 2012-03-13 02:01:56 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2012-03-13 02:01:56 +0100 |
commit | c25ffbf2622a197c15a4a3bd790b1bc788db2c7f (patch) | |
tree | d1a23e97a11a92bc83286fd77ba4e4a953d753fa /lib | |
parent | 1d8ff40f5679d3ddfa10a89b0333a0132ee1e1b2 (diff) | |
download | Nim-c25ffbf2622a197c15a4a3bd790b1bc788db2c7f.tar.gz |
first steps for cleaner static/const distinction
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/core/macros.nim | 3 | ||||
-rwxr-xr-x | lib/system.nim | 12 |
2 files changed, 8 insertions, 7 deletions
diff --git a/lib/core/macros.nim b/lib/core/macros.nim index 19869c8eb..2e82e1375 100755 --- a/lib/core/macros.nim +++ b/lib/core/macros.nim @@ -87,7 +87,8 @@ type ## represents a Nimrod *symbol* in the compiler; a *symbol* is a looked-up ## *ident*. - PNimrodNode* = expr + TNimrodNode {.final.} = object + PNimrodNode* = ref TNimrodNode ## represents a Nimrod AST node. Macros operate on this type. const diff --git a/lib/system.nim b/lib/system.nim index bfaa5eb8f..c92c86443 100755 --- a/lib/system.nim +++ b/lib/system.nim @@ -2213,12 +2213,12 @@ proc shallow*(s: var string) {.noSideEffect, inline.} = var s = cast[PGenericSeq](s) s.reserved = s.reserved or seqShallowFlag -template static*(e: expr): expr = - ## evaluates a given expression `e` at compile-time - ## even if it has side effects - block: - const res = e - res +#template static*(e: expr): expr = +# ## evaluates a given expression `e` at compile-time +# ## even if it has side effects +# block: +# const res = e +# res template eval*(blk: stmt): stmt = ## executes a block of code at compile time just as if it was a macro |