Paste: lorem ipsum demo
Author: | brweber2 |
Mode: | factor |
Date: | Fri, 9 Oct 2009 02:50:57 |
Plain Text |
USING: vocabs.parser lexer words effects locals io kernel compiler.units ;
IN: demo
: sit ( -- ) "hello world!" print ;
: cupidatat ( -- ) "quit complaining about how hard this is to understand..." print ;
: found ( word -- ? ) "demo" lookup f = not ;
:: define-word ( word -- ) [ word "demo" create [ ] \ sit stack-effect define-declared ] with-compilation-unit ;
:: exec-or-define ( word -- ) word found [ word "demo" lookup execute( -- ) ] [ word define-word ] if ;
: done? ( -- value ? ) scan dup f = ;
: recurse ( -- ) done? [ drop ] [ exec-or-define recurse ] if ;
SYNTAX: Lorem recurse ;
New Annotation