[ALLY] Datatype numbering and the Missing Datatypes Re:
[1/6] from: jeff:rebol at: 21-Sep-2000 6:44
G'day, Allen:
> Hi Ally,
> Found this while I was writing a view function browser
<<quoted lines omitted: 7>>
> found 51 of them, the missing numbers are 4 and 21. Anyone
> know what they are?
Welp, it's not much of a secret that the datatypes in REBOL
have these curious little corresponding numbers associated
with them.
The two missing types that you notice are not represented
directly in REBOL but are used internally. These types
don't have the full semantics of the rest of the "userland"
datatypes. (context! and symbol! respectively).
Pay no attention to the little datatypes behind the curtain!
:-)
-jeff
[2/6] from: carl::rebol::com at: 21-Sep-2000 20:30
You guys are uncovering the little secrets. Was wondering how long
it would take.
A few things: the correspondence between the numbers you are seeing
and datatypes is coincidental. The numbers are actually native,
component relative vectors. The datatypes bootstrap the system
into consciousness, so they are the first in the table. BTW, never,
NEVER, use the numbers, as they can change from release to release.
In the future, that is a fact. I don't care if you are Dpaint, you
will break [historical reference here].
Symbol! is only used in the symbol table. It has no external use.
These "unused" words are unset after the boot.
So, what does context! do?
-Carl
At 9/21/00 08:47 PM +0200, you wrote:
[3/6] from: g:santilli:tiscalinet:it at: 21-Sep-2000 20:47
Hello [allenk--powerup--com--au]!
On 21-Set-00, you wrote:
a> This made me curious so I listed out all of datatypes and
a> found 51 of them, the missing numbers
a> are 4 and 21. Anyone know what they are?
I think Jeff once mentioned an END! datatype used internally, and
it seems to show in system/words, together with CONTEXT!:
>> first system/words
== [end! unset! error! datatype! context! native! action! routine! op! function! object!
struct! library! port! any-type! any-word!...
Did you count these two?
Anyway, the "datatype query action" is the action #0, and probably
it just compares the datatype id of the value with that in the
action definition.
>> second :unset?
== 0
>> second :action?
== 0
>> second :datatype?
== 0
a> I also found a symbol! datatype but it has no corresponding
a> word symbol? Can anyone shed any light on that one?
I asked a lot of time ago, but didn't get any answer. I'm still
curious... :-)
Understanding more and more about REBOL internals,
Gabriele.
--
Gabriele Santilli <[giesse--writeme--com]> - Amigan - REBOL programmer
Amiga Group Italia sez. L'Aquila -- http://www.amyresource.it/AGI/
[4/6] from: larry:ecotope at: 21-Sep-2000 21:49
Hi Carl
Well, symbol! is not unset in the current builds, although context! is.
>> type? symbol!
== datatype!
>> a: make symbol! "abc"
>> type? a
== symbol!
>> b: [a]
== [a]
>> b: reduce b
== []
>> length? b
== 1
>> type? first b
== symbol!
>> mold first b
== ""
>> to-word first b
== abc
I have puzzled over both of these for some time. And Eric Long told me he
stumbled on symbol! way back last fall. My guess about context! would be
that it is the datatype associated with some kind of environment frame
containing binding info for local variables (in other words, a symbol
table). But I really don't know. How about a hint?
BTW How about the numbers which appear as the second of an op! or action!.
>> type? :+
== op!
>> second :+
== 1
But a native! seems to have a second of none.
Cheers
-Larry
[5/6] from: allenk:powerup:au at: 21-Sep-2000 23:14
Hi Ally,
Found this while I was writing a view function browser script.
If you do source unset? you will see it is numbered 1
unset?: native ["Returns TRUE for unset values." value [any-type!] 1]
and source? list shows it is numbered 53.
list?: native ["Returns TRUE for list values." value [any-type!] 53]
This made me curious so I listed out all of datatypes and found 51 of them,
the missing numbers
are 4 and 21. Anyone know what they are?
I also found a symbol! datatype but it has no corresponding word symbol? Can
anyone shed any light on that one?
Cheers,
Allen K
Being too curious for my own good..
[6/6] from: allenk:powerup:au at: 22-Sep-2000 1:10
----- Original Message -----
From: <[jeff--rebol--com]>
To: <[ally--rebol--com]>
Sent: Thursday, September 21, 2000 11:44 PM
Subject: [ALLY] Datatype numbering and the Missing Datatypes Re:
> G'day, Allen:
> > Hi Ally,
<<quoted lines omitted: 22>>
> :-)
> -jeff
Thanks Jeff. I just had to find the missing pieces, bit like the person who
has to know which card is missing from a deck, I know there is no point but
I still do it ;-)
I'd really like to see a cardinal datatype so 1st 2st 3rd, 3m 3ltr 3km 10lb
etc can be used as words, would make block parsing dialects easier when
doing weights and measures.
I guess I should shoot that off to feedback.
Cheers,
Allen K
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted