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 ; #! : found ( word -- ? ) search 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 ;