Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

Action! What is it?

 [1/3] from: cmaferri::hehe::com at: 19-Nov-2001 10:34


Hi all! Please, could someone tell me what is the difference between an action! datatype (e.g. >>copy [1 2 3]), and a native! one (e.g. reverse [1 2 3]) ? Furthermore, I have casually discovered this strange behaviour:
>> print :and
?op? but
>> print :and~
?action? Does this make any sense to someone? Thanks a lot! angelo _____________________________________________ Free email with personality! Over 200 domains! http://www.MyOwnEmail.com

 [2/3] from: ingo:2b1 at: 19-Nov-2001 18:27


Hi Angelo, Once upon a time Angelo spoketh thus:
> Hi all! > > Please, could someone tell me what is the difference between an action! > datatype (e.g. >>copy [1 2 3]), and a native! one (e.g. reverse [1 2 3]) ?
(I'm giving this answer, in order to be corrected, too. So, have your salt at arms reach, please.) In normal everyday usage op!, action!, and native! are equivalent, they are implemented in C, as opposed to function! implemented in Rebol. That said: - op! (operator) use infix syntax instead of normal Rebol prefix - don't know about the difference between native! / action!, but IIRC it was said, that maybe this distinction may vanish at some time.
> Furthermore, I have casually discovered this strange behaviour: > >> print :and
<<quoted lines omitted: 3>>
> ?action? > Does this make any sense to someone?
Yup!
>> help and
USAGE: value1 AND value2 DESCRIPTION: Returns the first value ANDed with the second. AND is an op value. ARGUMENTS: value1 -- (Type: logic number char tuple binary image) value2 -- (Type: logic number char tuple binary image)
>> help and~
USAGE: AND~ value1 value2 DESCRIPTION: Returns the first value ANDed with the second. AND~ is an action value. ARGUMENTS: value1 -- (Type: logic number char tuple binary image) value2 -- (Type: logic number char tuple binary image) and~ is a special version of and, using prefix syntax. Hope I was able to shed a bit of light on it ... Ingo

 [3/3] from: ammonjohnson:yah:oo at: 19-Nov-2001 17:14


AFAIK Action!, is a special function that only takes ONE argument. Native!, is any function that is created within source code of REBOL so that its source is not available to the 'source function. Op!, is an operator, which is a special function that only takes TWO arguments, but watch out here, one argument is declared before the Operator, & one after for example, '1 + 2' + is an Op! HTH! Ammon

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted