Renaming Words with a function
[1/2] from: ptretter::prodigy::net at: 18-Nov-2000 11:01
I am trying to develop a function that will rename a word that contains a value to another
name that will exist in memory that holds the same value.
For example the script executes:
incoming-data: copy first port
current-time: now/time
incoming-data now contains the name of the individual
what I want to do is to take the name from incoming-data and set it to the value contained
in current-time and reference the value of current-time or replace current-time with
the new 'word from the name copied from the port.
for example the port passes "Paul"
I want "Paul" to now reference current-times value
so if I type paul in the console it should give the current-time value.
Any ideas?
Paul Tretter
[2/2] from: larry:ecotope at: 20-Nov-2000 13:10
Hi Paul
Good question. This will work
set :incoming-data current-time
If incoming-data references a word, the leading colon retrieves the word,
and SET will assign it the value of current-time.
HTH
-Larry
----- Original Message -----
From: Paul E Tretter <[PTRETTER--prodigy--net]>
To: <[rebol-list--rebol--com]>
Sent: Saturday, November 18, 2000 9:01 AM
Subject: [REBOL] Renaming Words with a function
> I am trying to develop a function that will rename a word that contains a
value to another name that will exist in memory that holds the same value.
> For example the script executes:
>
> incoming-data: copy first port
> current-time: now/time
>
> incoming-data now contains the name of the individual
>
> what I want to do is to take the name from incoming-data and set it to the
value contained in current-time and reference the value of current-time or
replace current-time with the new 'word from the name copied from the port.