ANEW --ULTQUE-- \ Neil Bawd 2003-02-22 \ ******************************************************************* \ * * \ * Neil Bawd 1986-11-29 * \ * * \ * The Ultimate Question ?? * \ * * \ * This was the first appearance by Neil Bawd. He asked how * \ * could it be implemented in high-level Forth. In Standard * \ * Forth it can done with `EVALUATE` or `POSTPONE`. * \ * * \ * ?? ( ... x "word" -- ??? ) * \ * If top of stack is true, execute the next word. The next * \ * word may be anything. * \ * * \ * This one definition takes the place of many: * \ * * \ * ?? EXIT for IF EXIT THEN * \ * ?? 1+ for IF 1+ THEN * \ * ?? NEGATE for IF NEGATE THEN * \ * ?? CR for IF CR THEN * \ * ?? RECURSE for IF RECURSE THEN * \ * * \ * Etcetera. * \ * * \ ******************************************************************* Either: : ?? ( x "word" -- ) S" IF " EVALUATE BL WORD COUNT EVALUATE S" THEN " EVALUATE ; IMMEDIATE Or: : ?? ( x "word" -- ) postpone IF BL WORD COUNT EVALUATE postpone THEN ; IMMEDIATE \\ // \\ // \\ // \\ // \\ // \\ // \\ // \\