Skip to content
Viral B. Shah edited this page Aug 6, 2011 · 1 revision

NOTE: These are all presented in the form of abstract syntax.

Table of Contents

Builtin forms

Control flow

(if a b c)
(_while a b)  # primitive while with no break/continue
(block ...)
(and ...)
(or ...)
(return x)
(try body catch)
(break-block name body)
(break name)  # leave closest break-block with the given name

Syntax

(quote expr)
(unquote expr)
(splice expr)

Types

(typedef type-signature fields...)
(typealias name type)
(type typename type-parameters...)  # look up names in type namespace, instantiate templates
(assert-type type expr)

Lambda

(lambda args body)
(local x)  # add local variable
(scope-block body)  # renaming operator to create separate name regions
(parameters ...)  # occurs inside argument lists to mark expressions after ;
(... x)  # rest argument
(call f args...)

Assignment

(= symbol rhs)

Object model

(new type args...)
(tuple ...)   # calls builtin tuple
(list ...)    # calls builtin list
(keyword key value)
(cat ...)     # array constructor. should be implemented by transformations that insert appropriate
              # type conversions and calls to array functions, because writing all the cases as
              # generic function methods is too inconvenient.

Modules (eventually)

(module name body)
(:: module name)

Builtin functions

Load and store operations

getfield, setfield, bufferref, bufferset, tupleref, tuplelen

Booleans

not

Object model

typeof, is, addmethod, apply, tuple, list, istype

Scalar functions

+  -  *  /  idiv  ^  <  ==  !=  isnan  isinf  abs  sign
~  &  |  $  shl  shr

Scalar conversions

cast, boolean, int8, uint8, int16, uint16, int32, uint32, int64, uint64, float, double, size