[']

Interpretation:

Interpretation semantics for this word are undefined.

Compilation:

( "<spaces>name" -- )

Skip leading space delimiters. Parse name delimited by a space. Find name. Append the run-time semantics given below to the current definition.

An ambiguous condition exists if name is not found.

Run-time:

( -- xt )

Place name's execution token xt on the stack. The execution token returned by the compiled phrase "['] X" is the same value returned by "' X" outside of compilation state.

See:

Rationale:

Typical use: : X ... ['] name ... ;

See: A.6.1.1550 FIND.

Testing:

T{ : GT2 ['] GT1 ; IMMEDIATE -> }T
T{ GT2 EXECUTE -> 123 }T

ContributeContributions

NieDzejkobavatar of NieDzejkob Suggested reference implementationSuggested reference implementation2018-01-06 18:17:01

: ['] IMMEDIATE ' POSTPONE LITERAL ;

AntonErtlavatar of AntonErtl 2018-01-07 18:05:20

IMMEDIATE is not immediate, so this won't work. A working version is:

: ['] ( compilation: "name" --; run-time: -- xt ) ' POSTPONE literal ; immediate

NieDzejkobavatar of NieDzejkob 2018-01-08 15:54:04

Sorry, my Forth is slightly non-standard in that regard.

Reply