Dr. J. J. "One Eyed CrackerJack" Harbaugh 



-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Gabriele Santilli
Sent: Sunday, November 23, 2003 4:19 AM
To: Joel Neely
Subject: [REBOL] Re: [datatypes] action! vs. native! vs function!



Hi Joel,

On Saturday, November 22, 2003, 11:15:09 PM, you wrote:

JN> Does anyone know the difference between NATIVE! and ACTION! types?

The list of the types in the ANY-FUNCTION! pseudo-type is:

native!
action!
op!
function!

As  you  say, FUNCTION! values are the one we can create. ACTION!, OP!
and  NATIVE! values are "built in" in the interpreter, and we cannot
create them.

The  distinction  between  the  three  is  a little subtle, and is
mainly an implementation issue I think (IIRC, Carl once said this,
too).  NATIVE!s  are  the  "primitives",  as you say. ACTION!s are
those  primitives  that are actually "methods" (to use terminology
from  other  languages)  in  other datatypes; that is, while for a
NATIVE! there is one C implementation inside REBOL, for an ACTION!
there  can be more than one implementation; for example, PICK on a
PORT!  is  different  from  PICK on a BLOCK!. While doing what you
call "particle physics", I and others also discovered this:

>> second :print
== none
>> second :pick
== 40

While NATIVE!s do not have a "second" element, ACTION!s do, and it is
a number; our guess (and I think it was more or less confirmed by  RT)
is  that  that  number is actually an index in a function table for
the datatype.

Finally,  OP!s are the infix version of ACTION!s (I'm not sure, as I
haven't checked, if OP!s only map to ACTION!s or if they can map to
NATIVE!s too). Being of type OP! is not enough to be treated as an
infix  operator  by REBOL, as this is the only place where the
function  interpreter  is "keywordized"; that is, only a number of
pre-defined words can be OP!s.

HTH,
   Gabriele.
-- 
Gabriele Santilli <[EMAIL PROTECTED]>  --  REBOL Programmer
Amiga Group Italia sez. L'Aquila  ---   SOON: http://www.rebol.it/

-- 
To unsubscribe from this list, just send an email to
[EMAIL PROTECTED] with unsubscribe as the subject.


-- 
To unsubscribe from this list, just send an email to
[EMAIL PROTECTED] with unsubscribe as the subject.

Reply via email to