forall error
[1/8] from: charliew::drte::com at: 22-May-2001 10:05
When I do a forall I get this error. Thanks in advance for your help..
Charlie
** Internal Error: Stack overflow
** Near: not tail? get word
get: func [myVar] [
forall myDB [
rec: first myDB
if rec/fType = myVar [
remove myDB
]
]
]
[2/8] from: joel:neely:fedex at: 22-May-2001 11:02
Hey, Charles,
Charles Wardell wrote:
> When I do a forall I get this error. Thanks in advance for your help..
> Charlie
<<quoted lines omitted: 8>>
> ]
> ]
If you have a minute, would you try this alternative?
get: func [myVar /local walkDB] [
walkDB: myDB
while [not tail? walkDB] [
rec: first walkDB
either rec/fType = myVar [
remove walkDB
][
walkDB: next walkDB
]
]
]
I don't have time to test it right now, but I suspect that your
problem comes from mutating the same series that FORALL is trying
to walk through. The only thing I'm doing different in the
snippet above is explicitly managing the remove-or-step process.
-jn-
[3/8] from: tim:johnsons-web at: 22-May-2001 8:40
On Tue, May 22, 2001 at 10:05:03AM -0400, Charles Wardell wrote:
> When I do a forall I get this error. Thanks in advance for your help..
> Charlie
<<quoted lines omitted: 8>>
> ]
> ]
Hey Charlie:
`get is a rebol word, I believe. It looks like you have some
major recursive activity going on there.... thus the stack overflow.
You're "overloading" here, I think. I believe that others on the list
can show you how to get around this, but I avoid overloading rebol
words unless absolutely necessary.
> --
> To unsubscribe from this list, please send an email to
> [rebol-request--rebol--com] with "unsubscribe" in the
> subject, without the quotes.
--
Tim Johnson <[tim--johnsons-web--com]>
http://www.johnsons-web.com
"My shroe, my shroe, my dingkom for a shroe!"
--TheManWhoSpeaksInAnagrams (Monty Python)
[4/8] from: joel:neely:fedex at: 22-May-2001 15:08
Hey, Joel,
Joel Neely wrote:
> If you have a minute, would you try this alternative?
>
...misguided idea snipped...
If you don't have time to think about it, would you try
this alternative?
Wait until you do think before responding to email!
;-)
-jn-
[5/8] from: g:santilli:tiscalinet:it at: 23-May-2001 14:50
Joel Neely wrote:
> > ** Internal Error: Stack overflow
> > ** Near: not tail? get word
<<quoted lines omitted: 20>>
> ]
> ]
If you look at the error above, you'll discover immediately what
the problem is. :-)
(For Charles: you called your function GET. The word 'GET in REBOL
is usually associated to the GET native function; FORALL wants to
call that function, and uses the 'GET word to do so. But since you
just told REBOL that the word 'GET is associated with your
function, FORALL will call YOUR function instead of the native
GET. Your function, in turn, will call FORALL that will call your
function again and so on until you get a stack overflow.)
Regards,
Gabriele.
--
Gabriele Santilli <[giesse--writeme--com]> - Amigan - REBOL programmer
Amiga Group Italia sez. L'Aquila -- http://www.amyresource.it/AGI/
[6/8] from: charliew:drte at: 23-May-2001 12:40
Thanks alot,
Not the first time that I have been bit by the reserved word bug..
Charlie
[7/8] from: sanghabum:aol at: 23-May-2001 14:21
In a message dated 23/05/2001 17:57:13 GMT Daylight Time, [CharlieW--drte--com]
writes:
> Not the first time that I have been bit by the reserved word bug..
>
> Charlie
Put the line:
Protect-System
in your User.R file, and never overwrite a system word again.
--Colin.
[8/8] from: jelinem1:nationwide at: 23-May-2001 15:18
Reserved word bug? Nay, it's a feature!
BTW Using an editor with up-to-date syntax highlighting helps tremendously
to prevent this problem.
- Michael Jelinek, who redefines "reserved words" when it suits him
(adding refinements, etc)
From: Charles Wardell <[CharlieW--drte--com]>@rebol.com on 05/23/2001 11:40
AM
Please respond to [rebol-list--rebol--com]
Sent by: [rebol-bounce--rebol--com]
To: "['rebol-list--rebol--com']" <[rebol-list--rebol--com]>
cc:
Subject: [REBOL] Re: forall error
Thanks alot,
Not the first time that I have been bit by the reserved word bug..
Charlie
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted