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


Groups > comp.lang.forth > #24772

Re: Happy pi approximation day

From Bernd Paysan <bernd.paysan@gmx.de>
Newsgroups comp.lang.forth
Subject Re: Happy pi approximation day
Date 2013-07-24 21:32 +0200
Organization 1&1 Internet AG
Message-ID <kspa4b$al2$1@online.de> (permalink)
References <kshgui$bf4$3@dont-email.me> <2013Jul23.143147@mips.complang.tuwien.ac.at> <ksmia0$sdt$1@dont-email.me> <2013Jul24.101647@mips.complang.tuwien.ac.at> <51efc1a1$0$621$e4fe514c@dreader34.news.xs4all.nl>

Show all headers | View raw


Albert van der Horst wrote:
> This line of thought ends in:
>    find a sensible way to add iterators to Forth
> 
> That would be great!

I've done something like that in bigForth, but not completed.  If completed, 
this would be how it works:

+I ( n l:i,limit -- flag l:i+n,limit )
Add n to i, and return true if it crosses the boundary of limit, placed on 
the loop stack by >LOOP

>LOOP ( limit start -- l:start,limit )
place start and limit on the loop stack.

I ( l:i,limit -- i )
Get the current iterator counter.

I' ( l:i,limit -- limit )
Get the loop limit.

This would be the iterator factor, and thus +LOOP is equal to +I UNTIL DONE 
UNLOOP (DONE resolves all the LEAVE branches, including the one in ?DO).  If 
you want other iterators, define them, +I is just one possibility.  The loop 
stack and the index,limit pair should be specified as opaque type, because 
it could reside in registers, and could be in a different form.

-- 
Bernd Paysan
"If you want it done right, you have to do it yourself"
http://bernd-paysan.de/

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


Thread

Happy pi approximation day Luca Saiu <positron@gnu.org> - 2013-07-21 22:45 +0200
  Re: Happy pi approximation day Coos Haak <chforth@hccnet.nl> - 2013-07-22 01:24 +0200
    Re: Happy pi approximation day Coos Haak <chforth@hccnet.nl> - 2013-07-22 01:27 +0200
  Re: Happy pi approximation day Mark Wills <markrobertwills@yahoo.co.uk> - 2013-07-22 01:14 -0700
    Re: Happy pi approximation day Luca Saiu <positron@gnu.org> - 2013-07-22 11:53 +0200
    Re: Happy pi approximation day anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-07-22 15:46 +0000
      Re: Happy pi approximation day albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-07-22 19:18 +0000
        Re: Happy pi approximation day Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2013-07-22 21:17 +0100
          Re: Happy pi approximation day "Elizabeth D. Rather" <erather@forth.com> - 2013-07-22 11:25 -1000
            counted loops (was: Happy pi approximation day) anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-07-23 12:42 +0000
              Re: counted loops "Elizabeth D. Rather" <erather@forth.com> - 2013-07-23 07:24 -1000
                Re: counted loops anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-07-23 17:33 +0000
                Re: counted loops "Elizabeth D. Rather" <erather@forth.com> - 2013-07-23 08:06 -1000
                Re: counted loops albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-07-23 19:47 +0000
                Re: counted loops "Elizabeth D. Rather" <erather@forth.com> - 2013-07-23 10:02 -1000
                Re: counted loops Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-07-23 14:58 -0500
                Re: counted loops "Elizabeth D. Rather" <erather@forth.com> - 2013-07-23 10:14 -1000
                Re: counted loops anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-07-24 08:13 +0000
                Re: counted loops Elizabeth D Rather <erather@forth.com> - 2013-07-23 22:42 -1000
                Re: counted loops stephenXXX@mpeforth.com (Stephen Pelc) - 2013-07-24 09:55 +0000
                Re: counted loops stephenXXX@mpeforth.com (Stephen Pelc) - 2013-07-24 09:37 +0000
          Re: Happy pi approximation day albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-07-23 01:30 +0000
            Re: Happy pi approximation day "Elizabeth D. Rather" <erather@forth.com> - 2013-07-22 19:08 -1000
            Re: Happy pi approximation day m.a.m.hendrix@tue.nl - 2013-07-23 00:19 -0700
            Re: Happy pi approximation day anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-07-23 13:07 +0000
              Re: Happy pi approximation day albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-07-23 17:37 +0000
          Re: Happy pi approximation day anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-07-23 12:31 +0000
            Re: Happy pi approximation day Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2013-07-23 19:39 +0100
              Re: Happy pi approximation day anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-07-24 08:16 +0000
                Re: Happy pi approximation day Mark Wills <markrobertwills@yahoo.co.uk> - 2013-07-24 04:23 -0700
                Re: Happy pi approximation day albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-07-24 11:59 +0000
                Re: Happy pi approximation day Bernd Paysan <bernd.paysan@gmx.de> - 2013-07-24 21:32 +0200
                Re: Happy pi approximation day albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-07-24 20:07 +0000
                Re: Happy pi approximation day Bernd Paysan <bernd.paysan@gmx.de> - 2013-07-24 23:20 +0200
  Re: Happy pi approximation day m.a.m.hendrix@tue.nl - 2013-07-22 01:30 -0700
    Re: Happy pi approximation day Luca Saiu <positron@gnu.org> - 2013-07-22 11:55 +0200
    Re: Happy pi approximation day albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-07-22 11:24 +0000
      Re: Happy pi approximation day Richard Owlett <rowlett@pcnetinc.com> - 2013-07-22 10:48 -0500
        Re: Happy pi approximation day Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-07-22 14:44 -0500
  Re: Happy pi approximation day Mark Wills <markrobertwills@yahoo.co.uk> - 2013-07-24 00:43 -0700
    Re: Happy pi approximation day Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-07-24 03:07 -0500

csiph-web