Newsgroups: comp.lang.forth
From: jzakiya <jzak...@mail.com>
Date: Wed, 15 Oct 2008 08:25:23 -0700 (PDT)
Local: Wed 15 Oct 2008 16:25
Subject: Re: Shorter/better way to do this?
On Oct 15, 1:28 am, "roger.l...@gmail.com" <roger.l...@gmail.com>
wrote: > > Maybe you haven't noticed but this is a Forth group and NOT Ruby. -------------------- > > FYI I use Ruby, and the Ruby versions of this code does not use nor > > Also FYI, you are not making Ruby friends by being a PITA about > > When in Forthland speak Forth, please. > > Jabari > whoa, i think someone needs a chill pill, stat. > is something like this the same as what you want to do? > : carray create allot does> swap + ; > 8 carray p > : clearsome > i would try to do the other part, the begin/while loop, but i don't > whoa, i think someone needs a chill pill, stat. It was late (actually early morning), I was tired/irritated, and that response just crossed my threshold for patronizing irrelevance to my very specific request. Also contributing to my irritation was that in my 29 Forth years I believe I've seen ways to do what I was asking (Forth Dimensions?) and was really irked by such an out of leftfield response. But I meant no "personal" harm. :-) OK, now the code. "lndx" is the array length (last index +1) for byte array "sieve" I can functionally perform the same code equivalently like this: begin p8 lndx < while 0 p8 sieve c! x1 p8 + to p8 repeat This is shorter but MUCH slower on a single core/single threaded cpu So, when p8 < lndx is true, then all the other pi are < lndx too. And for my Ruby friend again, in the Ruby version all I have to do : clearsome lndx 0 do 0 i p c! loop ; I hope this now provides sufficient understanding of my code, Jabari You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||