[REBOL] Re: A comment to Carl's blog
From: mgaya::conselldemallorca::net at: 21-Oct-2004 10:27
Hi, list,
From de console:
>> system/version
== 2.5.55.3.1
>> data
== [10 20 30]
>> n: 2
== 2
>> data/2
== 20
>> data/:n
== 20
>> data/(n)
== 20
>> data/(n: 3)
== 30
>>
I like the new feature!
Miquel.
-----Mensaje original-----
De: [rebol-bounce--rebol--com] [mailto:[rebol-bounce--rebol--com]] En nombre de
Hallvard Ystad
Enviado el: mi=E9rcoles, 20 de octubre de 2004 23:55
Para: [rebolist--rebol--com]
Asunto: [REBOL] A comment to Carl's blog
Hi, list,
About http://www.rebol.net/blog/carl.html#section-5
Here's Carl's exemple:
data: [10 20 30]
n: 3
This shorthand for accessing elements in blocks is added to rebol version 2.5.55:
data/:n: 150
But then: is it absolutely clear that this should mean
poke data n 150
Couldn't it just as well mean:
n: 150
pick data n
i.e. with the form
:n:
which should be evaluated first, :n or n: ?
This might be a dumb question, but I don't see that this is all that clear. Elucidate
me!
A copy of this email is sent via http://www.rebol.com/contacts.html.
HY