Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: New REP

From: lmecir:mbox:vol:cz at: 23-Jan-2003 13:54

Hi, <<Romano wrote>> out-of-range series! should not exist <</Romano>>
> LM> I am afraid, that it is too hard to implement such a feature.
<<Gabriele>>
> Actually I don't think so. Currently we have this: > > >> a: [1 2 3] > == [1 2 3] > >> b: tail a > == [] > >> clear a > == [] > >> b > == ** Script Error: Out of range or past end > > My (and Romano's) request (already sent to feedback) is that when > the interpreter encounters an out of range series, instead of > creating an error, it should reset the series to its tail. > > This is possible now too: > > >> b: tail b > == [] > > so I don't think it would be a problem.
<</Gabriele>> Our different POV's seem to be mainly a terminological difference. After executing: a: [1 2 3] ; == [1 2 3] b: tail a ; == [] clear a ; == [] B will be an out-of-range SERIES! and the interpreter has got no means to prevent that. There is a possibility to "correct" B later, but the existence of B cannot be prevented without too much work for the interpreter. Moreover, there is a question that needs an answer: When should the interpreter do the corrections? See e.g. another code: a: [1 2 3] ; == [1 2 3] b: tail a ; == [] clear a ; == [] ; b is out-of-range now append a [4 5 6] ; b is "in range" again I would not expect the interpreter to prevent B from being temporarily out-of-range in this case, because it really might mean "too much work". Regards -L