forked from JuliaLang/julia
-
Notifications
You must be signed in to change notification settings - Fork 0
Core forms
Viral B. Shah edited this page Aug 6, 2011
·
1 revision
NOTE: These are all presented in the form of abstract syntax.
(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
(quote expr) (unquote expr) (splice expr)
(typedef type-signature fields...) (typealias name type) (type typename type-parameters...) # look up names in type namespace, instantiate templates (assert-type type expr)
(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...)
(= symbol rhs)
(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.
(module name body) (:: module name)
getfield, setfield, bufferref, bufferset, tupleref, tuplelen
not
typeof, is, addmethod, apply, tuple, list, istype
+ - * / idiv ^ < == != isnan isinf abs sign ~ & | $ shl shr
cast, boolean, int8, uint8, int16, uint16, int32, uint32, int64, uint64, float, double, size