Obtaining a word's value
[1/3] from: joel::neely::fedex::com at: 5-Jul-2001 11:49
Hi, all,
As a break in the discussion of whether to include our thumbs when
we count on our fingers... ;-) let me pose the following question:
Given a word A which currently "has" an associated value,
how many distinct means does REBOL offer by which can we
retrieve that value?
A starter list of answers for the simple case
>> a: "this is a test" ;== "this is a test"
would include
>> a ;== "this is a test"
>> :a ;== "this is a test"
<<quoted lines omitted: 7>>
>> (a) ;== "this is a test"
>> any [a] ;== "this is a test"
By "distinct means" I hope to exclude variations on any theme that
really don't add new/distinct capabilities. For example, since
do [a]
is on the list above, is there any point in adding
do [do [do [a]]]
and, since
any [a]
is already listed, can we pass over trivial variations such as
any [false a]
any [none false a]
or are there actual differences (beyond increased run-time) for
some possible values of A ?
-jn-
___________________________________________________________________
The purpose of computing is insight, not numbers!
- R. W. Hamming
joel'dot'neely'at'fedex'dot'com
[2/3] from: ryanc:iesco-dms at: 5-Jul-2001 13:32
Here is a few more... depending on the rules, this could be an
infinite process...
>> first do/next [a]
== "This seems to work."
>> if true [a]
== "This seems to work."
>> either a [a] [a]
== "This seems to work."
>> loop 1 [a]
== "This seems to work."
>> forever [break/return a] ; works with all loops
== "This seems to work."
>> for b 1 1 1 [a]
== "This seems to work."
>> first repend [] a
== "This seems to work."
>> probe a
This seems to work.
== "This seems to work."
>> f: function[][][a] f ; func, does, and has
== "This seems to work."
>> system/words/a
== "This seems to work."
>> p: to-path [a] p
== "This seems to work."
>> try [a]
== "This seems to work."
>> throw-on-error [a]
== "This seems to work."
>> switch/default none [][a]
== "This seems to work."
>> rejoin [a]
== "This seems to work."
>> maximum a a
== "This seems to work."
>> minimum a a
== "This seems to work."
>> copy a
== "This seems to work."
>> ?? a
a: "This seems to work."
== "This seems to work."
>> catch [a]
== "This seems to work."
>>
Joel Neely wrote:
> Hi, all,
> As a break in the discussion of whether to include our thumbs when
<<quoted lines omitted: 36>>
> [rebol-request--rebol--com] with "unsubscribe" in the
> subject, without the quotes.
--
Ryan Cole
Programmer Analyst
www.iesco-dms.com
707-468-5400
[3/3] from: brett:codeconscious at: 6-Jul-2001 12:22
> Given a word A which currently "has" an associated value,
> how many distinct means does REBOL offer by which can we
> retrieve that value?
>
A somewhat distinct method:
>> alias 'a "another-word-for-it"
== another-word-for-it
>> another-word-for-it
== "this is a test"
...Still reading Ryan's list... :)
Brett.
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted