At 06:14 PM 12/27/99 -0600, you wrote:
>[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.
We are concerned with a terminology that is designed to conceptualize the
REBOL programming language. The examples you chose are of a conversational
nature. Let us not confuse the conversational use of English verbs with the
definition of terms. I will discuss your examples when we get there. That
will be after I have provided proof that only words can act as references.
>
>>
>> A string cannot be a reference.
>>
>
>I never said it could.
Actually, you did. Perhaps you've changed your mind about that. But here is
the statement I was commenting on, as quoted from your original email that
everyone has access to:
>
>1) At translation time the text which begins with (sans formatting)
>
> [a: "" b: copy "" ;...etc...
>
> is translated into a block. The second element of that block is
> initialized to refer to the empty string, as is the fifth element
> of that block.
You clearly stated that in your opinion "The second element of that block
is initialized to refer to the empty string".
You recall having said something quite different:
>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.
Well, you recall having said, "the second element ... referred to a string
that was initially empty". That is a different statement from "the second
element ... is initialized to refer to the empty string".
I wish you had said what now you claim to have said. It would have saved me
alot of work. Unfortunately you didn't.
How does your new version differ from the original one? The original
version says:
>The second element of that block is
>initialized to refer to the empty string,
Note the use of the words "initialized to refer to the empty string".
Who is being initialized to refer to the empty string? It's "The second
element". Which element is the second element?
Element 1: a:
Element 2: ""
The second element is the literal string. You are saying that the literal
string is "initialized to refer to the empty string". What would be the
result of a successful initialization? The literal string would have become
what it was initialized to be: a REFERENCE TO the empty string. It has been
"initialized to refer", initialization is over, now it refers.
If you now claim that
you quote me as saying:
>> A string cannot be a reference.
>>
>
and respond:
>I never said it could.
then look at your original quote, which does reflect that at the time you
wrote the message I was commenting on, you assumed that "the second
element" of the block, a literal string, was being "initialized to refer to
the empty string".
If you now recall you didn't say, "the second element is initialized to
refer to the empty string" and instead you recall saying that "the second
element (...) referred to a string that was initially empty", then
apparently your recollection is faulty, and it happens to be faulty
precisely in the way that would make my criticism unwarranted.
A coincidence? Perhaps.
>
>>
>> 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.
REBOL provides two means of for constructing references.
You can use the word 'set. Let's look at 'set.
>> help set
Sets a word or block of words to specified value(s).
Arguments:
word -- Word or words to set (any-word block)
value -- Value or block of values (any-type)
Refinements:
/any -- Allows setting words to any value.
Note that set accepts two argument types,
a) either a value of type any-word, or
b) a block containing words.
Set will not accept any other value than one or the other. Both argument
types result in words having been set as references. There's nothing to argue.
You can use a value of type set-word! to construct references. For your
reference, this is Eric's type hierarchy with respect to any-word!
any-word
get-word
lit-word
refinement
set-word
word
If a reference is being created using a set-word! value, you definitely end
up with a word. There's nothing to argue here.
>
>On the contrary, I find the concept of "reference" (including its
>grammatical variants, such as, "refers to", "referring to", etc.)
I am talking about the term REFERENCE, not the English verb "to reference".
That is understood since this whole discussion is about terminology. What
is the point of quoting me conversational usage of an English verb, when
what we are discussing is the proper definition of a term?
Moreover, what is point of quoting conversational usage of the English verb
in contexts, where it is being used to explain that WORDS REFERENCE A
VALUE. It is precisely my position that words - and nothing but words -
reference values. You quote against(?) my position statements in which the
verb "refer" is conversationally used to describe that a REBOL word refers
to a value? How would it refute my position, if I were to discover that the
REBOL manual uses refer to express that a word refers to a value, when that
is exactly my position?
You also quote excerpts that demonstrate the use of the verb "to refer" in
a context where something is being referred to. This class of quotes does
not make any statement about WHAT IS DOING the referring. What use are
quotes that demonstrate that values can be referred to, even though they
are not words? I never claimed that values being referred to must be words.
I said that only words are references, and only words can be dereferenced:
>> help get
Gets the value of a word.
Arguments:
word -- Word to get (any-word)
Refinements:
/any -- Allows any type of value, even unset.
At best you succeed in causing confusion. How does that help you?
Now in detail:
>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
>
Are you arguing that the conversational use of the verb "to refer" is the
basis for constructing a conceptual terminology? Is the documentation
saying that the value of type date! is a value that references another
value? No. What the documentation is saying is that two digit years signify
the following four digit years:
28-2-66 ; 66 is interpreted as 1966
12-Mar-20 ; 20 is interpreted as 2020
14-8-46 ; 46 is interpreted 2046
This has nothing to do with references. Sorry. How I know that? Let us
dereference 28-2-66 and see whether we get the value 66:
>> get 28-2-66
** Script Error: get expected word argument of type: any-word.
** Where: get 28-Feb-1966
Didn't work. Show me a way to dereference 28-2-66!
>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.
Again, conversational use of the verb "refer". Not terminology. Based on
this excerpt you could just as well claim that shorthand, technique and for
are REBOL terms. They are not.
Reality check:
>> set a/b/c 12
** Script Error: Cannot use path on set-word! value.
** Where: set a/b/c 12
Oops.
Shorthand technique for referring to sub-elements:
>> a: [b [c 3 ] ]
== [b [c 3]]
>> get a/b/c
** Script Error: get expected word argument of type: any-word.
** Where: get a/b/c
Oops.
>
>3) In discussing the difference between "getting" and "evaluating",
> the same document illustrates with:
>
> One way refers
I hope this usage of the English verb "to refere" does not confuse you. Or
do you now believe that REBOL language constructs known as "way" are also
able to act as references?
> 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,
oh, the "word refers". Must I now finally admit that you have found a quote
that proves me wrong? No, wait, it's a word that is doing the referring.
Saved again. Why you quote statements that support my position is beyond me.
> 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:
I guess if you keep on trying, perhaps at some point in time a quote that
speaks of words as references to values, will prove me wrong, when I say
that words - and only words - are references???
>
> >> 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
And what does "it" refer to? It referes to the expression "the first
element of 'k". Granted, 'the is not a REBOL term, neither is 'element or
'of. So, when I say expression I do not mean it as REBOL term. REBOL would
be very surprised if I asked it to evaluate the expression:
>> the first element of 'k
** Script Error: the has no value.
** Where: the first element of 'k
but you understand what I mean by "expression", I mean "expression"
conversationally, just as the manual is using "refers" conversationally.
> 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).
Indeed you can refer to them by position. Any value can be referred to.
That does not mean that any value can be constructed as a REFERENCE to
other values.
>
> 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").
One can indeed refer to the word 'ugly by evaluating an EXPRESSION. Let's
not worry too much about the fact that 'fifth and 'sentence are words in
this example. While this continues to be a conversational usage of 'refer,
it happens to be one that is consistent with how I define REFERENCE, namely
as a term(!), which describes the relationship that words and only words
can enter into with other values.
>
>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
Yes, an object can be referred to as a single value. I never disputed that
values can be referred to. My statement was that values other than words
cannot be REFERENCES. What is this quote supposed to exemplify? Are you
quoting just for the fun of quoting, independent of whether it supports
your position?
> 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.
That is wonderfully vague statement and doesn't saying anything about the
dispute at hand.
>
>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.
Correct. And if we were strictly speaking using terms, and not
conversationally, we know what that other reference would be. It would be a
word.
>
> 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.
Apparently you've lost track of the fact that you are disputing that only
words can be references. How on earth does this quote support your
position? colors-1, colors-2 are all words. It is my position that words,
and only words, can be references. How does a quote from the documentation
the referes to words as references dispute my position?
>
> 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.
Conversationally, I have no problem with that. Refer to here is explicitly
being used as an analogy between colors-2 and some sub-block. When I define
REFERENCE as a term, however, I don't want to be as messy, as I permit
myself and others to be, when we use words loosely in a conversation.
Once I have said:
>> colors-1: ["red" "blue" "teal" "pink"]
== ["red" "blue" "teal" "pink"]
>> colors-2: skip colors-1 2
== ["teal" "pink"]
>> some-stuff: reduce [(2 + 2) skip colors-1 2 "self"]
== [4 ["teal" "pink"] "self"]
I can no longer say:
>> set second some-stuff "teal"
** Script Error: Invalid argument: teal.
** Where: set second some-stuff "teal"
whereas I can say:
>> set second [4 word] "teal"
== "teal"
because here the second element is a value of type word:
>> type? second [4 word]
== word!
>
>
>It is common terminology in computer programming to say that
>
> flarp refers to bletch
We are not trying to provide an introduction into computer programming. We
are provide a conceptual terminology for REBOL. If "reference" means a
specific thing under REBOL, then that meaning should not compromised by
referring (oops not again) to general usage. Pointers under 'C do not obey
the same rules as pointers under Pascal. There are similarities, there are
differences. And there is no point in denying the specifity of pointers in
let's say Pascal, by pointing out that generally speaking pointers can also
do this or that, such as in C. We are talking REBOL and - at least I plan
to - continue discussing REBOL and not the world of programming in general.
>
>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.
In C pointers and indexes are different ways
>to get at, peek into, observe, manipulate, or eavesdrop on, the
Nevertheless it would not be a good idea for a C programmer to confuse an
index with a pointer, nor would it be advisable for someone, who wants to
provide a conceptual theory of C, to confuse pointers with indexes.
I'm not prescribing how people should conversationally use the verb "to
refer". In our dispute we are discussing a terminology. You set out to
demonstrate that you could provide a terminology that would explain the
phenomenon we were discussing without considering contexts and whether they
are local or global.
That is not to be confused with a conversational introduction into REBOL.
Many liberties that can bet taken in conversational usage of the term
REFERENCE, are no longer effective when you discuss terminology. You may be
"eavesdrop" and do equally fun things to many things. But "eavesdrop" is
not a REBOL term. REFERENCE is.
>
>If you know of such a statement that I've overlooked, please let
>me know where it is.
>> help set
Sets a word or block of words to specified value(s).
Arguments:
word -- Word or words to set (any-word block)
value -- Value or block of values (any-type)
Refinements:
/any -- Allows setting words to any value.
>> help get
Gets the value of a word.
Arguments:
word -- Word to get (any-word)
Refinements:
/any -- Allows any type of value, even unset.
Elan
>
>-jn-
>
>
>