[REBOL] Re: On mutability and sameness
From: carl:cybercraft at: 18-Jun-2001 11:25
On 18-Jun-01, Ken Anthony wrote:
> Joel,
> Much appreciation for your discussions in this list.
>> Kind of datatype Comparison to be performed
>> ---------------- --------------------------
>> 1) Simple data Compare the data values
>> 2) Reference data Compare the "pointer" values
>> 3) Reference data Compare the "final data" values
>>
>>> ...is there a referenced? vs. non-referenced? type function?
>>
>> Not AFAIK. The following is a quick cut at a function that
>> tells whether the current value of a word is of a reference
>> type.
> May I propose or suggest that RT consider adding a 'simple?'
> function (the word seems to be common to the thread whereas
> sharable? seems to add a nuiance not explicit in your chart above)
> which could act as a lawman for these issues.
>> sharable?: func ['w [word!]] [
>> found? any [
>> series? get w
>> any-function? get w
>> object? get w
>> ]
>> ]
>>
>> It may be used as follows:
>>
>> >> a: "123" == "123"
>> >> sharable? a == true
>> >> a: 123 == 123
>> >> sharable? a == false
>> >> a: 12:30 == 12:30
>> >> sharable? a == false
>> >> a: [1 2 3] == [1 2 3]
>> >> sharable? a == true
>>
>> No warranties expressed or implied! I believe it to be true
>> for the "ordinary data" cases, but it may require tweaking
>> for the more esoteric REBOL-specific types.
As the one who originally suggested 'shared?' as a word, (which I
hadn't notice had mutated into sharable?:), may I second Ken's
suggestion of 'simple?' instead? (Now that I've stopped laughing.:)
Simple things should be simple?, etc., etc... (Even if it's polite
to share.)
--
Carl Read
[carl--cybercraft--co--nz]