reduce [unset!] compose [(unset!)]
[1/3] from: antonr::lexicon::net at: 24-May-2004 0:45
I am looking at the difference in behaviour between
compose and reduce:
First, let's see the result of this either expression:
>> type? either none [][]
== unset!
Ok, now let's look at reduce:
>> reduce [unset! either none [][]]
== [unset! unset]
Why was the first unset! molded and the second formed?
Now let's look at compose:
>> compose [(either none [][])]
== []
I like the above compose behaviour, it is useful, but
why doesn't the following unset value also disappear?
>> compose [(unset!)]
== [unset!]
Anton.
[2/3] from: rotenca:telvia:it at: 23-May-2004 18:22
Hi Anton,
> >> reduce [unset! either none [][]]
> == [unset! unset]
>
> Why was the first unset! molded and the second formed?
The difference is that:
reduce [unset!]
is a block! with a word! and when you evaluate it, the word get its value,
which is the datatype! unset!.
while:
reduce [either none [][]]
is a block with an expression which, when evaluated, returns an unset value
(not the datatype unset!).
You can see also:
>> type? either none [][]
== unset!
>> type? unset!
== datatype!
> I like the above compose behaviour, it is useful, but
> why doesn't the following unset value also disappear?
>
> >> compose [(unset!)]
> == [unset!]
The same here.
---
Ciao
Romano
[3/3] from: lmecir:mbox:vol:cz at: 23-May-2004 19:31
Anton Rolls napsal(a):
>...snip... but
>why doesn't the following unset value also disappear?
>
> >> compose [(unset!)]
> == [unset!]
>
because UNSET! is a datatype, if you want to get a value of this
datatype, you can e.g.:
type? () ; == unset!,
which yields what you expect, but not what I expect