Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!unix.cis.pitt.edu!pitt!willett!ForthNet From: ForthNet@willett.pgh.pa.us (ForthNet articles from GEnie) Newsgroups: comp.lang.forth Subject: ANS TC - Between the cracks Message-ID: <2315.UUL1.3#5129@willett.pgh.pa.us> Date: 9 Feb 91 03:15:23 GMT Organization: (n.) to be organized. But that's not important right now. Lines: 31 Category 10, Topic 28 Message 107 Fri Feb 08, 1991 B.RODRIGUEZ2 [Brad] at 19:57 EST Here's something else which (to my mind) cannot be implemented _efficiently_ in a portable way using ANS Forth. Even the inefficient ways are difficult. : || IF R> DROP -1 THEN ; ( t - t) ( f - ) ( exit on true) : && 0= IF R> DROP 0 THEN ; ( t - ) ( f - f) ( exit on false) I've named these in honor of the "C" operators they mimic. Marla Bartel named them TEXIT and FEXIT, respectively, in The Computer Journal #43. I have used these words since about 1985 on a variety of systems, and I have found them _very_ useful to build parsers (sigForth Newsletter, pending), pattern matchers (FORML '89), and expert systems (Rochester '90). Their dependence on return-stack manipulation means that they can't be implemented portably in ANS Forth. I've implemented similar words using conditional branches -- requiring a closure word -- but the result is incredibly clumsy, noticeably slower, and requires roughly twice the memory in my typical applications. Perhaps I should submit these words for consideration. :-) - Brad ----- This message came from GEnie via willett. You cannot Reply to the author using email. Please post a follow-up article, or use any instructions the author may have included (USMail addresses, telephone #, whatever). Report problems to: dwp@willett.pgh.pa.us or uunet!willett!dwp