Hi Eric,
you wrote interesting stuff:
>
>If you ask REBOL, any-string! is a datatype! value.
>
>>> datatype? any-type!
>== true
This works better (for this particular example ;-):
>> datatype? any-string!
== true
That's the problem. type? any-string! indeed returns datatype! However,
any-string! is not a datatype!. As you point out later, it's a
pseudo-type!. Therefore, it's a mistake when type? returns datatype! as
any-string's type. Type? should report that any-string! is a pseudotype!,
right?
>
>I <<think>> what happens here is that any-type! is not a fundamental
>datatype,
never heard of a fundamental datatype. According to make's help text it
doesn't require a FUNDAMENTAL datatype, but a datatype. Perhaps make's
attempt to use any-string! as a datatype! fails, and therefore ...
eventually, REBOL reports the error.
>but a pseudotype. MAKE <<probably>> checks to see if the first
>argument is a fundamental datatype,
Maybe it does. How would it do that:
>> fudamental-datatype? any-string!
** Script Error: fudamental-datatype? has no value.
** Where: fudamental-datatype? any-string!
>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.
I think what you mean here is that - having determined that any-string! is
not a datatype! - even though type? reports that it is - it is not a
datatype!, which make can use as a datatype!, make tries to use any-string!
as an example value. In order to do that it has to retrieve any-string!'s
datatype, in order to return a new value with the same datatype! Apparently
make knows how to create different datatype!'s, but it does not know how to
create a value of type datatype!.
The misleading error message is due to the fact that type? reports
any-string! as value of type datatype!, which it isn't, since it's real
type is pseudotype. This is what I was trying to point out. The correct
error message should be:
>> make any-string! "abc"
** Script Error: Cannot use make on pseudotype! value.
** Where: make any-string! "abc"
Elan