From ba3f6de717aeeed0effe68ff0761b3efd4efb87a Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Fri, 27 Jun 2014 17:26:53 +0400 Subject: [PATCH] added a prefix construct... Signed-off-by: Alex A. Naanou --- Slang/slang.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Slang/slang.js b/Slang/slang.js index ea36375..1fcde7e 100755 --- a/Slang/slang.js +++ b/Slang/slang.js @@ -849,6 +849,20 @@ var BOOTSTRAP = [ 'infix: >= ge', '', '', +'-- swap stack and code untill the block finishes and consumes it\'s arguments', +'-- then swap them back...', +':: prefix: ( | op word -- | ) [', +' [', +' -- format the word definition...', +' -- NAME WORD -> :: NAME WORD', +' s2b \\ :: -2 before b2s', +'', +' -- the code template', +' [ \\ _flip \\ exec \\ WORD _flip ] clone', +' swap WORD replace', +' 3 0 _swapN', +' ] \\ exec 2 2 _swapN ]', +'', '', '-- Tests and examples...', '',