REBOL 3 Docs Guide Concepts Functions Datatypes Errors
  TOC < Back Next >   Updated: 24-Feb-2010 Edit History  

REBOL 3 Datatypes: Action!

Concept

This is a variant of a native! function that is standardized across datatypes. (They implement a set of common polymorphic functions.)

For example, the insert function is an action! function. It performs the same abstract operation over a variety of datatypes:

insert "string" 123
insert [a b c] 123

The same is true for the add action (which implements the + operator):

add 1 2
add 1:11 2:22
add 1.2.3 4.5.6
add 80% 10%

Note that not all actions apply to all datatypes. For example, insert is not used for integer! types and add is not used for string! types.

Action functions are optimized, and new actions cannot be added to the system.

List of Actions

A complete list of action functions can be found in system/catalog/actions.

They are listed below.

Magnitude (scalar) oriented:

add

subtract

multiply

divide

remainder

power

and~

or~

xor~

negate

complement

absolute

random

round

odd?

even?

 

Series oriented:

head

tail

head?

tail?

past?

next

back

skip

at

index?

length?

pick

find

select

reflect

make

to

copy

take

insert

append

remove

change

poke

clear

trim

swap

reverse

sort

 

Port oriented:

create

delete

open

close

read

write

open?

query

[bad-link:functions/modify.txt]

update

rename


  TOC < Back Next > REBOL.com - WIP Wiki Feedback Admin