[REBOL] Re: What kind of bug is this?
From: carl:cybercraft at: 31-Jul-2001 22:32
On 31-Jul-01, [Robbo1Mark--aol--com] wrote:
> What kind of bug is this?
> Ladislav, myself & others have been having a discussion concerning
> evaluation and self modifying code, and some errors? / very strange
> behaviour that REBOL displays.
> Consider the following code in which the block 'a modifies itself at
> each call by appending + 1 to it's latter series of values.
> Do'ing this block results in an incrementing sum at each call except
> when you get to iterations 6, 14 & 30 when some very wierd things
> start happening.
> By printing the SUM part of 'a after each call I thought I might
> be able to deduce the behaviour / evaluation model and predict
> the result of the next call BUT NO! I'm stumped.
> Anybody got any explanations?
I think I remember it being said (by Holger?) that self-modifying code
is a no-no with REBOL.
> Mark Dickson
> Heres' the code.............................................
>>> a: [ append a [+ 1] 1]
> == [append a [+ 1] 1]
>>> loop 50 [ print [do a newline] print [remove/part b: copy
> a 3 newline]]
> 1 + 1