Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!rt.uk.eu.org!aioe.org!.POSTED!not-for-mail From: "Rod Pemberton" Newsgroups: comp.lang.forth Subject: Re: DON'T Date: Sat, 31 May 2014 17:58:13 -0400 Organization: Aioe.org NNTP Server Lines: 40 Message-ID: References: <81a8b0d8-66e0-45db-93f3-016b98bb997f@googlegroups.com> NNTP-Posting-Host: CNsg4fVcCsvs3UaOgZtQCw.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Opera Mail/12.16 (Linux) X-Notice: Filtered by postfilter v. 0.8.2 Xref: csiph.com comp.lang.forth:31096 On Sat, 31 May 2014 13:49:25 -0400, Jason Damisch wrote: > There is a Forth word called DO, but there is not a Forth word called > DON'T. I was playing with the idea of how could there be a Forth word > called DON'T. Then I had a funny idea. > > Suppose that you had an array of behaviors for a robot or something > else. Each item in the array is a vector to a behavior. The word DON'T > would set some of these vectors to NOOP. Then when the code which needs > to step through the array to execute some of the vectors, finds a NOOP, > it will execute the NOOP instead and as a result, nothing will happen > then. > > For what it's worth. > But, your DON'T is _not_ related in any way to Forth's DO ... Or, what's wrong with a DON'T ... LOOP ? I think hear some laughter, but I'm not joking ... Perhaps, DON'T could define a range to skip in a LOOP. E.g., modified "Starting Forth" example for DO ... LOOP: 10 0 3 7 DON'T I . LOOP 0 1 2 7 8 9 It might be implementable with a conditional +LOOP when I is 3 ... ? I have no serious thoughts on the order of 3 7 is 3 7 or 7 3 or whether 3 or 7 are inclusive or exclusive. Your choice. Also, not to be finicky, but would you really put an apostrophe in the name of a FORTH word? Yes, we have ' (tick) ['] but otherwise ... Rod Pemberton