One for the gurus ...
[1/4] from: ingo:2b1 at: 1-Nov-2000 8:56
Hi Rebols,
given the following code snippet and error message, can someone
of you figure out what went wrong here?
foreach fld2 head current-fields [
fld2: to-string fld2
either pos2: find pos/2 fld2 [
change next pos2 "txt"
] [
append pos/2 compose [(fld2) "txt"]
]
]
** Script Error: either expected false-block argument of type: block.
** Where: fld2: to-string fld2
either pos2:
I found my error, but it took me quite some time ...
regards,
Ingo
[2/4] from: al:bri:xtra at: 1-Nov-2000 21:58
Ingo wrote:
> given the following code snippet and error message, can someone of you
figure out what went wrong here?
> foreach fld2 head current-fields [
> fld2: to-string fld2
<<quoted lines omitted: 8>>
> either pos2:
> I found my error, but it took me quite some time ...
I suspect I know what it is. Here's some spoiler space:
Don't look until you can't work it out.
This line:
fld2: to-string fld2
should be:
fld2: to-string :fld2
'fld2 is most likely to be a function that takes one argument, that
argument can be a block! data-type.
> ** Script Error: either expected false-block argument of type: block.
> ** Where: fld2: to-string fld2
> either pos2:
'fld2 "consumed" the true-block argument of the 'either, on this line:
either pos2: find pos/2 fld2 [
I got bitten by a similar bug when fooling around with paths, which is
why I fixed the bug in 'append and 'repend.
Andrew Martin
ICQ: 26227169
http://members.nbci.com/AndrewMartin/
[3/4] from: g::santilli::tiscalinet::it at: 2-Nov-2000 15:37
Ingo Hohmann wrote:
[...]
> ** Script Error: either expected false-block argument of type: block.
> ** Where: fld2: to-string fld2
> either pos2:
>
> I found my error, but it took me quite some time ...
It seems like fld2 is a function... is it? What does
CURRENT-FIELDS contain?
Regards,
Gabriele.
--
Gabriele Santilli <[giesse--writeme--com]> - Amigan - REBOL programmer
Amiga Group Italia sez. L'Aquila -- http://www.amyresource.it/AGI/
[4/4] from: ingo:2b1 at: 2-Nov-2000 9:26
Hi Andrew,
(Sorry, this should have been sent yesterday, just didn't get it
outta my system).
> I suspect I know what it is. Here's some spoiler space:
> This line:
<<quoted lines omitted: 3>>
> 'fld2 is most likely to be a function that takes one argument, that
> argument can be a block! data-type.
you're quite near, but actually my CODE was OK ... so may I ask you how
you're going to find those errors?
I turned everything into parens, and suddenly got another error
< some spoiler space, too >
** value needs a value **
I was sure my block cantained a _word_ named value ... but
I forgot to do 'to-word on some set-words I extracted ...
kind regards,
Ingo
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted