REBOL Quick Reference Card

A sheet of basic R3 features and functions for new programmers. (blog note) (suggestions?)

Syntax, Datatypes
word
variable:
path/refinement
[block]
12345
12.35 12,34
10x20 (pair)
1.2.3.4 (tuple)
10:20:30 (time)
1/jan/2010 (date)
#"R" (char)
"string"
{multi-line
string}
#{12AB C3D4} (binary)
%file
url://location
<tag>
email@domain
#issue
;comment
Constants
true false on off yes no
newline tab cr lf null
pi
System
system/version
system/product
system/options
system/script
system/contexts
Evaluate
do
do  value  /args  arg  /next  var

Evaluates a block, file, URL, function, word, or any other value.

Arguments:

value [any-type!] - Normally a file name, URL, or block

Refinements:

/args - If value is a script, this will set its system/script/args

arg - Args passed to a script (normally a string)

/next - Do next expression only, return it, update block variable

var [word!] - Variable updated with new block position

See also:

reduce   load   import   loop   repeat   call   launch  

reduce
reduce  value  /no-set  /only  words  /into  out

Evaluates expressions and returns multiple results.

Arguments:

value

Refinements:

/no-set - Keep set-words as-is. Do not set them.

/only - Only evaluate words and paths, not functions

words [block! none!] - Optional words that are not evaluated (keywords)

/into - Output results into a block with no intermediate storage

out [any-block!]

See also:

compose   do   foreach  

compose
compose  value  /deep  /only  /into  out

Evaluates a block of expressions, only evaluating parens, and returns a block.

Arguments:

value - Block to compose

Refinements:

/deep - Compose nested blocks

/only - Insert a block as a single value (not the contents of the block)

/into - Output results into a block with no intermediate storage

out [any-block!]

See also:

reduce   append   repend   rejoin   insert  

Branch
if
if  condition  then-block  /else  else-block

If condition is TRUE, evaluates the block.

Arguments:

condition

then-block [block!]

Refinements:

/else - If not true, evaluate this block

else-block [block!]

See also:

either   any   all   unless   switch   select  

either
either  condition  true-block  false-block

If condition is TRUE, evaluates the first block, else evaluates the second.

Arguments:

condition

true-block [block!]

false-block [block!]

See also:

if   any   all   unless   case   switch   pick  

all
all  block

Shortcut AND. Evaluates and returns at the first FALSE or NONE.

Arguments:

block [block!] - Block of expressions

See also:

any   and   or   case   switch  

any
any  block

Shortcut OR. Evaluates and returns the first value that is not FALSE or NONE.

Arguments:

block [block!] - Block of expressions

See also:

all   or   and   case   switch  

case
case  block  /all

Evaluates each condition, and when true, evaluates what follows it.

Arguments:

block [block!] - Block of cases (conditions followed by values)

Refinements:

/all - Evaluate all cases (do not stop at first true case)

See also:

switch   if   either   select   find  

switch
switch  value  cases  /default  case  /all

Selects a choice and evaluates the block that follows it.

Arguments:

value - Target value

cases [block!] - Block of cases to check

Refinements:

/default

case - Default case if no others found

/all - Evaluate all matches (not just first one)

See also:

case   select   find  

Loop
loop
loop  count  block

Evaluates a block a specified number of times.

Arguments:

count [number!] - Number of repetitions

block [block!] - Block to evaluate

See also:

repeat   for   while   until   do   break   continue  

repeat
repeat  word  value  body

Evaluates a block a number of times or over a series.

Arguments:

word [word!] - Word to set each time

value [number! series! none!] - Maximum number or series to traverse

body [block!] - Block to evaluate each time

See also:

loop   foreach   forall   forskip   for   while   until  

foreach
foreach  word  data  body

Evaluates a block for each value(s) in a series.

Arguments:

word [word! block!] - Word or block of words to set each time (local)

data [series! any-object! map! none!] - The series to traverse

body [block!] - Block to evaluate each time

See also:

remove-each   map-each   for   forall   forskip   repeat  

while
while  cond-block  body-block

While a condition block is TRUE, evaluates another block.

Arguments:

cond-block [block!]

body-block [block!]

See also:

until   loop   repeat   for  

remove-each
remove-each  word  data  body

Removes values for each block that returns true. Returns remove count. (Modifies)

Arguments:

word [word! block!] - Word or block of words to set each time (local)

data [series!] - The series to traverse

body [block!] - Block to evaluate (return TRUE to remove)

See also:

foreach   remove   map-each  

break
break  /return  value

Breaks out of a loop, while, until, repeat, foreach, etc.

Refinements:

/return - Forces the loop function to return a value

value [any-type!]

See also:

continue   catch   exit   return   loop   repeat   for   forall   foreach   forever   forskip   while   until  

Function
function
function  spec  vars  body

Defines a user function with local words.

Arguments:

spec [block!] - Optional help info followed by arg words (and optional type and string)

vars [block!] - List of words that are local to the function

body [block!] - The body block of the function

See also:

func   does   has   make   use   function!   function?   return   exit  

funct
funct  spec  body  /with  object

Defines a function with all set-words as locals.

Arguments:

spec [block!] - Help string (opt) followed by arg words (and opt type and string)

body [block!] - The body block of the function

Refinements:

/with - Define or use a persistent object (self)

object [object! block! map!] - The object or spec

func
func  spec  body

Defines a user function with given spec and body.

Arguments:

spec [block!] - Help string (opt) followed by arg words (and opt type and string)

body [block!] - The body block of the function

See also:

closure   does   has   funco   funct   function   use   make   function!   function?   return   exit  

has
has  vars  body

A shortcut to define a function that has local variables but no arguments.

Arguments:

vars [block!] - List of words that are local to the function

body [block!] - The body block of the function

See also:

func   function   does   exit   return   use  

does
does  body

A shortcut to define a function that has no arguments or locals.

Arguments:

body [block!] - The body block of the function

See also:

closure   exit   func   function   has   return   use  

exit
exit

Exits a function, returning no value.

See also:

return   catch   break  

return
return  value  /redo

Returns a value from a function.

Arguments:

value [any-type!]

Refinements:

/redo - Upon return, re-evaluate the returned result. (Used for DO)

See also:

break   exit   catch  

Error
attempt
attempt  block

Tries to evaluate a block and returns result or NONE on error.

Arguments:

block [block!]

See also:

try   error?  

try
try  block  /except  code

Tries to DO a block and returns its value or an error.

Arguments:

block [block!]

Refinements:

/except - On exception, evaluate this code block

code [block! any-function!]

See also:

attempt   error?   do  

catch
catch  block  /name  word  /quit

Catches a throw from a block and returns its value.

Arguments:

block [block!] - Block to evaluate

Refinements:

/name - Catches a named throw

word [word! block!] - One or more names

/quit - Special catch for QUIT native

See also:

throw   do   try  

throw
throw  value  /name  word

Throws control back to a previous catch.

Arguments:

value [any-type!] - Value returned from catch

Refinements:

/name - Throws to a named catch

word [word!]

See also:

catch   return   exit  

Help/Debug
help
help  word  /doc

Prints information about words and values.

Arguments:

word [any-type!]

Refinements:

/doc - Open web browser to related documentation.

See also:

?   what   ??   docs  

what
what  name  /args

Prints a list of known functions.

Arguments:

name [word! lit-word! unset!] - Optional module name

Refinements:

/args - Show arguments not titles

See also:

help   ?  

docs
docs

Browse on-line documentation.

source
source  word

Prints the source code for a word.

Arguments:

word [word! path!]

See also:

what   help   ?   ??   trace  

trace
trace  mode  /back  /function

Enables and disables evaluation tracing and backtrace.

Arguments:

mode [integer! logic!]

Refinements:

/back - Set mode ON to enable or integer for lines to display

/function - Traces functions only (less output)

See also:

echo   probe   stack  

probe
probe  value

Debug print a molded value and returns that same value.

Arguments:

value [any-type!]

See also:

??   mold   print   trace   source   help   what  

??
??  name

Debug print a word, path, or block of such, followed by its molded value.

Arguments:

name - Word, path, and block to obtain values.

See also:

probe   help   ?   mold   source  

delta-time
delta-time  block

Delta-time - return the time it takes to evaluate a block.

Arguments:

block [block!]

See also:

delta-profile   dt   dp  

Compare
<
<  value1  value2

Returns TRUE if the first value is less than the second value.

Arguments:

value1

value2

See also:

lesser?   <=   >   >=   =   <>   min   max  

>
>  value1  value2

Returns TRUE if the first value is greater than the second value.

Arguments:

value1

value2

See also:

greater?   <   <=   >=   =   <>   min   max  

<=
<=  value1  value2

Returns TRUE if the first value is less than or equal to the second value.

Arguments:

value1

value2

See also:

lesser-or-equal?   <   >   >=   =   <>   min   max  

>=
>=  value1  value2

Returns TRUE if the first value is greater than or equal to the second value.

Arguments:

value1

value2

See also:

greater-or-equal?   <   <=   >   =   <>   min   max  

=
=  value1  value2

Returns TRUE if the values are equal.

Arguments:

value1

value2

See also:

<>   ==   equal?  

==
==  value1  value2

Returns TRUE if the values are strictly equal.

Arguments:

value1

value2

See also:

=   <>   strict-equal?  

<>
<>  value1  value2

Returns TRUE if the values are not equal.

Arguments:

value1

value2

See also:

=   ==   not-equal?  

!=
!=  value1  value2

Returns TRUE if the values are not equal.

Arguments:

value1

value2

See also:

=   <>   !==  

!==
!==  value1  value2

Returns TRUE if the values are not strictly equal.

Arguments:

value1

value2

See also:

==   =   <>   !=  

=?
=?  value1  value2

Returns TRUE if the values are identical.

Arguments:

value1

value2

See also:

=   ==   same?  

same?
same?  value1  value2

Returns TRUE if the values are identical.

Arguments:

value1

value2

See also:

=?   equal?  

Math
+
+  value1  value2

Returns the result of adding two values.

Arguments:

value1 [scalar! date!]

value2

See also:

-   add   subtract  

-
-  value1  value2

Returns the second value subtracted from the first.

Arguments:

value1 [scalar! date!]

value2 [scalar! date!]

See also:

+   add   subtract   negate   absolute  

*
/
/  value1  value2

Returns the first value divided by the second.

Arguments:

value1 [scalar!]

value2 [scalar!]

See also:

  //   divide    

**
remainder
remainder  value1  value2

Returns the remainder of first value divided by second.

Arguments:

value1 [scalar!]

value2 [scalar!]

See also:

//     /    

negate
negate  number

Changes the sign of a number.

Arguments:

number [number! pair! money! time! bitset!]

See also:

+   -   positive?   negative?   complement   not  

abs
abs  value

Returns the absolute value.

Arguments:

value [number! pair! money! time!]

See also:

absolute   sign?   negate   -  

absolute
absolute  value

Returns the absolute value.

Arguments:

value [number! pair! money! time!]

See also:

abs   sign?   negate   -  

round
round  n  /to  scale  /even  /down  /half-down  /floor  /ceiling  /half-ceiling

Rounds a numeric value. Halves round up (away from zero) by default.

Arguments:

n [number! pair! money! time!] - The value to round

Refinements:

/to - Return the nearest multiple of the scale parameter

scale [number! money! time!] - Must be a non-zero value

/even - Halves round toward even results

/down - Round toward zero, ignoring discarded digits. (truncate)

/half-down - Halves round toward zero

/floor - Round in negative direction

/ceiling - Round in positive direction

/half-ceiling - Halves round in positive direction

See also:

mod   modulo   //   remainder  

min
min  value1  value2

Returns the lesser of the two values.

Arguments:

value1 [scalar! date! series!]

value2 [scalar! date! series!]

See also:

max   <   >   minimum-of   maximum-of  

max
max  value1  value2

Returns the greater of the two values.

Arguments:

value1 [scalar! date! series!]

value2 [scalar! date! series!]

See also:

min   maximum-of   <   >   maximum  

and
and  value1  value2

Returns the first value ANDed with the second.

Arguments:

value1 [logic! integer! char! tuple! binary! bitset! typeset! datatype!]

value2 [logic! integer! char! tuple! binary! bitset! typeset! datatype!]

See also:

or   all   not   xor   logic?   integer?  

or
or  value1  value2

Returns the first value ORed with the second.

Arguments:

value1 [logic! integer! char! tuple! binary! bitset! typeset! datatype!]

value2 [logic! integer! char! tuple! binary! bitset! typeset! datatype!]

See also:

and   not   xor  

xor
xor  value1  value2

Returns the first value exclusive ORed with the second.

Arguments:

value1 [logic! integer! char! tuple! binary! bitset! typeset! datatype!]

value2 [logic! integer! char! tuple! binary! bitset! typeset! datatype!]

See also:

and   or   not  

not
not  value

Returns the logic complement.

Arguments:

value - (Only FALSE and NONE return TRUE)

See also:

complement   negate   and   or   xor   unless  

random
random  value  /seed  /secure  /only

Returns a random value of the datatype or shuffles series (modifies).

Arguments:

value - Maximum value of result

Refinements:

/seed - Restart or randomize

/secure - Returns a cryptographically secure random number

/only - Pick a random value from a series

See also:

checksum   now  

shift
shift  value  bits  /logical

Shifts an integer left or right by a number of bits.

Arguments:

value [integer!]

bits [integer!] - Positive for left shift, negative for right shift

Refinements:

/logical - Logical shift (sign bit ignored)

sine
sine  value  /radians

Returns the trigonometric sine.

Arguments:

value [number!] - In degrees by default

Refinements:

/radians - Value is specified in radians

See also:

arccosine   arcsine   arctangent   cosine   pi   tangent  

log-e
log-e  value

Returns the base-E (natural number) logarithm.

Arguments:

value [number!]

See also:

exp   log-10   log-2   power  

to
to  type  spec

Converts to a specified datatype.

Arguments:

type [any-type!] - The datatype or example value

spec [any-type!] - The attributes of the new value

See also:

make  

(conversion)
Reflection
words-of
words-of  value

Returns a copy of the words of a function, object, or module

Arguments:

value

See also:

body-of   reflect   spec-of   title-of   types-of   values-of  

values-of
values-of  value

Returns a copy of the values of a object or module

Arguments:

value

See also:

body-of   reflect   spec-of   title-of   types-of   words-of  

title-of
title-of  value

Returns a copy of the title of a function

Arguments:

value

See also:

body-of   reflect   spec-of   types-of   values-of   words-of  

spec-of
spec-of  value

Returns a copy of the spec of a function or module

Arguments:

value

See also:

body-of   reflect   title-of   types-of   values-of   words-of  

body-of
body-of  value

Returns a copy of the body of a function, object, or module

Arguments:

value

See also:

reflect   spec-of   title-of   types-of   values-of   words-of  

Series Get
find
find  series  value  /part  length  /only  /case  /any  /with  wild  /skip  size  /last  /reverse  /tail  /match

Finds a value in a series and returns the series at the start of it.

Arguments:

series [series! gob! port! bitset! typeset! object! none!]

value [any-type!]

Refinements:

/part - Limits the search to a given length or position

length [number! series! pair!]

/only - Treats a series value as only a single value

/case - Characters are case-sensitive

/any - Enables the * and ? wildcards

/with - Allows custom wildcards

wild [string!] - Specifies alternates for * and ?

/skip - Treat the series as records of fixed size

size [integer!]

/last - Backwards from end of series

/reverse - Backwards from the current position

/tail - Returns the end of the series

/match - Performs comparison and returns the tail of the match

See also:

select   pick  

select
select  series  value  /part  length  /only  /case  /any  /with  wild  /skip  size  /last  /reverse

Finds a value in the series and returns the value or series after it.

Arguments:

series [series! port! map! object! none!]

value [any-type!]

Refinements:

/part - Limits the search to a given length or position

length [number! series! pair!]

/only - Treats a series value as only a single value

/case - Characters are case-sensitive

/any - Enables the * and ? wildcards

/with - Allows custom wildcards

wild [string!] - Specifies alternates for * and ?

/skip - Treat the series as records of fixed size

size [integer!]

/last - Backwards from end of series

/reverse - Backwards from the current position

See also:

find   switch  

first
first  value

Returns the first value of a series.

Arguments:

value

See also:

pick   second   third   fourth   fifth  

last
last  value

Returns the last value of a series.

Arguments:

value [series! tuple! gob!]

pick
pick  series  index

Returns the value at the specified position in a series.

Arguments:

series [series! map! gob! pair! date! time! tuple! bitset! port!]

index - Index offset, symbol, or other value to use as index

See also:

first   second   third   fourth   fifth   find   select  

length?
length?  series

Returns the length of the series from the current position.

Arguments:

series [series! port! map! tuple! bitset! object! gob! struct! any-word!]

See also:

head   tail?   offset?  

index?
index?  series  /xy

Returns the index number of the current position in the series.

Arguments:

series [series! gob! port!]

Refinements:

/xy - Returns index as an XY pair offset

See also:

length?   offset?   head   head?   tail   tail?   pick   skip  

next
next  series

Returns the series at its next position.

Arguments:

series [series! gob! port!]

See also:

back   first   head   tail   head?   tail?  

back
back  series

Returns the series at its previous position.

Arguments:

series [series! gob! port!]

See also:

next   last   head   tail   head?   tail?  

skip
skip  series  offset

Returns the series forward or backward from the current position.

Arguments:

series [series! gob! port!]

offset [number! logic! pair!]

See also:

at   index?   next   back  

Series Make
make
make  type  spec

Constructs a specified datatype.

Arguments:

type [any-type!] - The datatype or example value

spec [any-type!] - The attributes of the new value

See also:

copy   type?  

copy
copy  value  /part  length  /deep  /types  kinds

Copies a series or object.

Arguments:

value [series! port! map! object! bitset! any-function!]

Refinements:

/part - Limits to a given length or position

length [number! series! pair!]

/deep - Also copies series values within the block

/types - What datatypes to copy

kinds [typeset! datatype!]

See also:

make   form   mold   join   ajoin   rejoin  

join
join  value  rest

Concatenates values.

Arguments:

value - Base value

rest - Value or block of values

See also:

ajoin   rejoin   form   reform   append   repend   mold   remold  

ajoin
ajoin  block

Reduces and joins a block of values into a new string.

Arguments:

block [block!]

See also:

join   rejoin   form   reform   append  

rejoin
rejoin  block

Reduces and joins a block of values.

Arguments:

block [block!] - Values to reduce and join

See also:

join   ajoin   form   reform  

Series Modify
append
append  series  value  /part  length  /only  /dup  count

Inserts a value at tail of series and returns the series at head. (Modifies)

Arguments:

series [series! port! map! gob! object! bitset!] - Series at point to insert

value [any-type!] - The value to insert

Refinements:

/part - Limits to a given length or position

length [number! series! pair!]

/only - Only insert a block as a single value (not the contents of the block)

/dup - Duplicates the insert a specified number of times

count [number! pair!]

See also:

insert   change   remove   repend  

repend
repend  series  value  /part  length  /only  /dup  count

Appends a reduced value to a series and returns the series head.

Arguments:

series [series! port! map! gob! object! bitset!] - Series at point to insert

value - The value to insert

Refinements:

/part - Limits to a given length or position

length [number! series! pair!]

/only - Inserts a series as a series

/dup - Duplicates the insert a specified number of times

count [number! pair!]

See also:

append   insert   reduce   join  

insert
insert  series  value  /part  length  /only  /dup  count

Inserts into a series and returns the series after the insert. (Modifies)

Arguments:

series [series! port! map! gob! object! bitset! port!] - Series at point to insert

value [any-type!] - The value to insert

Refinements:

/part - Limits to a given length or position

length [number! series! pair!]

/only - Only insert a block as a single value (not the contents of the block)

/dup - Duplicates the insert a specified number of times

count [number! pair!]

See also:

append   change   clear   remove   join  

remove
remove  series  /part  length

Removes value(s) from a series and returns after the remove. (Modifies)

Arguments:

series [series! gob! port! bitset! none!]

Refinements:

/part - Removes to a given length or position

length [number! series! pair! char!]

See also:

append   change   clear   insert   sort  

take
take  value  /part  length  /deep  /last

Copies and removes from series. (Modifies)

Arguments:

value [series! port! gob! none!]

Refinements:

/part - Limits to a given length or position

length [number! series! pair!]

/deep - Also copies series values within the block

/last - Take it from the tail end

clear
clear  series

Removes all values. For series, removes from current index to tail and returns tail. (Modifies)

Arguments:

series [series! port! map! gob! bitset! none!]

See also:

remove   append   change   insert   sort  

change
change  series  value  /part  length  /only  /dup  count

Changes a value in a series and returns the series after the change. (Modifies)

Arguments:

series [series! gob! port!] - Series at point to change

value [any-type!] - The new value

Refinements:

/part - Limits the amount to change to a given length or position

length [number! series! pair!]

/only - Only change a block as a single value (not the contents of the block)

/dup - Duplicates the change a specified number of times

count [number! pair!]

See also:

append   clear   insert   remove   sort  

replace
replace  target  search  replace  /all  /case  /tail

Replaces a search value with the replace value within the target series.

Arguments:

target [series!] - Series that is being modified

search - Value to be replaced (converted if necessary)

replace - Value to replace with (called each time if a function)

Refinements:

/all - Replace all occurrences

/case - Case-sensitive replacement

/tail - Return target after the last replacement position

See also:

insert   remove   change  

trim
trim  series  /head  /tail  /auto  /lines  /all  /with  str

Removes space from a string or NONE from a block or object.

Arguments:

series [series! object! error! module!]

Refinements:

/head - Removes only from the head

/tail - Removes only from the tail

/auto - Auto indents lines relative to first line

/lines - Removes all line breaks and extra spaces

/all - Removes all whitespace

/with

str [char! string! binary! integer!] - Same as /all, but removes characters in 'str'

See also:

parse   remove   clear   trim-last  

split
split  series  dlm  /into

Split a series into pieces; fixed or variable size, fixed number, or at delimiters

Arguments:

series [series!] - The series to split

dlm [block! integer! char! bitset! any-string!] - Split size, delimiter(s), or rule(s).

Refinements:

/into - If dlm is an integer, split into n pieces, rather than pieces of length n.

See also:

extract   parse  

sort
sort  series  /case  /skip  size  /compare  comparator  /part  length  /all  /reverse

Sorts a series. (Modifies)

Arguments:

series [series!]

Refinements:

/case - Case sensitive sort

/skip - Treat the series as records of fixed size

size [integer!] - Size of each record

/compare - Comparator offset, block or function

comparator [integer! block! any-function!]

/part - Sort only part of a series

length [number! series!] - Length of series to sort

/all - Compare all fields

/reverse - Reverse sort order

See also:

append   change   clear   insert   remove  

swap
swap  series1  series2

Swaps elements of a series. (Modifies)

Arguments:

series1 [series! gob!]

series2 [series! gob!]

Sets
unique
unique  set1  /case  /skip  size

Returns the data set with duplicates removed.

Arguments:

set1 [block! string! binary! bitset! typeset!]

Refinements:

/case - Use case-sensitive comparison (except bitsets)

/skip - Treat the series as records of fixed size

size [integer!]

See also:

intersect   union   difference   exclude  

union
union  set1  set2  /case  /skip  size

Returns the union of two data sets.

Arguments:

set1 [block! string! binary! bitset! typeset!] - first set

set2 [block! string! binary! bitset! typeset!] - second set

Refinements:

/case - Use case-sensitive comparison

/skip - Treat the series as records of fixed size

size [integer!]

See also:

difference   intersect   exclude   unique  

intersect
intersect  set1  set2  /case  /skip  size

Returns the intersection of two data sets.

Arguments:

set1 [block! string! binary! bitset! typeset!] - first set

set2 [block! string! binary! bitset! typeset!] - second set

Refinements:

/case - Uses case-sensitive comparison

/skip - Treat the series as records of fixed size

size [integer!]

See also:

difference   union   exclude   unique  

difference
difference  set1  set2  /case  /skip  size

Returns the difference of two data sets or dates.

Arguments:

set1 [block! string! binary! bitset! date! typeset!] - First data set

set2 [block! string! binary! bitset! date! typeset!] - Second data set

Refinements:

/case - Uses case-sensitive comparison

/skip - Treat the series as records of fixed size

size [integer!]

See also:

intersect   union   exclude   unique  

exclude
exclude  set1  set2  /case  /skip  size

Returns the first data set less the second data set.

Arguments:

set1 [block! string! binary! bitset! typeset!] - First data set

set2 [block! string! binary! bitset! typeset!] - Second data set

Refinements:

/case - Uses case-sensitive comparison

/skip - Treat the series as records of fixed size

size [integer!]

See also:

difference   intersect   union   unique  

Console
print
print  value

Outputs a value followed by a line break.

Arguments:

value [any-type!] - The value to print

See also:

prin   probe   ??   form   reform   format   mold   remold   ajoin   join   rejoin   input   echo  

probe
probe  value

Debug print a molded value and returns that same value.

Arguments:

value [any-type!]

See also:

??   mold   print   trace   source   help   what  

input
input

Inputs a string from the console. New-line character is removed.

See also:

input?   ask   confirm  

ask
ask  question  /hide

Ask the user for input.

Arguments:

question [series!] - Prompt to user

Refinements:

/hide - mask input with *

See also:

confirm   input   prin   print  

confirm
confirm  question  /with  choices

Confirms a user choice.

Arguments:

question [series!] - Prompt to user

Refinements:

/with

choices [string! block!]

See also:

ask   input   prin  

halt
halt

Stops evaluation and returns to the input prompt.

See also:

quit   break   exit   catch  

quit
quit  /return  value  /now

Stops evaluation and exits the interpreter.

Refinements:

/return - Returns a value (to prior script or command shell)

value - Note: use integers for command shell

/now - Quit immediately

See also:

halt   exit   q  

Output
mold
mold  value  /only  /all  /flat

Converts a value to a REBOL-readable string.

Arguments:

value [any-type!] - The value to mold

Refinements:

/only - For a block value, mold only its contents, no outer []

/all - Mold in serialized format

/flat - No indentation

See also:

form   remold   join   insert   reduce  

form
form  value

Converts a value to a string.

Arguments:

value [any-type!] - The value to form

See also:

print   reform   mold   remold   ajoin   join   rejoin  

to
to  type  spec

Converts to a specified datatype.

Arguments:

type [any-type!] - The datatype or example value

spec [any-type!] - The attributes of the new value

See also:

make  

Files/Ports
read
read  source  /part  length  /seek  index  /string  /lines

Read from a file, URL, or other port.

Arguments:

source [port! file! url! block!]

Refinements:

/part - Partial read a given number of units (source relative)

length [number!]

/seek - Read from a specific position (source relative)

index [number!]

/string - Convert UTF and line terminators to standard text string

/lines - Convert to block of strings (implies /string)

See also:

write   open   close   load   save   set-modes   get-modes   file!   url!   port!  

write
write  destination  data  /part  length  /seek  index  /append  /allow  access  /lines

Writes to a file, URL, or other port - auto-converts text strings.

Arguments:

destination [port! file! url! block!]

data [binary! string! block!] - Data to write (non-binary converts to UTF-8)

Refinements:

/part - Partial write a given number of units

length [number!]

/seek - Write at a specific position

index [number!]

/append - Write data at end of file

/allow - Specifies protection attributes

access [block!]

/lines - Write each value in a block as a separate line

See also:

read   open   close   load   save   file!   url!   form   set-modes   get-modes  

load
load  source  /header  /next  /all  /unbound

Loads a file, URL, or string.

Arguments:

source [file! url! string! binary! block!] - Source or block of sources

Refinements:

/header - Includes REBOL header object if present. Preempts /all.

/next - Load the next value only. Return block with value and new position.

/all - Load all values. Does not evaluate REBOL header.

/unbound - Do not bind the block.

See also:

save   read   do   import   bind  

save
save  where  value  /header  header-data  /all

Saves a value or a block to a file, URL, or into a string.

Arguments:

where [file! url! binary! string! none!] - Where to save (suffix determines encoding)

value - Value to save

Refinements:

/header - Save it with a header

header-data [block! object! logic!] - Header block, object, or take object from value

/all - Save in serialized format

See also:

load   mold   write  

open
open  spec  /new  /read  /write  /seek  /allow  access

Opens a port. Makes a new port from a specification, if necessary.

Arguments:

spec [port! file! url! block!]

Refinements:

/new - Create new file - if it exists, reset it (truncate)

/read - Open for read access

/write - Open for write access

/seek - Optimize for random access

/allow - Specifies protection attributes

access [block!]

See also:

close   load   do   insert   remove   read   write   query   get-modes   set-modes  

close
close  port

Closes a port.

Arguments:

port [port!]

See also:

open   load   do   send  

delete
delete  port

Send port a delete request.

Arguments:

port [port! file! url! block!]

See also:

create   exists?  

exists?
exists?  target

Returns the type of a file or URL if it exists, otherwise none.

Arguments:

target [file! url!]

See also:

read   write   delete   modified?   size?  

size?
size?  target

Returns the size of a file.

Arguments:

target [file! url!]

See also:

modified?   exists?  

modified?
modified?  target

Returns the last modified date of a file.

Arguments:

target [file! url!]

See also:

exists?  

suffix?
suffix?  path

Return the file suffix of a filename or url. Else, NONE.

Arguments:

path [file! url! string!]

See also:

find   split-path  

dir?
dir?  target

Returns TRUE if the file or url ends with a slash (or backslash).

Arguments:

target [file! url!]

See also:

make-dir   modified?   exists?  

split-path
split-path  target

Splits and returns directory path and file as a block.

Arguments:

target [file! url! string!]

See also:

clean-path   suffix?  

dirize
dirize  path

Returns a copy of the path turned into a directory.

Arguments:

path [file! string! url!]

to-local-file
to-local-file  path  /full

Converts a REBOL file path to the local system file path.

Arguments:

path [file! string!]

Refinements:

/full - Prepends current dir for full path (for relative paths only)

See also:

to-rebol-file  

Schemes
file
http
ftp
pop
imap
smtp
dns
Context
object
object  blk

Defines a unique object.

Arguments:

blk [block!] - Object words and values.

module
module  spec  body

Creates a module.

Arguments:

spec [block!] - Name or spec block

body [block!] - The body block of the module

import
import  module  /version  ver  /check  sum  /isolate  /only

Imports a module; locate, load, make, and setup its bindings.

Arguments:

module [word! file! url! module! block!]

Refinements:

/version

ver [tuple!] - Module must be this version or greater

/check

sum [binary!] - Module checksum as (checksum/secure of mold/flat)

/isolate - Force module to create and use its own non-shared global namespace

/only - Load and return module, but don't export to system

See also:

do   load  

construct
construct  block  /with  object  /only

Creates an object with scant (safe) evaluation.

Arguments:

block [block! string! binary!] - Specification

Refinements:

/with - Default object

object [object!]

/only - Values are kept as-is

See also:

make   context  

bind
bind  words  context  /copy  /only  /new  /set

Binds words to the specified context. (Modifies)

Arguments:

words [block! any-word!] - A block of words or single word (returned)

context [any-word! any-object!] - A reference to the target context

Refinements:

/copy - Deep copy block before binding it

/only - Bind only first block (not deep)

/new - Add to context any new words found

/set - Add to context any new set-words found

See also:

bind?   use   do   func   function   does   make   import  

get
get  word  /any

Gets the value of a word, path, or values of an object.

Arguments:

word - Word, path, object to get

Refinements:

/any - Allows word to have no value (be unset)

See also:

set   value?   in  

set
set  word  value  /any  /pad

Sets a word, path, block of words, or object to specified value(s).

Arguments:

word [any-word! any-path! block! object!] - Word, block of words, path, or object to be set

value [any-type!] - Value or block of values

Refinements:

/any - Allows setting words to any value, including unset

/pad - For objects, if block is too short, remaining words are set to NONE

See also:

get   in   value?   unset   protect   unprotect  

in
in  object  word

Returns the word or block in the object's context.

Arguments:

object [any-object! block!]

word [any-word! block! paren!]

See also:

set   get  

value?
value?  value

Returns TRUE if the word has been set.

Arguments:

value

See also:

default   unset?   equal?   strict-equal?   same?  

use
use  vars  body

Defines words local to a block.

Arguments:

vars [block! word!] - Local word(s) to the block

body [block!] - Block to evaluate

See also:

function!   object!  

Other
now
now  /year  /month  /day  /time  /zone  /date  /weekday  /yearday  /precise  /utc

Returns local date and time.

Refinements:

/year - Returns year only

/month - Returns month only

/day - Returns day of the month only

/time - Returns time only

/zone - Returns time zone offset from UCT (GMT) only

/date - Returns date only

/weekday - Returns day of the week as integer (Monday is day 1)

/yearday - Returns day of the year (Julian)

/precise - Higher precision

/utc - Universal time (no zone)

See also:

date?  

parse
parse  input  rules  /all  /case

Parses a string or block series according to grammar rules.

Arguments:

input [series!] - Input series to parse

rules [block! string! char! none!] - Rules to parse by (none = ",;")

Refinements:

/all - For simple rules (not blocks) parse all chars including whitespace

/case - Uses case-sensitive comparison

See also:

trim  

secure
secure  policy

Set security policies (use SECURE help for more information).

Arguments:

policy [word! lit-word! block! unset!] - Set single or multiple policies (or HELP)

See also:

protect   load   import  

wait
wait  value  /all

Waits for a duration, port, or both.

Arguments:

value [number! time! port! block! none!]

Refinements:

/all - Returns all in a block

See also:

time!   date!  

browse
browse  url

Open web browser to a URL or local file.

Arguments:

url [url! file! none!]

compress
compress  data

Compresses a string series and returns it.

Arguments:

data [binary! string!] - If string, it will be UTF8 encoded

See also:

decompress  

decompress
decompress  data  /limit  size

Decompresses data. Result is binary.

Arguments:

data [binary!] - Data to decompress

Refinements:

/limit

size - Limit the result to this maximum size

See also:

compress   enbase   debase  

lowercase
lowercase  string  /part  length

Converts string of characters to lowercase. (Modifies)

Arguments:

string [any-string! char!]

Refinements:

/part - Limits to a given length or position

length [number! any-string!]

See also:

uppercase   trim  

uppercase
uppercase  string  /part  length

Converts string of characters to uppercase. (Modifies)

Arguments:

string [any-string! char!]

Refinements:

/part - Limits to a given length or position

length [number! any-string!]

See also:

lowercase   trim  

entab
entab  string  /size  number

Converts spaces in a string to tabs (default tab size 4). (Modifies)

Arguments:

string [any-string!]

Refinements:

/size - Specifies the number of spaces per tab

number [integer!]

See also:

detab  

detab
detab  string  /size  number

Converts tabs in a string to spaces (default tab size 4). (Modifies)

Arguments:

string [any-string!]

Refinements:

/size - Specifies the number of spaces per tab

number [integer!]

See also:

entab  

GUI/Graphics
view
unview
layout
alert
request
request-file
request-file  /save  /multi  /file  name  /title  text  /filter  list

Asks user to select a file and returns full file path (or block of paths).

Refinements:

/save - File save mode

/multi - Allows multiple file selection, returned as a block

/file

name [file!] - Default file name or directory

/title

text [string!] - Window title

/filter

list [block!] - Block of filters (filter-name filter)

See also:

request   to-local-file   to-rebol-file  

draw
show
get-face
set-face
focus