Elan writes:

>Regarding the any-string! problem: REBOL's error message is incorrect,
>since make does support datatypes. Any-type! should not be categorized by
>type? as being of type datatype! (which is the reason for the erroneous
>error message):
>
>>> type? string!
>== datatype!
>>> s: make string! ""
>== ""
>>> type? any-string!
>== datatype!
>>> s: make any-string! ""
>** Script Error: Cannot use make on datatype! value.
>** Where: s: make any-string! ""
>
>Sure you can use make on datatype! values. It's just any-string! is not a
>datatype! value.

If you ask REBOL, any-string! is a datatype! value.

>> datatype? any-type!
== true

I <<think>> what happens here is that any-type! is not a fundamental
datatype, but a pseudotype. MAKE <<probably>> checks to see if the first
argument is a fundamental datatype, and when that check fails, decides the
first argument must be intended as an "example value", as noted in the
documentation:

>> ? make
Constructs and returns a new value.
Arguments:
    type -- The datatype or example value. (any-type)
    spec -- The attributes of the new value. (any-type)

An example of using an example value:

>> make 1 "2"
== 2

So REBOL thinks we're trying to make a new datatype, which is impossible to
do, and it winds up giving us a rather misleading error message.

This is just a guess, of course.

Eric

Reply via email to