Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!ucbvax!ENG.SUN.COM!Mitch.Bradley From: Mitch.Bradley@ENG.SUN.COM Newsgroups: comp.lang.forth Subject: State smart words in ANS Forth Message-ID: <9104242121.AA14249@ucbvax.Berkeley.EDU> Date: 24 Apr 91 17:48:31 GMT Sender: daemon@ucbvax.BERKELEY.EDU Reply-To: Mitch.Bradley%ENG.SUN.COM@SCFVM.GSFC.NASA.GOV Organization: The Internet Lines: 15 > Is there any way to create state-smart words (words that know if they would > be compiled or interpreted if they were not IMMEDIATE) in dpANS Forth? Yes. Same as always: : A-STATE-SMART-WORD ( -- ) STATE @ IF ." I'm compiling a literal" CR 1234 [COMPILE] LITERAL ELSE ." Sorry, I have no interpretation behavior" CR THEN ; IMMEDIATE Mitch.Bradley@Eng.Sun.COM