start: func [block-name] [ print rejoin ["start " block-name] do get block-name print rejoin ["stop " block-name] ]
, in which case, however, the function must be called like this:
, which literally passes the word count-to-10 to the function
If you want to be nit-picking (as usual), try to be at least accurate when quoting me. I said "you define the argument", not "the specification defines the argument". In the specification block, the 'block-name is a lit-word defined as-is by the user, that doesn't contradict the documentation.
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
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.
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.
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.
My thanks to all. My intention was not to start any flame wars!
Why do you think you did?
Ladislav does not mince words. Everyone here knows that, so we come to expect it. :-)
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)
If you need such info in the loop body, you should use FORALL instead.
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
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.
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.
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 ?