[EMAIL PROTECTED] wrote:
>
> Reference in REBOL has a specific meaning. It describes a process that
> occurs when a set-word! type value is evaluated.
>
Words certainly can refer to values. However, that's not the only
way the concept of "reference" is used in the REBOL documentation
available from the REBOL web site. See under the third point below
for specific examples.
>
> A string cannot be a reference.
>
I never said it could. What I did say was that the second element of
a block under discussion
[a: "" b: copy "" ;...etc...
referred to a string that was initially empty.
>
> 2.1 Only the word! family of values (word!, lit-word!, set-word!) can
> reference something:
>
I can't find that restriction of the concept of "reference" anywhere
in the published REBOL documents. If you know of any place where
the documents state that only words are allowed to refer to something
I'd appreciate your letting me know where that occurs.
On the contrary, I find the concept of "reference" (including its
grammatical variants, such as, "refers to", "referring to", etc.)
used in the following ways:
1) In the REBOL/core User's Guide for version 2.1.1, available at
http://www.rebol.com/users.html
the description of date values includes the statements:
It is best to write the year in full. Otherwise, problems will
occur with date comparison and sorting operations. Therefore,
shortened years (e.g. 99 for 1999) can be used, but their
interpretation is relative to the current year. They will span
forward and backward a half century from the current year.
28-2-66 ; refers to 1966
12-Mar-20 ; refers to 2020
14-8-46 ; refers to 2046, not 1946
which is consistent with the following
>> x: 28-2-66
== 28-Feb-1966
>> x/year
== 1966
>> y: 12-Mar-20
== 12-Mar-2020
>> y/year
== 2020
>> z: 14-8-46
== 14-Aug-2046
>> z/year
== 2046
2) In the same document, the discussion of paths includes:
Paths provide a means of refined specification. They describe
a route through a hierarchy, and provide a shorthand technique
for referring to sub-elements, positions, or options.
3) In discussing the difference between "getting" and "evaluating",
the same document illustrates with:
One way refers to the value (function or object) and the
other executes it. For instance, the word for the function
print is used both ways here:
print "test"
test
drucken: :print
drucken "test"
test
The first use of print evaluates it, which causes the
function to be evaluated, and the resulting value is printed.
The second use of print gets its value (the function itself)
and defines a new word with it. Because that word also
refers to the same function, it will evaluate the same way.
So, according to this explanation
>> drucken: :print
>> drucken "test"
test
'drucken evaluates the same way as 'print BECAUSE it REFERS to
the same function. Then in:
>> k: []
== []
>> append k :print
== [native]
>> type? first k
== native!
>> do first k "test"
test
it would appear reasonable that the first element of 'k also
evaluates (executes) the same way, BECAUSE it REFERS to the
same native function.
4) Later, while discussing the characteristics of a series, the
same document makes the statement:
You can count its parts (length) and you can refer to
them by their positions (e.g. the fifth word in a sentence).
so that in
>> sentence: [my dog has big ugly fleas]
== [my dog has big ugly fleas]
>> fifth sentence
== ugly
one can REFER to the word 'ugly by evaluating an EXPRESSION
("fifth sentence").
5) Under the discussion of objects, in the same document, we find:
An object is a group of words that have predefined values.
An object can be referred to as a single value that can
be stored in a variable, passed to functions as an
argument, or returned from a function as a result.
This certainly doesn't sound as if being "stored in a variable",
"passed to functions", or "returned from a function" are such
different concepts that one can't think of them in the same way.
6) In a discussion of series modification, the document at
http://www.rebol.com/manual/sermodify.html
makes the statement
Changing, adding, or deleting elements in a series may cause
another reference to the series to point to different
information.
and follows it with an example that is equivalent to
>> colors-1: ["red" "blue" "teal" "pink"]
== ["red" "blue" "teal" "pink"]
>> colors-2: skip colors-1 2
== ["teal" "pink"]
>> colors-1
== ["red" "blue" "teal" "pink"]
(a) >> colors-2
== ["teal" "pink"]
>> insert colors-1 "tan"
== ["red" "blue" "teal" "pink"]
>> colors-1
== ["tan" "red" "blue" "teal" "pink"]
(b) >> colors-2
== ["blue" "teal" "pink"]
The difference in output for lines (a) and (b) is explained by
'colors-2 being "a reference", in the same sense as the intro-
ductory sentence cited above.
Now, consider:
>> colors-1: ["red" "blue" "teal" "pink"]
== ["red" "blue" "teal" "pink"]
>> some-stuff: reduce [(2 + 2) skip colors-1 2 "self"]
== [4 ["teal" "pink"] "self"]
>> some-stuff
== [4 ["teal" "pink"] "self"]
>> insert colors-1 "tan"
== ["red" "blue" "teal" "pink"]
>> colors-1
== ["tan" "red" "blue" "teal" "pink"]
>> some-stuff
== [4 ["blue" "teal" "pink"] "self"]
Since the value at the second position of 'some-stuff is
affected by the 'insert function in EXACTLY the same way as
the value of 'colors-2, it seems entirely reasonable to say
that 'colors-2 and the second element of 'some-stuff refer
to the same block.
It is common terminology in computer programming to say that
flarp refers to bletch
as a way of indicating that something called flarp somehow
indicates, has a pointer to, contains the address of, or in some
other fashion designates the thing called bletch. It can be used
to get at, peek into, observe, manipulate, or eavesdrop on, the
real bletch (and not just a copy of its content). I have found
nothing in the REBOL documents that conflicts with my assumption
that they use "refers to" in exactly the same sense.
If you know of such a statement that I've overlooked, please let
me know where it is.
-jn-