feat(size) Added size symbol.
h3rald h3rald@h3rald.com
Sun, 29 May 2016 16:20:00 +0200
2 files changed,
7 insertions(+),
9 deletions(-)
M
lib/lang.nim
→
lib/lang.nim
@@ -283,6 +283,13 @@ if index.isInt and q.isQuotation:
i.push q.qVal[index.intVal] else: i.error errIncorrect, "An integer and a quotation are required on the stack" + + .symbol("size") do (i: In): + let q = i.pop + if not q.isQuotation: + i.error errNoQuotation + return + i.push q.qVal.len.newVal .symbol("map") do (i: In): let prog = i.pop
M
tests/test.min
→
tests/test.min
@@ -51,12 +51,3 @@ map
) :report ) =test - -; Sample unit test program -;"maths" describe -; (2 3 ==) assert -; (2 1 >) assert -; (2 1 <) assert -; (4 4 ==) assert -; (7 7 ==) assert -; report