[REBOL] Re: R: Mutability and sameness - a new puzzle
From: lmecir:mbox:vol:cz at: 22-Jul-2001 17:59
Hi Romano,
> > I propose the INDEXZ? function to be able to discern some block values,
> > that are discernible. I shall give you an example so that we may discuss
our
> > POV's. Let's have:
> >
> > a: tail [1 2]
> > b: back a
> > clear head a
>
...snip...
> I've understood. An index, being an absolute position, remains in
> memory also if the index is past the end of serie. When the serie is
filled
> up to the index, the index of the serie return to be valid. The only
method to
> preserve the index embedded and distingue "a" from "b" is filling the
> series, like in your routine. Skip, back, next do not help because they
all
> give
> an error.
>
> However, in the Rebol context, the value of b, when "a" is clear, is an
error,
> which is not a bug, but a feature (I think). So your method of retrieving
the
> index of b with lenghtz? goes beyond the actual Rebol implementation.
> When a is clear, b at position 3 and c (=a) at position 100 give the same
> result: an error and therefore their values are indiscernibles.
Your approach is valid. The only problem with it is, that if you apply it
consistently, you are not able to discern:
e: [1]
f: [1]
, because they are discernible only by mutations (if we exclude the
bug-plagued SAME?), exactly like the A and B values above.
> To discern them you must change their value! So I think that "b"
> (with index 3) and "c" (with index 100) are discernibles only if their
value
> is not what actually it is (a clear series). The actual value is an error
for
> both. You can't discern the difference between two values, changing them.
> This lead only to an "ipotetical difference": if values of "a" and "b"
were
> "x" then...
>
> Index, indeed, is not a propriety of values but a propriety of words. In
this
> case, clearing "a" hides this propriety and makes it indifferent to the
> get function (it is indifferent for get if a word is 3 o 100 places after
> tail).
I would say, that index is really an attribute of Rebol series and has
little to do with words ...
> Another thing: if you make a different binding, two word which have the
same
> value can result in different value. Therefore, as you see, I can
distingue
> two words with the same value by binding one of them to another context.
> And binding does not change the initial value, as one can see with a
dependent
> word. So if we try to define all the ipotetical values of a word, we must
keep
> in care
> all the binding (one for every object - could be a fun routine).
> Therefore, i think you should introduce the concept of binding and the
concept
> of
> object before speaking of indiscernibility.
>
> Your text:
>
> >Observation # 1: Two Rebol values A and B are identical, if for every
> equivalence EQ the expression >(eq get/any 'a get/any 'b) yields TRUE. In
> different words: two Rebol values are identical, if they are equivalent
for
> every purpose
>
> Now see this a little strange EQ text which try to respect your spec of
EQ:
> a: 4
> o: context [a: 3]
> same? get/any 'a get/any 'a ;=true
> same? reduce bind [get/any 'a] in o 'a reduce bind [get/any 'a]
> 'system;=false
>
> The value of a is not identical to value of a. :-)
I see, what you are after. You are saying, that you can create a similar
expression as the one I used and get a different result. The expression can
be even more similar, than you have shown:
a: 4
expression: to paren! [same? get/any 'a get/any 'a]
b: use [a] [a: 3 ['a]]
change at :expression 3 b
probe :expression ; == (same? get/any 'a get/any 'a)
expression ; == false
Although the similarity is obvious, I must say, that there are visible
differences.
> I see another little problem, about path:
>
> same? get/any 'a get/any 'system/words/a
>
> gives an error. Perhaps, you should speak only of words or extend the
> definition to include path. Object path is also an indirect form of
binding.
What I had in mind was actually any expression having the property to yield
a Rebol value. I.e. for some values the (eq :a :a) will do, for some cases
(eq 1 + 1 1 + 1) will do, for some cases (eq first [1] first [1]) will do,
for some cases (eq get/any in system/words 'a get/any in system/words 'a)
will do, etc. The only thing we really need for the expression is to start
with "(eq", finish with ")" and contain one subexpression representing a
Rebol value written twice in succession. I thought, that the expression like
(get/any 'a) would be sufficient, because it can represent all necessary
cases.
...snip...
> Trying a very initial definition of mine, more semantic than sintax
oriented,
> I should say:
>
> Two Words have the same meaning (value) if the Vocabularies (context)
> used by the Interpreter for that words, associate (get) them to the same
data.
> Many things should be cleared: first of all: "same data".
That is what I am after here (to make the "same data" meaning clear). I
don't intend to make clear the meaning of the "two words have the same
meaning". I am pretty sure, that the words have very little to do with the
subject. The only reason why I used the subexpression (get/any 'a) lies in
the fact, that it can represent any Rebol value. But, If you are not
comfortable with it, you can use any other subexpression, which is capable
to represent a Rebol value.
> > That is an error, I think. We can always ask questions like: "Are 1 and
1
> > indiscernible values?" as well as: "Are 1 and 2 indiscernible values?".
The
> > question is meaningful regardless of the fact, if the answer is positive
or
> > negative.
>
> Nobody can discern what is indiscernible, as Leibniz teaches, the
question:
> "Are 1 and 1 indiscernible values?" discern the two "1" with the
expression
> itself: the two "1", in fact, have different position in the statement, so
> you,
> and I, can discern them and the question is meaningful.
> I asked you at the beginning if you take in consideration the "literal" or
> "lexical" layer to define indiscernibility...
What about a question: "Is the value 1 indiscernible from itself?" I am
convinced, that the question has got its meaning regardless of the fact,
that the answer should be positive in this case. OTOH, I was trying to write
a definition, that wouldn't discern 1 and 1 "because they can be found at
different places".
My definition is there. Do you find it "literal" or "lexical"?
Ladislav