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


Groups > comp.lang.forth > #9864 > unrolled thread

In Forth, is it valid or safe to use the value of 'I' after LOOP?

Started by"Rod Pemberton" <do_not_have@noavailemail.cmm>
First post2012-03-05 16:23 -0500
Last post2012-03-14 20:13 -0400
Articles 20 on this page of 102 — 20 participants

Back to article view | Back to comp.lang.forth


Contents

  In Forth, is it valid or safe to use the value of 'I' after LOOP? "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-03-05 16:23 -0500
    Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? "Elizabeth D. Rather" <erather@forth.com> - 2012-03-05 12:11 -1000
      Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? "Elizabeth D. Rather" <erather@forth.com> - 2012-03-05 13:44 -1000
        Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-03-06 11:26 +0000
          Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? rickman <gnuarm@gmail.com> - 2012-03-06 05:42 -0800
            Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-03-06 14:51 +0000
              Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-03-06 10:17 -0600
                Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-03-06 16:49 +0000
                  Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-03-06 11:56 -0600
                    Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-03-06 18:07 +0000
                      Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-03-07 04:14 -0600
                        Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-03-12 15:56 +0000
                          Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-03-12 11:23 -0500
                            Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-03-12 16:26 +0000
                              Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-03-12 12:28 -0500
                  Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-03-06 13:36 -0500
                    Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? "Elizabeth D. Rather" <erather@forth.com> - 2012-03-06 09:18 -1000
                    Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? hwfwguy@gmail.com - 2012-03-06 20:14 -0800
                      Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? BruceMcF <agila61@netscape.net> - 2012-03-07 08:22 -0800
                        Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? rickman <gnuarm@gmail.com> - 2012-03-07 10:20 -0800
                          Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? BruceMcF <agila61@netscape.net> - 2012-03-07 11:11 -0800
                        Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? hwfwguy@gmail.com - 2012-03-07 19:07 -0800
                          Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? BruceMcF <agila61@netscape.net> - 2012-03-08 10:11 -0800
                          Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-03-12 09:36 +0000
                      Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-03-12 16:01 +0000
                  Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? Alex McDonald <blog@rivadpm.com> - 2012-03-06 13:13 -0800
                    Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-03-12 16:04 +0000
                  Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? BruceMcF <agila61@netscape.net> - 2012-03-12 13:40 -0700
              Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? rickman <gnuarm@gmail.com> - 2012-03-07 10:15 -0800
                Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? BruceMcF <agila61@netscape.net> - 2012-03-07 10:33 -0800
                Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? "Elizabeth D. Rather" <erather@forth.com> - 2012-03-07 17:16 -1000
                Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-03-12 11:18 +0000
                  Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? "Elizabeth D. Rather" <erather@forth.com> - 2012-03-12 08:01 -1000
            Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? jacko <jackokring@gmail.com> - 2012-03-15 18:59 -0700
              Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? Coos Haak <chforth@hccnet.nl> - 2012-03-16 20:36 +0100
      Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-03-06 13:33 -0500
        Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? "Elizabeth D. Rather" <erather@forth.com> - 2012-03-06 09:07 -1000
          Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-03-06 18:20 -0500
            Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? "Elizabeth D. Rather" <erather@forth.com> - 2012-03-06 14:07 -1000
              Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? John Passaniti <john.passaniti@gmail.com> - 2012-03-06 16:53 -0800
                Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? "Elizabeth D. Rather" <erather@forth.com> - 2012-03-06 19:26 -1000
              Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-03-10 19:04 -0500
                Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? BruceMcF <agila61@netscape.net> - 2012-03-10 18:44 -0800
                  Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-03-11 17:06 -0400
                    Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? BruceMcF <agila61@netscape.net> - 2012-03-11 17:01 -0700
                Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? "Paul E. Bennett" <Paul_E.Bennett@topmail.co.uk> - 2012-03-11 12:51 +0000
                  Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? BruceMcF <agila61@netscape.net> - 2012-03-11 14:04 -0700
                    Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? Paul Rubin <no.email@nospam.invalid> - 2012-03-11 14:41 -0700
                      Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-03-12 05:16 -0500
                      Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? BruceMcF <agila61@netscape.net> - 2012-03-12 08:06 -0700
                    Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? "Paul E. Bennett" <Paul_E.Bennett@topmail.co.uk> - 2012-03-11 21:55 +0000
                      Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? BruceMcF <agila61@netscape.net> - 2012-03-11 17:17 -0700
                    Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? Albert van der Horst <albert@spenarnc.xs4all.nl> - 2012-03-12 11:00 +0000
                Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? Josh Grams <josh@qualdan.com> - 2012-03-11 17:27 +0000
                  Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? Paul Rubin <no.email@nospam.invalid> - 2012-03-11 14:12 -0700
                    Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? Josh Grams <josh@qualdan.com> - 2012-03-11 21:48 +0000
                      Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? "Elizabeth D. Rather" <erather@forth.com> - 2012-03-11 14:24 -1000
                    Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? BruceMcF <agila61@netscape.net> - 2012-03-11 17:09 -0700
                  Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-03-11 17:34 -0400
                    Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? "Elizabeth D. Rather" <erather@forth.com> - 2012-03-11 13:18 -1000
                    Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? BruceMcF <agila61@netscape.net> - 2012-03-11 17:32 -0700
                    Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? Josh Grams <josh@qualdan.com> - 2012-03-13 13:18 +0000
                      Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-03-19 03:36 -0400
                    Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? jacko <jackokring@gmail.com> - 2012-03-15 19:37 -0700
                    Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? BruceMcF <agila61@netscape.net> - 2012-03-16 05:31 -0700
                      Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-03-19 03:38 -0400
                        Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? BruceMcF <agila61@netscape.net> - 2012-03-19 11:35 -0700
                    Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? Coos Haak <chforth@hccnet.nl> - 2012-03-16 20:39 +0100
                Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? Mark Wills <markrobertwills@yahoo.co.uk> - 2012-03-12 12:50 -0700
                Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? jacko <jackokring@gmail.com> - 2012-03-15 19:27 -0700
            Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? BruceMcF <agila61@netscape.net> - 2012-03-07 08:16 -0800
            Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? jacko <jackokring@gmail.com> - 2012-03-15 19:09 -0700
    Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? rickman <gnuarm@gmail.com> - 2012-03-05 14:23 -0800
    Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? BruceMcF <agila61@netscape.net> - 2012-03-05 17:42 -0800
    Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? hwfwguy@gmail.com - 2012-03-06 09:36 -0800
    Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? Albert van der Horst <albert@spenarnc.xs4all.nl> - 2012-03-08 10:41 +0000
    Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-03-08 05:38 -0800
      Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? hwfwguy@gmail.com - 2012-03-09 10:32 -0800
        Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-03-12 19:26 -0700
        Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-03-13 04:15 -0400
    Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? Coos Haak <chforth@hccnet.nl> - 2012-03-12 01:11 +0100
      Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-03-12 19:41 -0400
        Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? "Elizabeth D. Rather" <erather@forth.com> - 2012-03-12 16:46 -1000
          Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-03-12 21:17 -0700
            Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-03-13 05:01 -0400
              Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? Mark Wills <markrobertwills@yahoo.co.uk> - 2012-03-13 03:06 -0700
                Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? Paul Rubin <no.email@nospam.invalid> - 2012-03-13 12:32 -0700
                  Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? Mark Wills <markrobertwills@yahoo.co.uk> - 2012-03-13 14:01 -0700
                    Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? Paul Rubin <no.email@nospam.invalid> - 2012-03-14 11:47 -0700
                      Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? "A. K." <akk@nospam.org> - 2012-03-14 22:13 +0100
                  Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-03-14 03:39 -0500
                    Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? "Elizabeth D. Rather" <erather@forth.com> - 2012-03-14 06:54 -1000
                      Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-03-14 16:39 -0700
                      Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? Albert van der Horst <albert@spenarnc.xs4all.nl> - 2012-03-15 10:49 +0000
                  Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? Alex McDonald <blog@rivadpm.com> - 2012-03-14 08:53 -0700
                    Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? "A. K." <akk@nospam.org> - 2012-03-14 17:01 +0100
                      Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? George Hubert <georgeahubert@yahoo.co.uk> - 2012-03-14 11:21 -0700
                        Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? "A. K." <akk@nospam.org> - 2012-03-14 19:25 +0100
                Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-03-14 16:37 -0700
                  Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-03-15 04:28 -0400
              Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? "David N. Williams" <williams@umich.edu> - 2012-03-13 16:19 -0400
                Re: In Forth, is it valid or safe to use the value of 'I' after LOOP? "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-03-14 20:13 -0400

Page 2 of 6 — ← Prev page 1 [2] 3 4 5 6  Next page →


#9917

FromBruceMcF <agila61@netscape.net>
Date2012-03-07 11:11 -0800
Message-ID<5bb32a86-5678-4614-9ce3-ffb2902eadfa@i16g2000yql.googlegroups.com>
In reply to#9916
On Mar 7, 1:20 pm, rickman <gnu...@gmail.com> wrote:
> > That is was the -LOOP when stepping down proposal is about ~
> > specifying the alternate loop boundary. With integers, after all,
> > there's only the two possible loop boundaries.

> Ok, I'll bite, what are they?

Between the loop bound and one minus the loop bound is one, and
between the loop bound and one plus the loop bound is the other. The
Forth94 uses the same boundary whether crossing from below or above.
The "symmetric" behavior does one when crossing from below and the
other when crossing from above.

[toc] | [prev] | [next] | [standalone]


#9933

Fromhwfwguy@gmail.com
Date2012-03-07 19:07 -0800
Message-ID<16597647.12.1331176070681.JavaMail.geo-discussion-forums@pbcwe9>
In reply to#9913
On Wednesday, March 7, 2012 9:22:23 AM UTC-7, BruceMcF wrote:
> That is was the -LOOP when stepping down proposal is about ~
> specifying the alternate loop boundary. With integers, after all,
> there's only the two possible loop boundaries.

What does 0 3 DO I . 1 -LOOP print?

[toc] | [prev] | [next] | [standalone]


#9949

FromBruceMcF <agila61@netscape.net>
Date2012-03-08 10:11 -0800
Message-ID<6cff420c-4ad0-4767-83ef-247615f6c6ee@p12g2000yqe.googlegroups.com>
In reply to#9933
On Mar 7, 10:07 pm, hwfw...@gmail.com wrote:
> On Wednesday, March 7, 2012 9:22:23 AM UTC-7, BruceMcF wrote:
> > That is was the -LOOP when stepping down proposal is about ~
> > specifying the alternate loop boundary. With integers, after all,
> > there's only the two possible loop boundaries.
>
> What does 0 3 DO I . 1 -LOOP print?

3 0 DO I . 1 +LOOP does print 0 1 2
-3 0 DO I . -1 +LOOP does print 0 -1 -2 -3
-3 0 DO I . 1 -LOOP would print 0 -1 -2

0 3 DO I . -1 +LOOP does print 3 2 1 0
0 3 DO I . 1 -LOOP would print 3 2 1

[toc] | [prev] | [next] | [standalone]


#10037

Fromanton@mips.complang.tuwien.ac.at (Anton Ertl)
Date2012-03-12 09:36 +0000
Message-ID<2012Mar12.103612@mips.complang.tuwien.ac.at>
In reply to#9933
hwfwguy@gmail.com writes:
>On Wednesday, March 7, 2012 9:22:23 AM UTC-7, BruceMcF wrote:
>> That is was the -LOOP when stepping down proposal is about ~
>> specifying the alternate loop boundary. With integers, after all,
>> there's only the two possible loop boundaries.
>
>What does 0 3 DO I . 1 -LOOP print?

: bar 0 3 DO I . 1 -LOOP ; cr bar  
3 2 1  ok

One disadvantage is that we often want 2 1 0 for the "0 3" input, and
we have to correct the input to -1 2 to get the result we want.  I
don't have a good solution for that yet.

- anton
-- 
M. Anton Ertl  http://www.complang.tuwien.ac.at/anton/home.html
comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
     New standard: http://www.forth200x.org/forth200x.html
   EuroForth 2011: http://www.euroforth.org/ef11/

[toc] | [prev] | [next] | [standalone]


#10048

Fromanton@mips.complang.tuwien.ac.at (Anton Ertl)
Date2012-03-12 16:01 +0000
Message-ID<2012Mar12.170107@mips.complang.tuwien.ac.at>
In reply to#9902
hwfwguy@gmail.com writes:
>Much ado about nothing. In most cases, +LOOP is preceeded by a constant which an optimizer can use to decide whether to encode +LOOP, /LOOP, etc.

Unfortunately, +LOOP behaves idiotically with negative increments, and
the optimizer must not do anything about that.

- anton
-- 
M. Anton Ertl  http://www.complang.tuwien.ac.at/anton/home.html
comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
     New standard: http://www.forth200x.org/forth200x.html
   EuroForth 2011: http://www.euroforth.org/ef11/

[toc] | [prev] | [next] | [standalone]


#9895

FromAlex McDonald <blog@rivadpm.com>
Date2012-03-06 13:13 -0800
Message-ID<f3b9b873-11df-4b15-833e-f122af5c8fa7@y10g2000vbn.googlegroups.com>
In reply to#9884
On Mar 6, 4:49 pm, an...@mips.complang.tuwien.ac.at (Anton Ertl)
wrote:
> Andrew Haley <andre...@littlepinkcloud.invalid> writes:
> >But many (all?) implementations of Forth-83 didn't have R = I.
>
> That's just as beside my point as rickmans answer was, so I guess I
> did not make my point very well.  Let's try again:
>
> I think that some people are giving too much weight to word counting
> when discussing proposals and too little weight to other issues.  An
> example where we are happy with having more words is R@ and I, which
> originally were synonyms.
>
> But while we are in the area, n +LOOP is a mistake, probably partly
> driven by word counting and partly by a cute implementation idea*.
> It's better to have two words, one for each direction: u /LOOP for
> counting up and u -LOOP for counting down.
>
> *) Incidentially, that implementation idea gave use Is that are
>  different from R@.

I presume you mean cuteness of a biased to overflow I as in : I 2r@
+ ; ?

>
> - anton
> --
> M. Anton Ertl  http://www.complang.tuwien.ac.at/anton/home.html
> comp.lang.forth FAQs:http://www.complang.tuwien.ac.at/forth/faq/toc.html
>      New standard:http://www.forth200x.org/forth200x.html
>    EuroForth 2011:http://www.euroforth.org/ef11/

[toc] | [prev] | [next] | [standalone]


#10049

Fromanton@mips.complang.tuwien.ac.at (Anton Ertl)
Date2012-03-12 16:04 +0000
Message-ID<2012Mar12.170400@mips.complang.tuwien.ac.at>
In reply to#9895
Alex McDonald <blog@rivadpm.com> writes:
>On Mar 6, 4:49=A0pm, an...@mips.complang.tuwien.ac.at (Anton Ertl)
>wrote:
>> But while we are in the area, n +LOOP is a mistake, probably partly
>> driven by word counting and partly by a cute implementation idea*.
...
>> *) Incidentially, that implementation idea gave use Is that are
>> =A0different from R@.
>
>I presume you mean cuteness of a biased to overflow I as in : I 2r@
>+ ; ?

Yes.

- anton
-- 
M. Anton Ertl  http://www.complang.tuwien.ac.at/anton/home.html
comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
     New standard: http://www.forth200x.org/forth200x.html
   EuroForth 2011: http://www.euroforth.org/ef11/

[toc] | [prev] | [next] | [standalone]


#10058

FromBruceMcF <agila61@netscape.net>
Date2012-03-12 13:40 -0700
Message-ID<cd817e01-eb5b-4841-af31-22f09f797a22@s7g2000yqm.googlegroups.com>
In reply to#9884
On Mar 6, 12:49 pm, an...@mips.complang.tuwien.ac.at (Anton Ertl)
wrote:
> But while we are in the area, n +LOOP is a mistake, probably partly
> driven by word counting and partly by a cute implementation idea*.

Though that "cute" implementation idea could be a noticeable timesaver
on a Forth for an AppleII, C64, Atari 8bit, etc. Clearing carry,
adding #1 to the low byte and saving, adding #0 the high byte and
saving, and then looking at the carry/overflow flag to see if you hit
the boundary (depending on which bias) saved a good chunk of cycles on
the small and memory bus clock bound 6502, with its substantial
penalty for extra 16bit operations. In loops with I it saved more than
it cost, and not all DO-LOOPs use I.

And the overflow flag version also worked for (+LOOP), costing only a
few cycles more.

In 2012 it may be an archaic holdover, but it made some substantial
sense when it was first developed.

[toc] | [prev] | [next] | [standalone]


#9914

Fromrickman <gnuarm@gmail.com>
Date2012-03-07 10:15 -0800
Message-ID<643478dd-597b-4e30-8b9c-7d915a3b4a5f@db5g2000vbb.googlegroups.com>
In reply to#9882
On Mar 6, 9:51 am, an...@mips.complang.tuwien.ac.at (Anton Ertl)
wrote:
> rickman <gnu...@gmail.com> writes:
> >On Mar 6, 6:26=A0am, an...@mips.complang.tuwien.ac.at (Anton Ertl)
> >wrote:
> >> fig-Forth has R (nowadays called R@) and that despite I and R doing
> >> the same thing, so obviously people already found it useful to
> >> differentiate between these words at that time.
>
> >> If these words were not already standardized, at least one would not
> >> make it: Imagine: Introduce two words where one would do? =A0The word
> >> count! =A0The complexity!
> ...
> >You can define one in terms of the other in your implementation where
> >you know they are the same.  So no complication.
>
> >But in a standard forth no assumption is made about the loop control
> >variables being on the return stack.  It is permitted, but not
> >required.  You do know that I'm sure.
>
> Sure, but the setting would not be a world where Forth-94 is standard,
> but a world where we have not already standardized counted loops, but
> with people using arguments like they do now.  So, the choice would be
>
> 1) Standardize R@ and I to allow different implementations of counted
> loops.
>
> 2) Standardize just R@, which also serves the purpose of I (or vice versa).
>
> A proponent who proposes 1) would face counterarguments based on word
> counts; arguments based on implementation flexibility would have
> little weight, if any, with the word counters, especially because
> AFAIK at the time all implementations of counted loops had R=I
> (fig-Forth certainly did).
>
> - anton


I truly don't understand what you are saying.  I am saying that the
current forth standard does not imply that loop counting is
necessarily done on the return stack, is that wrong?  But even if loop
counting must be done on the return stack, does that imply that I and
R@ are identical?  Is there anything that says how the stack is to be
used for loop counting?  The count and the limit could be combined
into one word on the stack or they could be swapped.

Are you talking about something other than the current Forth
standard?  I really don't get what you are trying to say.

Rick

[toc] | [prev] | [next] | [standalone]


#9915

FromBruceMcF <agila61@netscape.net>
Date2012-03-07 10:33 -0800
Message-ID<0aaf5e22-ca0d-4f8f-981f-cc58a384e479@k4g2000yqa.googlegroups.com>
In reply to#9914
On Mar 7, 1:15 pm, rickman <gnu...@gmail.com> wrote:
> Are you talking about something other than the current Forth
> standard?  I really don't get what you are trying to say.

When he says:
>> If these words were not already standardized, at least one would
>> not make it:

He seems to be talking about his view of the decentralized version of
the standardization process, that if "I" had not been standardized
during the tenure of the Technical Committee, but proposed later, it
would have been shot down on word count grounds, despite the strong
technical merit of not specifying the implementation of "I", which is
only possible because the process is represented by a single atomic
word.

[toc] | [prev] | [next] | [standalone]


#9934

From"Elizabeth D. Rather" <erather@forth.com>
Date2012-03-07 17:16 -1000
Message-ID<VoSdnVm85_oJucXSnZ2dnUVZ_oidnZ2d@supernews.com>
In reply to#9914
On 3/7/12 8:15 AM, rickman wrote:
> On Mar 6, 9:51 am, an...@mips.complang.tuwien.ac.at (Anton Ertl)
> wrote:
>> rickman<gnu...@gmail.com>  writes:
>>> On Mar 6, 6:26=A0am, an...@mips.complang.tuwien.ac.at (Anton Ertl)
>>> wrote:
>>>> fig-Forth has R (nowadays called R@) and that despite I and R doing
>>>> the same thing, so obviously people already found it useful to
>>>> differentiate between these words at that time.
>>
>>>> If these words were not already standardized, at least one would not
>>>> make it: Imagine: Introduce two words where one would do? =A0The word
>>>> count! =A0The complexity!
>> ...
>>> You can define one in terms of the other in your implementation where
>>> you know they are the same.  So no complication.
>>
>>> But in a standard forth no assumption is made about the loop control
>>> variables being on the return stack.  It is permitted, but not
>>> required.  You do know that I'm sure.
>>
>> Sure, but the setting would not be a world where Forth-94 is standard,
>> but a world where we have not already standardized counted loops, but
>> with people using arguments like they do now.  So, the choice would be
>>
>> 1) Standardize R@ and I to allow different implementations of counted
>> loops.
>>
>> 2) Standardize just R@, which also serves the purpose of I (or vice versa).
>>
>> A proponent who proposes 1) would face counterarguments based on word
>> counts; arguments based on implementation flexibility would have
>> little weight, if any, with the word counters, especially because
>> AFAIK at the time all implementations of counted loops had R=I
>> (fig-Forth certainly did).
>>
>> - anton
>
>
> I truly don't understand what you are saying.

He's talking about a hypothetical world in which there is *no* Forth-94 
and counted loops have *not* been standardized. He is considering the 
options in that hypothetical world.

> I am saying that the
> current forth standard does not imply that loop counting is
> necessarily done on the return stack, is that wrong?

It is not wrong. Loop counters *may* be on the return stack, but are not 
required to be.

>  But even if loop
> counting must be done on the return stack, does that imply that I and
> R@ are identical?

No.

> Is there anything that says how the stack is to be
> used for loop counting?

No.

> The count and the limit could be combined
> into one word on the stack or they could be swapped.

...or plucked out of the ether, or derived from an RNG, or whatever.

> Are you talking about something other than the current Forth
> standard?  I really don't get what you are trying to say.

Yes. He's talking about a hypothetical world in which only figForth 
exists in order to focus on the design choices in a pre-standards 
environment.

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."
==================================================

[toc] | [prev] | [next] | [standalone]


#10044

Fromanton@mips.complang.tuwien.ac.at (Anton Ertl)
Date2012-03-12 11:18 +0000
Message-ID<2012Mar12.121853@mips.complang.tuwien.ac.at>
In reply to#9914
rickman <gnuarm@gmail.com> writes:
>I truly don't understand what you are saying.

I am sorry.  My point was that word counts are given too much weight
in standardization discussions.

>  I am saying that the
>current forth standard does not imply that loop counting is
>necessarily done on the return stack, is that wrong?

Not, that's correct.

>  But even if loop
>counting must be done on the return stack, does that imply that I and
>R@ are identical?

No, they can be different.


>  Is there anything that says how the stack is to be
>used for loop counting?

There are some restrictions (e.g., you cannot use the data stack in a
way that is visible to the program), but apart from that you are free
to arrange the loop parameters on the return stack or elsewhere in any
way that results in standard-conforming behaviour.

>Are you talking about something other than the current Forth
>standard?  I really don't get what you are trying to say.

Never mind, it's not that important.

- anton
-- 
M. Anton Ertl  http://www.complang.tuwien.ac.at/anton/home.html
comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
     New standard: http://www.forth200x.org/forth200x.html
   EuroForth 2011: http://www.euroforth.org/ef11/

[toc] | [prev] | [next] | [standalone]


#10054

From"Elizabeth D. Rather" <erather@forth.com>
Date2012-03-12 08:01 -1000
Message-ID<JrydnYGgpYd6pMPSnZ2dnUVZ_oSdnZ2d@supernews.com>
In reply to#10044
On 3/12/12 1:18 AM, Anton Ertl wrote:
...
>>   I am saying that the
>> current forth standard does not imply that loop counting is
>> necessarily done on the return stack, is that wrong?
>
> Not, that's correct.
>
>>   But even if loop
>> counting must be done on the return stack, does that imply that I and
>> R@ are identical?
>
> No, they can be different.

And in a Standard Program, you should certainly *not* assume they're the 
same. If you use R@ inside a loop hoping to get the index, you could be 
wrong. And if you use I outside a loop there's no telling what you might 
get.

>>   Is there anything that says how the stack is to be
>> used for loop counting?

No. ANS Forth goes out of its way to avoid saying how anything should be 
*implemented*, only how it should appear to a user program.

> There are some restrictions (e.g., you cannot use the data stack in a
> way that is visible to the program), but apart from that you are free
> to arrange the loop parameters on the return stack or elsewhere in any
> way that results in standard-conforming behaviour.
>
>> Are you talking about something other than the current Forth
>> standard?  I really don't get what you are trying to say.

I tried to re-phrase it above.

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."
==================================================

[toc] | [prev] | [next] | [standalone]


#10145

Fromjacko <jackokring@gmail.com>
Date2012-03-15 18:59 -0700
Message-ID<26692362.298.1331863167724.JavaMail.geo-discussion-forums@vbhy1>
In reply to#9880
On Tuesday, March 6, 2012 1:42:43 PM UTC, rickman wrote:
> On Mar 6, 6:26 am, an...@mips.complang.tuwien.ac.at (Anton Ertl)
> wrote:
> > "Elizabeth D. Rather" <erat...@forth.com> writes:
> >
> > >On 3/5/12 12:11 PM, Elizabeth D. Rather wrote:
> > >> fig-Forth says other use of 'I', i.e., that outside a loop, is
> > >> implementation dependent.
> >
> > >I suddenly realize what that statement is trying to say:  in early
> > >Forths, the loop parameters were *always* on the Return Stack. So, some
> > >people used I outside a loop to get a copy of whatever is on the Return
> > >Stack (equivalent to R@ in modern usage). So, that's really talking
> > >about "other use" meaning other than as a loop counter. The loop counter
> > >itself doesn't exist outside the loop in any case!
> >
> > >That is wildly problematic in modern Forths, which is why R@ exists!
> >
> > fig-Forth has R (nowadays called R@) and that despite I and R doing
> > the same thing, so obviously people already found it useful to
> > differentiate between these words at that time.
> >
> > If these words were not already standardized, at least one would not
> > make it: Imagine: Introduce two words where one would do?  The word
> > count!  The complexity!
> >
> > - anton
> > --
> > M. Anton Ertl  http://www.complang.tuwien.ac.at/anton/home.html
> > comp.lang.forth FAQs:http://www.complang.tuwien.ac.at/forth/faq/toc.html
> >      New standard:http://www.forth200x.org/forth200x.html
> >    EuroForth 2011:http://www.euroforth.org/ef11/
> 
> You can define one in terms of the other in your implementation where
> you know they are the same.  So no complication.
> 
> But in a standard forth no assumption is made about the loop control
> variables being on the return stack.  It is permitted, but not
> required.  You do know that I'm sure.
> 
> Rick

It might memory fault if the return stack does not have many items on, and a control structure is complex.

[toc] | [prev] | [next] | [standalone]


#10168

FromCoos Haak <chforth@hccnet.nl>
Date2012-03-16 20:36 +0100
Message-ID<1keofkzoa2k90$.15ezje7ux68ay.dlg@40tude.net>
In reply to#10145
Op Thu, 15 Mar 2012 18:59:27 -0700 (PDT) schreef jacko:

> On Tuesday, March 6, 2012 1:42:43 PM UTC, rickman wrote:
>> On Mar 6, 6:26 am, an...@mips.complang.tuwien.ac.at (Anton Ertl)
>> wrote:
>>> "Elizabeth D. Rather" <erat...@forth.com> writes:
>>>
>>> >On 3/5/12 12:11 PM, Elizabeth D. Rather wrote:
>>> >> fig-Forth says other use of 'I', i.e., that outside a loop, is
>>> >> implementation dependent.
>>>
>>> >I suddenly realize what that statement is trying to say:  in early
>>> >Forths, the loop parameters were *always* on the Return Stack. So, some
>>> >people used I outside a loop to get a copy of whatever is on the Return
>>> >Stack (equivalent to R@ in modern usage). So, that's really talking
>>> >about "other use" meaning other than as a loop counter. The loop counter
>>> >itself doesn't exist outside the loop in any case!
>>>
>>> >That is wildly problematic in modern Forths, which is why R@ exists!
>>>
>>> fig-Forth has R (nowadays called R@) and that despite I and R doing
>>> the same thing, so obviously people already found it useful to
>>> differentiate between these words at that time.
>>>
>>> If these words were not already standardized, at least one would not
>>> make it: Imagine: Introduce two words where one would do?  The word
>>> count!  The complexity!
>>>
>>> - anton
>>> --
>>> M. Anton Ertl  http://www.complang.tuwien.ac.at/anton/home.html
>>> comp.lang.forth FAQs:http://www.complang.tuwien.ac.at/forth/faq/toc.html
>>>      New standard:http://www.forth200x.org/forth200x.html
>>>    EuroForth 2011:http://www.euroforth.org/ef11/
>> 
>> You can define one in terms of the other in your implementation where
>> you know they are the same.  So no complication.
>> 
>> But in a standard forth no assumption is made about the loop control
>> variables being on the return stack.  It is permitted, but not
>> required.  You do know that I'm sure.
>> 
>> Rick
> 
> It might memory fault if the return stack does not have many items on, and a control structure is complex.

DO places its parameters on its stack, be it the return stack or a separate
loop stack. How would there be a shortage of items? Or what complex
structure are you thinking about?

-- 
Coos

CHForth, 16 bit DOS applications
http://home.hccnet.nl/j.j.haak/forth.html 

[toc] | [prev] | [next] | [standalone]


#9888

From"Rod Pemberton" <do_not_have@noavailemail.cmm>
Date2012-03-06 13:33 -0500
Message-ID<jj5lar$n8d$1@speranza.aioe.org>
In reply to#9865
> "Elizabeth D. Rather" <erather@forth.com> wrote in message
news:1KGdnU2taaxgpMjSnZ2dnUVZ_hGdnZ2d@supernews.com...
> > On 3/5/12 11:23 AM, Rod Pemberton wrote:
[...]

> I isn't a "variable" it's a word that pushes a *copy* of the current
> value of the loop counter onto the stack when it is executed. Once on
> the stack, it's like any other stack item, to use as you see fit.
>

Yes, I noticed that ...  It seems that that also restricts the use of 'I' to
do "skip counters" too.  That's were you increment the loop index by some
"skip" value in the middle of the loop.  These are useful for generating all
sorts of numerical sequences.  E.g., in C, say you want to count from 1 to
20, but skip 10 to 14.  So, upon the condition that the loop index = 10, you
can add five to the index.  It seems one would need to setup a separate
variable in Forth to perform the skip.

> The loop counter itself doesn't *exist* outside the loop, in any Forth
> that I know of.

Ok, I found one Forth where 'I' is marked compile-only, but only checked
three.   Those three allow 'I' to execute without a DO LOOP but return
garbage.  So, I'd say 'I' does *exist* in some Forths, even if use is
invalid or even if some Forths, e.g., compileable, don't recognize 'I' being
defined or used outside a loop.


Rod Pemberton



[toc] | [prev] | [next] | [standalone]


#9890

From"Elizabeth D. Rather" <erather@forth.com>
Date2012-03-06 09:07 -1000
Message-ID<MMGdnUxDfcbF_cvSnZ2dnUVZ_s6dnZ2d@supernews.com>
In reply to#9888
On 3/6/12 8:33 AM, Rod Pemberton wrote:
>> "Elizabeth D. Rather"<erather@forth.com>  wrote in message
> news:1KGdnU2taaxgpMjSnZ2dnUVZ_hGdnZ2d@supernews.com...
>>> On 3/5/12 11:23 AM, Rod Pemberton wrote:
> [...]
>
>> I isn't a "variable" it's a word that pushes a *copy* of the current
>> value of the loop counter onto the stack when it is executed. Once on
>> the stack, it's like any other stack item, to use as you see fit.
>
> Yes, I noticed that ...  It seems that that also restricts the use of 'I' to
> do "skip counters" too.  That's were you increment the loop index by some
> "skip" value in the middle of the loop.  These are useful for generating all
> sorts of numerical sequences.  E.g., in C, say you want to count from 1 to
> 20, but skip 10 to 14.  So, upon the condition that the loop index = 10, you
> can add five to the index.  It seems one would need to setup a separate
> variable in Forth to perform the skip.

If you need to manipulate the loop index, it's easy to do it with +LOOP. 
That's what it's for.

>> The loop counter itself doesn't *exist* outside the loop, in any Forth
>> that I know of.
>
> Ok, I found one Forth where 'I' is marked compile-only, but only checked
> three.   Those three allow 'I' to execute without a DO LOOP but return
> garbage.  So, I'd say 'I' does *exist* in some Forths, even if use is
> invalid or even if some Forths, e.g., compileable, don't recognize 'I' being
> defined or used outside a loop.

Oh, I didn't mean the *word* didn't exist, just that there is no defined 
semantics for it outside a loop.

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."
==================================================

[toc] | [prev] | [next] | [standalone]


#9896

From"Rod Pemberton" <do_not_have@noavailemail.cmm>
Date2012-03-06 18:20 -0500
Message-ID<jj665d$7br$1@speranza.aioe.org>
In reply to#9890
"Elizabeth D. Rather" <erather@forth.com> wrote in message
news:MMGdnUxDfcbF_cvSnZ2dnUVZ_s6dnZ2d@supernews.com...
> On 3/6/12 8:33 AM, Rod Pemberton wrote:
> >> "Elizabeth D. Rather"<erather@forth.com>  wrote in message
> > news:1KGdnU2taaxgpMjSnZ2dnUVZ_hGdnZ2d@supernews.com...
> >>> On 3/5/12 11:23 AM, Rod Pemberton wrote:
> > [...]
> >
> >> I isn't a "variable" it's a word that pushes a *copy* of the current
> >> value of the loop counter onto the stack when it is executed. Once on
> >> the stack, it's like any other stack item, to use as you see fit.
> >
> > Yes, I noticed that ...  It seems that that also restricts the use of
> > 'I' to do "skip counters" too.  [...] It seems one would need to setup
> > a separate variable in Forth to perform the skip.
>
> If you need to manipulate the loop index, it's easy to do it with +LOOP.
> That's what it's for.
>

You don't find this mechanism clumsy or obtuse or awkward?

First, let us hide the loop counter behind a word that fetches it so no one
can modify the counter directly.  Next, let's create another word that is
used to add values to the counter since we no longer allow direct access to
the counter.  Now, let's create another word so we can add some other value
besides one to it, or well define LOOP in terms of +LOOP ...  Ah, only 3
words to access the index.  That's clearly insufficient!  Oh, let's create J
and K too, since implementing I by itself wasn't difficult enough.  Three
loop counters should do it.  Also, let's require DO to initialize I, J, and
K before we indicate which one we are going to use.  Now, that's a
challenge! And, let's make it so J and K can only be used in nested DO
LOOPS, respectively.  Now is DO hard enough for us to implement?  Ah, now 6
we've dedicated words to do what Forth can do with a variable and three
generic words.  We're definately on the "right" track with this looping
thing guys!  Oh, we forgot a way to exit the loop: LEAVE.  The Forth looping
mechanism *almost* seems perverse to me. But, hey, the cashier at McDonald's
basically threw my money out the window and let the wind blow it away.  So,
maybe I'm just cranky today.  If she stuffed it in her pocket, she'd be a
thief!  I didn't get my money.  Isn't that the same?  Since I didn't get it
and was owed it, can I claim they stole it?  That's the definition of
stealing ... right?  Or, is shoving your hand out the window and letting go
in the wind adequate and sufficient to comply with not "stealing" ones
money?  Insanity, just like I J K DO LOOP +LOOP /LOOP -LOOP LEAVE ...
When does it end? RfC for X Y Z *LOOP fibLOOP \LOOP :LOOP ;LOOP
?LOOP aLOOP bLOOP anyone?


Rod Pemberton

[toc] | [prev] | [next] | [standalone]


#9897

From"Elizabeth D. Rather" <erather@forth.com>
Date2012-03-06 14:07 -1000
Message-ID<AO6dnfQQq64jO8vSnZ2dnUVZ_hSdnZ2d@supernews.com>
In reply to#9896
On 3/6/12 1:20 PM, Rod Pemberton wrote:
> "Elizabeth D. Rather"<erather@forth.com>  wrote in message
> news:MMGdnUxDfcbF_cvSnZ2dnUVZ_s6dnZ2d@supernews.com...
>> On 3/6/12 8:33 AM, Rod Pemberton wrote:
>>>> "Elizabeth D. Rather"<erather@forth.com>   wrote in message
>>> news:1KGdnU2taaxgpMjSnZ2dnUVZ_hGdnZ2d@supernews.com...
>>>>> On 3/5/12 11:23 AM, Rod Pemberton wrote:
>>> [...]
>>>
>>>> I isn't a "variable" it's a word that pushes a *copy* of the current
>>>> value of the loop counter onto the stack when it is executed. Once on
>>>> the stack, it's like any other stack item, to use as you see fit.
>>>
>>> Yes, I noticed that ...  It seems that that also restricts the use of
>>> 'I' to do "skip counters" too.  [...] It seems one would need to setup
>>> a separate variable in Forth to perform the skip.
>>
>> If you need to manipulate the loop index, it's easy to do it with +LOOP.
>> That's what it's for.
>>
>
> You don't find this mechanism clumsy or obtuse or awkward?

Frankly, no. It is consistent with the general Forth philosophy of 
having many small, simple words rather than a few big, complicated, 
"smart" ones. A different way of looking at things, but one that has 
been very successful in the environment for which it was designed.

> First, let us hide the loop counter behind a word that fetches it so no one
> can modify the counter directly.

It's actually not that often that you have any reason to manipulate it 
directly. I think it's convenient to not have to worry about it, and yet 
it's easy to get if you want it.

> Next, let's create another word that is
> used to add values to the counter since we no longer allow direct access to
> the counter.  Now, let's create another word so we can add some other value
> besides one to it, or well define LOOP in terms of +LOOP

Nobody in their right mind would do LOOP in terms of +LOOP, although 
it's possible they can share some code. Are you implying there's another 
word to manipulate the counter? There isn't (in implementations I know).

> Ah, only 3
> words to access the index.  That's clearly insufficient!  Oh, let's create J
> and K too, since implementing I by itself wasn't difficult enough.

I wasn't difficult at all: I is 3 machine instructions and RET. The 
others are equally simple.

> Three
> loop counters should do it.  Also, let's require DO to initialize I, J, and
> K before we indicate which one we are going to use.

:-) Certainly not! DO only initializes its own counter (I).

> Now, that's a
> challenge! And, let's make it so J and K can only be used in nested DO
> LOOPS, respectively.

How do they have any meaning whatever other than in nested DO LOOPs?

Now is DO hard enough for us to implement?

Trivial.

> Ah, now 6
> we've dedicated words to do what Forth can do with a variable and three
> generic words.  We're definately on the "right" track with this looping
> thing guys!  Oh, we forgot a way to exit the loop: LEAVE.

Interestingly, LEAVE didn't come along until we'd been using Forth for 
some years.

> The Forth looping
> mechanism *almost* seems perverse to me. But, hey, the cashier at McDonald's
> basically threw my money out the window and let the wind blow it away.  So,
> maybe I'm just cranky today.

Apparently. I hope your day gets better. :-)

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."
==================================================

[toc] | [prev] | [next] | [standalone]


#9901

FromJohn Passaniti <john.passaniti@gmail.com>
Date2012-03-06 16:53 -0800
Message-ID<6e599c74-8c72-4e6c-af39-ed6ac33e4039@w32g2000vbt.googlegroups.com>
In reply to#9897
On Mar 6, 7:07 pm, "Elizabeth D. Rather" <erat...@forth.com> wrote:
> > You don't find this mechanism clumsy or obtuse or awkward?
>
> Frankly, no. It is consistent with the general Forth philosophy
> of having many small, simple words rather than a few big,
> complicated, "smart" ones. A different way of looking at things,
> but one that has been very successful in the environment for
> which it was designed.

I would imagine a stronger reason would be that some Forths might
implement the loop counter on the stack, in a register, or with
optimization unroll the loop and replace any references to the loop
counter with a constant.  Having a word to access and modify the loop
counter would abstract that.

[toc] | [prev] | [next] | [standalone]


Page 2 of 6 — ← Prev page 1 [2] 3 4 5 6  Next page →

Back to top | Article view | comp.lang.forth


csiph-web