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

[REBOL] Array access and paths

From: dankelg8::cs::man::ac::uk at: 18-May-2001 15:21

On Tue, 15 May 2001, Joel Neely wrote:
> ... (And, of course, I'll be the first to cheer if REBOL 3.0 > turns out to be wonderful for array-based numerical computation. > However, it will take changes BOTH in performance AND notation > before that happy state arrives.)
I think this is the single most annoying thing about REBOL. Dealing with matrices etc is a nightmare!! I think there are a few problems with paths. At first, they look like a replacement for array indexing in other languages, but the fact that they only support a limited way of getting values is a big annoyance. Here is an example: list: [A 0 B 5 C 0 D 0] Say I want to change the number 5 following the B to 6. It's easy to read this number:
>> list/B
== 5 Or more generally:
>> idx: 'B
== B
>> list/:idx
== 5 So far it looks very good. But then, try changing this value!
>> change at list 'B 6
does not work.
>> change next find list 'B 6
Not very nice. Another example: I want to get a function from an array:
>> func-array: reduce [a: func [x][]]
== [func [x][]]
>> f: :func-array/1
** Script Error: 1 is missing its x argument ** Near: f: :func-array/1 Gisle