[REBOL] Re: Model hacking
From: joel:neely:fedex at: 22-Jun-2001 12:56
Ladislav Mecir wrote:
> Another one:
> 5) SYSTEM vs. USER -- Some types are predefined by REBOL and
> the user cannot create values of that
> type (e.g., op!) while other types can be created at will
> by the user's expressions (object! and function!)
> 6) CLOSED vs. OPEN -- Some types (logic! and datatype!) have
> a set-in-concrete set of possible
> values, while others are open-ended and new values may be
> created at will (function! and block!)
> 5) and 6) look like being "unifiable"
I pondered that issue, and freely admit that I decided to
separate them primarily on philosophical grounds. (However,
I was in a hurry and confused the issue by a VERY poor
choice of examples.) Let me go to extremes first:
LOGIC! - Not only "closed", but closed "in principle".
It wouldn't seem to make sense for RT to release
a new version of /core or /view with new values of this type.
BLOCK! - Open "in principle". Anyone may evaluate code that
creates a block that has never existed before (with
arbitrarily high probability, at least ;-)
>> reduce ["Joel's birthday might be"
[ to-date reduce [random 2000 random 12 random 31]
[ "which would make him"
[ random 2000
[ "years old"
== ["Joel's birthday might be" 6-May-0283
"which would make him" 489
In between those extremes are:
EVENT! - I thought I saw an email about users not being
able to create events. Whether memory serves me
correctly or not, it seems that "in principle" RT could
define a datatype that could be created by the interpreter
but not directly by the user.
OP! and NATIVE! - Although a given release has a finite,
specific set of these, each new release
can (and usually does) contains an expanded set, drawn
from a seemingly inexhaustible fount which remains beyond
the reach of mere mortals! (The DATATYPE! type should have
been in this category, but I rushed through my typing too
quickly. Mea culpa!)
Now for the slightly more controversial cases ;-)
CHAR! and INTEGER! - I propose that these are CLOSED (in
that the set of *possible* character
and integer values are finite) but USER (in the sense that
I can make one whenever I want).
One issue wrt calling INTEGER! a closed type is that if RT
were to add a BIGNUM! type (integral of arbitrary precision)
to a future version of REBOL, I'd think of BIGNUM! as
OPEN/USER (no a priori upper limit, except for the size of
your swap file ;-)
Programming languages: compact, powerful, simple ...
Pick any two!