Re:With friends like these
by zwkrt on Saturday August 17, 2019 @06:35PM
(#20726862)
Hyphens and question marks in identifiers is actually the biggest feature I wish other languages would steal from Lisp. It does help that lisp doesn’t suffer from the “is it an infix operator?” parsing problem, which exists for both programmatic and meat-based compilers.
[ Parent
| on HN ]
Re:With friends like these
by DonHopkins on Saturday August 17, 2019 @11:45PM
(#20728110)
Then you'd love FORTH. Why limit yourself to hyphens and question marks? The only character you can't use in a FORTH identifier is space.
FORTH ?KNOW IF HONK ELSE FORTH LEARN THEN
: C(-; LICK SMILE NOSE WINK ;
\ FORTH PAPER TAPE PUNCHER:
: PT# ( L --- L/2 )
DUP 1 AND IF
ASCII @
ELSE BL THEN
HOLD
2/
;
: PT. ( N --- )
<# PT# PT# PT#
ASCII . HOLD
PT# PT# PT# PT#
#> TYPE
;
: CUT
." -----------" CR
;
: PTAPE
CUT
BEGIN
KEY ?DUP WHILE
DUP ." |" PT. ." |" SPACE EMIT CR
REPEAT
CUT
;