Path: csiph.com!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail From: "Rod Pemberton" Newsgroups: comp.lang.forth Subject: Re: unexpected +LOOP behavior Date: Wed, 27 May 2015 17:33:57 -0400 Organization: Aioe.org NNTP Server Lines: 51 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:39365 On Mon, 25 May 2015 20:47:13 -0400, Elizabeth D. Rather wrote: > On 5/25/15 11:27 AM, Rod Pemberton wrote: >> 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> ; > > Nothing, except the fact that SWAP (which is also a primitive in most > systems) will then be slower. What? ... Ms. Rather, you seemed to have dropped usage of "low-level word" for "primitives." Well, it might be good for bootstrapping a system, i.e., because it's more factored and has less redundancy of functionality. If you need fewer words, this could save a word or two. However, this was really just an off-beat comment on "quirks" and "write only". Rod Pemberton -- If fewer guns reduced murders, how does one explain Moscow, Chicago, New York, and South Africa?