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

[REBOL] Re: Action! What is it?

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 > ?op? > > but > > >> print :and~ > ?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