Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!newsfeed.straub-nv.de!proxad.net!feeder1-2.proxad.net!usenet-fr.net!gegeweb.org!aioe.org!.POSTED!not-for-mail From: "Rod Pemberton" Newsgroups: comp.lang.forth Subject: Re: unexpected +LOOP behavior Date: Mon, 25 May 2015 17:27:25 -0400 Organization: Aioe.org NNTP Server Lines: 31 Message-ID: References: <80773739-ddd7-4a06-9200-9d7145d0f492@googlegroups.com> <1a315aac-9a17-4645-89f5-5baac403d4b3@googlegroups.com> <11e526ae-3d3a-4e92-bbc9-da83bc5d2888@googlegroups.com> <556310d8$0$2873$e4fe514c@news2.news.xs4all.nl> NNTP-Posting-Host: n4wpt9zq8xR26Ttf9mo2BA.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:39305 On Mon, 25 May 2015 08:08:59 -0400, Hans Bezemer wrote: > hughaguilar96@gmail.com wrote: >> Of course, this is totally baffling to the user who would intuitively >> expect 2>R to be the same as >R >R. A lot of people have tried to learn >> ANS-Forth, but have become confused by the weird and pointless >> "optimizations" such as this, and so they just gave up and went back to >> C programming. > > Agreed. It's more efficient as well: > > : 2>r >r >r ; > : 2r@ r> r@ over >r ; > : 2r> r> r> ; > > Again: if you're treating something as a unit (2 cells), don't start > using it as half a unit halfway. If you abide by this rule, it doesn't > really matter if you use these definitions or the "SWAPped" ones. > > It's these quirks that make Forth a "write only" language. If 2R> is a primitive, what's to prevent someone from doing this: : SWAP >R >R 2R> ; Rod Pemberton -- If fewer guns reduced murders, how does one explain Moscow, Chicago, New York, and South Africa?