Rebol series and values lack a built in way to add meta data.
For example, imagine two blocks each in a different dialect. Without interpreting their content, how can they be distinguished?
Another example is parsing a foreign format into a sequence of strings but not having a way to distinguish the different kinds of strings. One wants the linear sequence, without having to try to shoe-horn these strings into standard rebol types nor maintain and synchronise some separate attribute system.
For me, these examples point to a missing feature. While suffering some jetlagged induced insomnia I thought of the following idea.
Values could have a user defined property of KIND or CLASS, I'll call it Kind here. Mindful of the above examples, I thought series could have an attribute of Kind, this would be useful for strings and blocks. They would have supporting syntax.
For demonstration I thought Kind could be a word followed by a #, followed by the existing syntax. E.g:
vid#[button "push me"] ; A block of VID dialect.
vector#[1 2 3]
kind of markdown#{*This* could be interesting.} ; Would yield MARKDOWN
Kind would be optional so existing forms would be unaffected:
kind of {simple string} ; would return _
kind of [simple block] ; would return _
An obvious concern is that it would uglify Rebol syntax. I have no answer to that, I'm just at the moment excited by what benefits could be derived.
In a sense Kind is just tagging values and would be orthogonal to the rebol types. But it could allow functions to check the Kind of their arguments, and possibly have some operations choosen by Kind. As such it may be answer to user types - if you want a custom type, define a dialect to represent the type (which can identified by Kind). No need for some developer designed custom syntax.
Matching by Kind in PARSE would be really really useful.
PARSE could have a mode to emit matched sequences with a Kind that comes from rules invoked by words. Giving a basic parse tree output for little effort - highly useful for data extraction.
Pathing by kind could perhaps enable some sophisticated extraction from recursive structured formats (XML?).
Presumably other ideas would be forthcoming if Kind was available.
Kind could probably be applicable to all rebol types:
column#3 ; An integer whose kind is Column.
I don't know if this idea is good or terrible, but it is interesting at least. Wondering what people think and if there are better ideas?