all repos — min @ 5dba95de551d5ababe228aee740db425bb3aa5c7

A small but practical concatenative programming language.

feat(size) Added size symbol.
h3rald h3rald@h3rald.com
Sun, 29 May 2016 16:20:00 +0200
commit

5dba95de551d5ababe228aee740db425bb3aa5c7

parent

9d08cf3e3978dcd94ed7d6b6914cc574d6253f3f

2 files changed, 7 insertions(+), 9 deletions(-)

jump to
M lib/lang.nimlib/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.mintests/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