Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #24446

Re: jonesforth: taking up the challenge

Date 2013-07-12 07:59 -1000
From "Elizabeth D. Rather" <erather@forth.com>
Organization FORTH, Inc.
Newsgroups comp.lang.forth
Subject Re: jonesforth: taking up the challenge
References <51ae2e6d$0$26867$e4fe514c@dreader37.news.xs4all.nl> <85siztlg15.fsf@junk.nocrew.org> <51df64bd$0$6341$e4fe514c@dreader35.news.xs4all.nl> <NoydnfOnfPNxGkLMnZ2dnUVZ_sidnZ2d@supernews.com> <51e03eb7$0$585$e4fe514c@dreader34.news.xs4all.nl>
Message-ID <-Pydnewrdol63n3MnZ2dnUVZ_sOdnZ2d@supernews.com> (permalink)

Show all headers | View raw


On 7/12/13 7:36 AM, Albert van der Horst wrote:
> In article <NoydnfOnfPNxGkLMnZ2dnUVZ_sidnZ2d@supernews.com>,
> Elizabeth D. Rather <erather@forth.com> wrote:
...
>> And why is it a "micro optimization" that DO always executes once? That
>> reasoning is perfectly straightforward: the test for exiting it is at
>> the end. If you want the test at the beginning, use BEGIN ... WHILE ...
>> REPEAT.
>
> Some one not looking inside the implementation would expect DO to have
> the behaviour of ?DO. Really, I'm pretty sure of that.
> But you set me thinking. The solution could be to restrict yourforth to
> `` ?DO LOOP I '' working on signed numbers only.
> Those who later work with a 16-bit embedded system processor are in a
> position to understand the merits of `` 7000 C000 DO .. LOOP ''

Having taught many, many Forth beginners over the years, I can honestly 
say I have never encountered one who expected DO to exit the loop. Why 
would anyone confuse DO with ?DO, since they have different names? I 
always teach DO first, and then point out ?DO as a safety mechanism for 
situations in which the arguments might be even.

The situations in which ?DO is appropriate are actually the minority in 
my experience with applications. The most common situation is when 
you're saying something like ... SIZE 0 DO ... where SIZE is obviously a 
non-zero constant (and I say "obviously" because the person writing this 
loop is probably also the person who defined SIZE).

Cheers,
Elizabeth

-- 
==================================================
Elizabeth D. Rather   (US & Canada)   800-55-FORTH
FORTH Inc.                         +1 310.999.6784
5959 West Century Blvd. Suite 700
Los Angeles, CA 90045
http://www.forth.com

"Forth-based products and Services for real-time
applications since 1973."
==================================================

Back to comp.lang.forth | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Re: jonesforth: taking up the challenge Lars Brinkhoff <lars.spam@nocrew.org> - 2013-07-05 07:41 +0200
  Re: jonesforth: taking up the challenge albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-07-05 14:45 +0000
  Re: jonesforth: taking up the challenge Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-07-05 09:58 -0500
  Re: jonesforth: taking up the challenge albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-07-12 02:06 +0000
    Re: jonesforth: taking up the challenge "Elizabeth D. Rather" <erather@forth.com> - 2013-07-11 18:36 -1000
      Re: jonesforth: taking up the challenge albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-07-12 17:36 +0000
        Re: jonesforth: taking up the challenge "Elizabeth D. Rather" <erather@forth.com> - 2013-07-12 07:59 -1000
          Re: jonesforth: taking up the challenge Paul Rubin <no.email@nospam.invalid> - 2013-07-12 11:23 -0700
            Re: jonesforth: taking up the challenge Coos Haak <chforth@hccnet.nl> - 2013-07-12 21:10 +0200
        Re: jonesforth: taking up the challenge "Rod Pemberton" <do_not_have@notemailnotq.cpm> - 2013-07-13 06:19 -0400

csiph-web