CHAR

( "<spaces>name" -- char )

Skip leading space delimiters. Parse name delimited by a space. Put the value of its first character onto the stack.

See:

Rationale:

Typical use: ... CHAR A CONSTANT "A" ...

Testing:

T{ CHAR X     -> 58 }T
T{ CHAR HELLO -> 48 }T

ContributeContributions

BerndPaysanavatar of BerndPaysan Non-XCHAR implementationSuggested reference implementation2015-11-27 20:45:54

: CHAR ( "char"<space> -- c ) BL WORD CHAR+ C@ ;

Reply