Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Forth can be used to create 'if' statements from scratch, too. Many Forth implementations start up by loading a set of definitions for things like comments, conditionals and flow control.

  : IF    COMPILE 0BRANCH HERE 0 ,                 ; IMMEDIATE
  : ELSE  COMPILE BRANCH HERE SWAP 0 , HERE SWAP ! ; IMMEDIATE
  : THEN  HERE SWAP !                              ; IMMEDIATE


Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: