Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

Noob with a question

 [1/10] from: mumpsoid:gmx at: 25-Mar-2009 20:14


Hi..... I'm a new-guy in the REBOLution ;) At 62, I may be too old to make a good REBOLutionary, but I suppose that advocacy is ageless. I'm a self-taught, amateur Perl and M(umps) programmer. I've also had a long, hard look at Forth. I see in REBOL what appears to be "some" Forth influence. Could I be correct? Anyway, so far I really enjoy REBOL - it's dead easy and very intuitive. I'm using /Core on an OS X Intel box running the latest Leopard patch. I don't believe /View will work on my machine. Question: The manual states: The forall advances the variable position through the series, so when it returns the variable is left at its tail: Therefore, the variable must be reset before it is used again: However. when I try it out I get:
>> >> colors: [red green blue yellow orange]
== [red green blue yellow orange]
>> >> forall colors [print first colors]
red green blue yellow orange
>> >> print tail? colors
false Thanks for the help and a great language! -- duke -- Duke Normandin A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing in e-mail?

 [2/10] from: carl:cybercraft at: 26-Mar-2009 7:51


On Wednesday, 25-March-2009 at 20:14:25 mumpsoid wrote,
> Hi..... > >I'm a new-guy in the REBOLution ;)
Welcome!
>At 62, I may be too old to make a good REBOLutionary, but I suppose >that advocacy is ageless. I'm a self-taught, amateur Perl and M(umps) >programmer. I've also had a long, hard look at Forth. I see in REBOL >what appears to be "some" Forth influence. Could I be correct?
Very likely. In the forward to the REBOL Official Guide Carl Sassenrath mentions Forth, including that he'd written a commercial version of it in the early 80s.
>Question: >The manual states:
<<quoted lines omitted: 16>>
> false >Thanks for the help and a great language!
In this case, the manual you're reading is out of date. FORALL used to work as described there, but it was found to be of little use and that most wanted the blocks unchanged, resulting in a lot of code like such... forall colors [print first colors] colors: head colors The second line's not needed now, as you've discovered. -- Carl Read.

 [3/10] from: kpeters:otaksoft at: 25-Mar-2009 22:04


> I'm a new-guy in the REBOLution ;)
Hi Duke ~ Welcome!
> Anyway, so far I really enjoy REBOL - it's dead easy and very intuitive. I'm using /Core on an OS > X Intel box running the latest Leopard patch. I don't believe /View will work on my machine.
It sure works, maybe not quite as nicely as on Windows boxes but well enough to enable me to have some commercial GUI/database apps deployed here in Canada. Cheers, Kai

 [4/10] from: petr:krenzelok:seznam:cz at: 26-Mar-2009 6:08


mumpsoid-gmx.com napsal(a):
> Hi..... > > I'm a new-guy in the REBOLution ;) >
Hello and welcome! :-)
> At 62, I may be too old to make a good REBOLutionary, but I suppose > that advocacy is ageless. I'm a self-taught, amateur Perl and M(umps) > programmer. I've also had a long, hard look at Forth. I see in REBOL > what appears to be "some" Forth influence. Could I be correct? >
You are never too old to start with REBOL :-) As for Forth influence - yes, some ppl believe it has some influence in Forths (especially dialects), some do find some similarities in Lisp, even calling REBOL being a deparenthetised Lisp .... but - REBOL is special, not strictly functional language ...
> Anyway, so far I really enjoy REBOL - it's dead easy and very > intuitive. I'm using /Core on an OS X Intel box running the latest > Leopard patch. I don't believe /View will work on my machine. >
Hopefully some OS-X guys step in with the answer, but IIRC even View should work on OS-X?
> Question: > The manual states: > > The forall advances the variable position through the series, so when > it returns the variable is left at its tail: > > Therefore, the variable must be reset before it is used again: >
Not sure it has to: ->> forall colors [print first colors print index? colors] red 1 green 2 blue 3 ->> index? colors == 1 So, when out of the loop, the colors block is once again at its beginning. Even in a loop itself, it does not reach tail. I suggest following chapter describing how series positioning works. It is fundamental to understand it: http://www.rebol.com/docs/core23/rebolcore-6.html
> However. when I try it out I get: > >>
<<quoted lines omitted: 10>>
> >> print tail? colors > false
As for me, I don't use forall much. I prefer foreach and for loops. Foreach when you don't need to know a position, just: foreach color colors [print color] And when I need to know the position, then I use old-school for loop :-) for color 1 length? colors 1 [print colors/:color]
> Thanks for the help and a great language! >
Once again - welcome here and enjoy! We have small community, but some ppl say very helpful :-) -pekr-

 [5/10] from: mumpsoid:gmx at: 26-Mar-2009 6:44


On Wed, 25 Mar 2009, Kai Peters wrote:
> > I'm a new-guy in the REBOLution ;) > Hi Duke ~
<<quoted lines omitted: 6>>
> Cheers, > Kai
Excellent! I'll be DLing /View to give it a whirl. BTW, I'm from Canada as well - Calgary area. Thanks for the input! -- Duke Normandin A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing in e-mail?

 [6/10] from: mumpsoid:gmx at: 26-Mar-2009 6:58


On Thu, 26 Mar 2009, Carl Read wrote:
> On Wednesday, 25-March-2009 at 20:14:25 mumpsoid wrote, > > Hi.....
<<quoted lines omitted: 8>>
> mentions Forth, including that he'd written a commercial version of it > in the early 80s.
I knew it! It "feels" a little Forthish.
> >Question: > >The manual states:
<<quoted lines omitted: 28>>
> The second line's not needed now, as you've discovered. > -- Carl Read.
Thanks for the heads-up about the outdated docs. So, in summary, I can walk through a series and leave the pointer at the "head" with `forall'. -- Duke Normandin A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing in e-mail?

 [7/10] from: mumpsoid:gmx at: 26-Mar-2009 7:08


On Thu, 26 Mar 2009, Petr Krenzelok wrote:
> mumpsoid-gmx.com napsal(a): > > Hi..... > > > > I'm a new-guy in the REBOLution ;) > > > > Hello and welcome! :-)
Thanks! [snip]
> As for me, I don't use forall much. I prefer foreach and for loops. > Foreach when you don't need to know a position, just: > > foreach color colors [print color] > > And when I need to know the position, then I use old-school for loop :-) > > for color 1 length? colors 1 [print colors/:color]
I prefer foreach as well - in Perl and others.
> Once again - welcome here and enjoy! We have small community, but some > ppl say very helpful :-) > > -pekr-
I sure can see that! It's curious that REBOL has not become more mainstream. -- Duke Normandin A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing in e-mail?

 [8/10] from: pwawood::gmail::com at: 26-Mar-2009 21:26


Hi Duke Welcome to REBOL. Just in case you didn't know, there is a complete archive of the Rebol Mailing List at rebol.org. It's full of useful information. Some of the old stuff is a little out-of-date but there is still some very useful information. There is a full text search facility and a context index (http://www.rebol.org/ml-topic-index.r). Regards Peter

 [9/10] from: mumpsoid::gmx::com at: 26-Mar-2009 15:19


On Thu, 26 Mar 2009, Peter W A Wood wrote:
> Hi Duke > Welcome to REBOL. Just in case you didn't know, there is a complete
<<quoted lines omitted: 4>>
> Regards > Peter
Thanks for the welcome, and yes I was aware of the archive. It pays to root around. ;) L8r..... -- Duke Normandin A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing in e-mail?

 [10/10] from: moliad::gmail::com at: 30-Mar-2009 15:15


I think this is a new feature of latest rebol versions. you are right that it used to stay stuck at the end... it seems to now reset the index at its location prior to the forall. if you probe the colors after, you will see it is where it was prior to the loop... even if you offset it before looping. I just discovered that! I wouldn't be surprised that many rebolers haven't realized this yet! -MAx On Wed, Mar 25, 2009 at 10:14 PM, <mumpsoid-gmx.com> wrote:

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted