Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] Re: new puzzle on sameness 1

From: lmecir:mbox:vol:cz at: 15-Feb-2003 21:37

Hi Romano,
> I want to say that identical? can only test > > get/any 'a get/any 'b > > and when you get Rebol values in this way, some informations about the
> value are lost.
None at all IMO. I am considering a possibility to change the wording of the article to make this clearer and to use less ambiguous terminology.
> > I used my definition of identity to define the meaning of > > mutability/immutability. > > You say: > > "two Rebol values are identical, if they aren't discernible. > > 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." > > I think that the evaluation of the expressions get/any 'a get/any 'b
> the Rebol value A and B in two abstractions of A and B. > > (eq get/any 'a get/any 'b) yields TRUE > > is necessary but not sufficient to decide the identity of two rebol
> can be sufficient to decide the identity only of two abstractions (of the
> get/any 'a) of two Rebol value.
An interesting concept, but different than mine.
> I can discern two Rebol value that an equivalence can't discern. For
> this function (written very fast) can check if two integer rebol values > expressed by two words are discernable by word-mutation: > > x: func ['a 'b][if same? get a get b [set a (get a) + 1 if equal? get a
get b
> [return true]] false]
Your function discerns something else IMO. It is (roughly) equivalent to my SAME-REFERENCES? function from , that tries to discern Rebol words.
> 1) why you speak of changes and mutability before defining identical? ?
The order isn't ideal. I am considering a change.
> 2) the mindex? function used in identical? does not use the notion of > mutability?
The MINDEX? function is a function, that has to find some information about its argument. It is like the CHANGE function. You do not have to have a definition of mutation before you use it. Quite the opposite is true. If you use it and then define what a mutation is, you can check, whether it mutates its argument or not.
> PS No answer at all for puzzle 2. Must i post the solution?
It looks, that you will have to, because I do not know, how to do this:
>> series? :magic
== true
>> series? :zero
== true
>> x/a: 1
== 1
>> ; Change is the true change action! >> action? :change
== true
>> change magic zero
== ;RESULT DELETED --- else too easy :-)
>> x/a
== 0 Regards -L