Paste: lookup problems

Author: GeoffSK
Mode: factor
Date: Sat, 23 May 2009 05:10:23
Plain Text |
: func ( n -- n ) 2 * ; inline
: do-funcs ( x word-str -- )
    "scatchpad" lookup dup
    [ execute ]
    [ drop "Not found" ]
    if
    print
    ;


! Got a computed value where a literal value was expected

Annotation: execute(

Author: slava
Mode: factor
Date: Sat, 23 May 2009 05:19:24
Plain Text |
slava>	the problem is not lookup, its execute
	<slava>	the compiler has no way of knowing what the stack effect of your word is, since you look it up dynamically
	<slava>	you want to use execute( instead
	<slava>	\ execute( help
	<slava>	eg, 1 2 \ + execute( x y -- z )

New Annotation

Summary:
Author:
Mode:
Body: