diff --git a/forge/sf.lisp b/forge/sf.lisp index 5ff4de0..3165974 100644 --- a/forge/sf.lisp +++ b/forge/sf.lisp @@ -135,7 +135,7 @@ (car (stack *forge-env*))) (defun next () - (pushd (iter:next-value *code*))) + (pushd (pop *code*))) ;;;; builtins @@ -149,7 +149,7 @@ #:ptr #:get #:put #:in #:next #:call #:call-if #:call-while #:comp - #:)) + #: #:val)) (in-package :sf-builtin) @@ -197,4 +197,6 @@ (f:reg '/> #'(lambda () (iter:stop f:*input*)) 'f:comp-word) +(f:reg 'val #'(lambda () (f:pushd (list #'f:next (f:popd))))) + ;;;; forge-code word definitions diff --git a/test/test-sf.lisp b/test/test-sf.lisp index ec0ce5b..760b332 100644 --- a/test/test-sf.lisp +++ b/test/test-sf.lisp @@ -37,3 +37,6 @@ (forge:exec-string "") (forge:exec-list '(3 cube)) (== (forge:popd) 27)) + +(deftest test-val () + (forge:exec-list '()))