Recent discussions have brought the notion of ‘typesets’ to my attention. On reading the source code, this confused me a bit… they don’t seem to be used all that much. Moreover, they seem to be subsumed by the idea of optimised constraint functions.
So I set out to try them myself. Only to find myself thoroughly confused, because typesets don’t actually seem to be accessible from Revolt itself. Or, at least, none seem to be defined — normal type names evaluate to TYPE-BLOCK!s as expected, but typeset names are unassigned:
>> word!
== &[word]
>> text!
== &[text]
>> any-utf8!
** Script Error: any-utf8! word is attached to a context, but unassigned
** Where: console
** Near: [any-utf8! **]
** Line: 1
>> any-type-value!
** Script Error: any-type-value! word is attached to a context, but unassigned
** Where: console
** Near: [any-type-value! **]
** Line: 1
[On which note, incidentally, let me yet again mention my conviction that the other TYPE-* datatypes are useless and should be removed.]
I expected to at least be able to use them in function signatures, but I can’t even do that, since it crashes a program:
>> test: func [x [word!]] [return x]
== ~#[frame! {test} [x]]~ ; anti
>> test: func [x [any-utf8?]] [return x]
== ~#[frame! {test} [x]]~ ; anti
>> test: func [x [any-utf8!]] [return x]
Assertion failure: QUOTE_BYTE(v) == ANTIFORM_0
Line 165, File: /home/bradrn/Documents/red/ren-c/src/include/cells/cell-quoted.h
Trace/breakpoint trap (core dumped)
So… if they can’t be accessed from Revolt itself, then why does the interpreter have typesets at all?