AltME: Rebol School

Messages

Ladislav
I quoted you using cut and paste, so I do not know what you are talking about.
Also, it is you who is criticinzing the documentation while proving you haven't read it
DocKimbel
You wrote: "The specification [...] does not define the argument as a lit-word." This is a strawman, this is not what I said. But as usual, talking to you is like talking to a brick wall. Your condescendence gets in the way of any normal discussion.
Ladislav
Ok, if you insist, I can adjust the wording:
Using the specification
start: func ['block-name] ...
you do not not define the argument as a lit-word. Instead (see the documentation) you specifiy that literal argument passing shall be used, passing words literally (without getting their value).
Note that what I adjusted is not the citation, though. That remains valid.
DocKimbel
You're still misunderstanding my sentence. I was giving instructions to PatrickP61 to change the word argument in the specification to a lit-word argument. That's all. My sentence has nothing to do with how you interpret the specification block once that change has been done.
PatrickP61
My thanks to all.  My intention was not to start any flame wars!
Ladislav
Why do you think you did?
Bo
Ladislav does not mince words.  Everyone here knows that, so we come to expect it. :-)

GiuseppeC
I have a question on Foreach:
foreach [a b] [1 2 3 4 5 6]  [
    mycode
]
how do I know in "mycode" if I am at the last couple of the serie ? (Even the knowing if I am at the start could be useful)
DocKimbel
If you need such info in the loop body, you should use FORALL instead.
GiuseppeC
But in forall I can use only one word as first argument
I have a peseudo DB and I need the extract data in groups
GiuseppeC
I suppose it is better if I use a for loop like
for idx 1 lenght? series fields-number [
    a: series/(idx*1) a: series/(idx*2)
]
And check the position.
sorry:
for idx 1 lenght? series fields-number [
    a: series/(idx*1) b: series/(idx*2)
]
And check the position.
DocKimbel
With FORALL it's much simpler, FOR is not necessary:
forall series [
    set [a b] series    ;-- a and b are set to the first two elements
    ...your code...
    series: next series ;-- advancing series by one to account for the 2nd element    
]
FORALL will already advance the series by one position when looping, so you just need to manually skip the extra element that you read with SET.
GiuseppeC
Lets assume we have 8 fields:
numfields: 8
forall series [
    set [a b c d e f g h i ] series
    series: skip series numfields  - 1
]
Is it right ?
DocKimbel
Exactly.
GiuseppeC
Thanks doc !
DocKimbel
You can also do it with FORSKIP which will do the series advancement for you:
forskip series 8 [
    set [a b c d e f g h i ] series
    ...
]

Last message posted 161 weeks ago.