Explang/lisp Built-in Functions by Package
base.math base.text io ffi base.bindings base.funcs runtime threads loops base.version base.coercion base.logic base.lang base.arithmetics base.seq base.control base.regex dwim base.docs user base.types
base.math
EXP
Perform exponentiation.
(EXP x &OPTIONAL base)
If base is not given it returns e raised to power x. Returns a Double value.
builtin function in package base.math defined at class io.opsit.explang.Funcs$EXP
LOG
Computes logarithm.
(LOG x &OPTIONAL base)
If base is not given it computes natural logarithm. Returns a Double value.
builtin function in package base.math defined at class io.opsit.explang.Funcs$LOG
RANDOM
Produce Pseudo-Random Number.
(RANDOM limit)
Returns a pseudo-random number that is a non-negative number less than limit and of the same numeric type as limit. Implemented uding Java Math.random()
builtin function in package base.math defined at class io.opsit.explang.Funcs$RANDOM
SQRT
Computes square root of the argument.
(SQRT x)
Returns double value.
builtin function in package base.math defined at class io.opsit.explang.Funcs$SQRT
base.text
FORMAT
Format String.
(FORMAT format &REST values)
Returns a formatted string using the specified format string (in the format of java.util.Formatter) and arguments. Arguments referenced by the format specifiers in the format string. If there are more arguments than format specifiers, the extra arguments are ignored. Throws IllegalFormatException - If a format string contains an illegal syntax, a format specifier that is incompatible with the given arguments, insufficient arguments given the format string, or other illegal conditions.
builtin function in package base.text defined at class io.opsit.explang.Funcs$FORMAT
LOWERCASE
(LOWERCASE value)
Convert character, string or character sequence to lower case.
builtin function in package base.text defined at class io.opsit.explang.Funcs$LOWERCASE
STR
Concatenate Strings.
(STR &REST values)
Returns concatenation of string representationx of the function arguments. NIL arguments are ignored.
builtin function in package base.text defined at class io.opsit.explang.Funcs$STR
STRING-BUFFER
Create and initialize a StringBuffer object.
(STRING-BUFFER &REST args)
Return stringbuilder with all the arguments concatenated.
builtin function in package base.text defined at class io.opsit.explang.Funcs$STRINGBUFFER
STRING-BUILDER
Create and initialize a StringBuilder object.
(STRING-BUILDER &REST args)
Return stringbuilder with all the arguments concatenated.
builtin function in package base.text defined at class io.opsit.explang.Funcs$STRINGBUILDER
UPPERCASE
(UPPERCASE value)
Convert character, string or character sequence to upper case.
builtin function in package base.text defined at class io.opsit.explang.Funcs$UPPERCASE
io
LOAD
Execute program from a file/stream.
(LOAD file-spec)
Sequentially executes each form it encounters in the input file/or stream named by resource-spec. Returns exception if input could not be read or there were exceptions while compiling or executing forms an exception will be raised. file-spec may be a java.io.File object, file path as String or opened InputStream.
builtin function in package io defined at class io.opsit.explang.Funcs$LOAD
LOADR
Execute program from Java resource.
(LOADR resource-spec)
Sequentially executes each form it encounters in the java resource file named by resource-spec. Returns exception if file could not be read or there were exceptions while compiling or executing forms an exception will be raised.
builtin function in package io defined at class io.opsit.explang.Funcs$LOADR
PRINT
(PRINT &REST args)
Print Arguments on standard output.
builtin function in package io defined at class io.opsit.explang.Funcs$PRINT
PRINTLN
(PRINTLN &REST args)
Print Arguments on standard output and print newline.
builtin function in package io defined at class io.opsit.explang.Funcs$PRINTLN
READ-FROM-STRING
Parse expression from string.
(READ-FROM-STRING string)
Reads expression from string using default parser. Returns expression or NIL if no expression has been read
builtin function in package io defined at class io.opsit.explang.Funcs$READ_FROM_STRING
ffi
.
Call Java Object Method/Read FieldCall method of java object or read contend of object field.
(. object &REST call-args)
builtin function in package ffi defined at class io.opsit.explang.Funcs$DOT
.N
Return New Class Instance.
(.N class &OPTIONAL arglist typeslist)
Optional arglist and typeslist parameters specify parameters to be passed to cosnstructor and their types. When typelist not given it tries to find most narrowly matching constructor on the basis of types of the arguments in arglist. If typeslist is provided exactly matching constructor will be used.
builtin function in package ffi defined at class io.opsit.explang.Funcs$DOTN
.S
Call Static Java Method/Read Static FieldCall method of java object or read contend of object field.
(.S class &REST call-args)
builtin function in package ffi defined at class io.opsit.explang.Funcs$DOTS
CLASS
Return Class by Class Name.Return class object according to it's fully qualified class name.
(CLASS class-spec)
class-spec may be string, symbol or any object,which string representation will be used
builtin function in package ffi defined at class io.opsit.explang.Funcs$CLASS
base.bindings
BEAN
Convert Java Bean to a Map.
(BEAN object &OPTIONAL prefix suffix)
Returns a Map based on getters in the passed java object. Accepts optional prefix and suffics arguments that are used to modify the generated keys.
builtin function in package base.bindings defined at class io.opsit.explang.Funcs$BEAN
BOUNDP
Check if Symbols are Bound.
(BOUNDP &REST symbols)
Returns True if all the arguments are bound symbols or names of bound symbols; otherwise, returns False.
builtin function in package base.bindings defined at class io.opsit.explang.Funcs$BOUNDP
DLET
(DLET args ...)
Destructuring LET construct.
builtin form in package base.bindings defined at class io.opsit.explang.Compiler$DLET
FSET
(FSET symbol value)
Set symbol's function value to value and return previous value or NIL.
builtin function in package base.bindings defined at class io.opsit.explang.Funcs$FSET
FUNCTION
(FUNCTION symbol)
Get Function Given it's symbol.
builtin form in package base.bindings defined at class io.opsit.explang.Compiler$FUNCTION
GETPROP
Get Variable Property.
(GETPROP symbol property-key)
Returns value of a property from variable property map
builtin function in package base.bindings defined at class io.opsit.explang.Funcs$GETPROP
GETPROPS
(GETPROPS symbol)
Get Properties Map for a Variable.
builtin function in package base.bindings defined at class io.opsit.explang.Funcs$GETPROPS
LET
Evaluate code with given var.
(LET args ...)
bindings.
builtin form in package base.bindings defined at class io.opsit.explang.Compiler$LET
MAKUNBOUND
Unbind variable given by symbol.
(MAKUNBOUND symbol)
Always returns symbol.
builtin function in package base.bindings defined at class io.opsit.explang.Funcs$MAKUNBOUND
NEW-CTX
(NEW-CTX )
Create New Empty Context
builtin function in package base.bindings defined at class io.opsit.explang.Funcs$NEW_CTX
SET
Change variable value in specified context.
(SET symbol value &KEY uplevel level)
Set changes the contents of variable symbol in the dynamic context to the given value. If uplevel is set the value will be set in the uplevel-ths previous context. If level is set the value will be changed in the level-th context from the level0
builtin function in package base.bindings defined at class io.opsit.explang.Funcs$SET
SETF
(SETF args ...)
Set value of a variable o location (place in a list , array, etc.) to value.
builtin form in package base.bindings defined at class io.opsit.explang.Compiler$SETF
SETL
Assign values to local variables.
(SETL &REST args)
For each pair of arguments 'var', 'expr' in
the list of arguments {'var' 'expr'}* it will evaluate the 'expr' and assign the
result to local variable 'var'. If the variable already exists in the local scope
its value will be replaced. And if not, a new binding will be created in the local
scope, possibly shadowing the variable in upper scopes.
Arguments:
'var' - a symbol naming a variable.
'expr' - an expression to be evaluated, the result will be assigned to 'var'.
Returns:
value of the last 'expr', or NIL if no pairs were supplied.
builtin form in package base.bindings defined at class io.opsit.explang.Compiler$SETL
SETPROP
Set variable property.
(SETPROP symbol property-key property-value)
Sets property value in variable property map
builtin function in package base.bindings defined at class io.opsit.explang.Funcs$SETPROP
SETPROPS
(SETPROPS symbol properties-map)
Set Properties Map for a Variable
builtin function in package base.bindings defined at class io.opsit.explang.Funcs$SETPROPS
SETQ
Assign values to variables, create new global one if the binding does not exist.
(SETQ &REST args)
For each pair of arguments it will evaluate the 'form' and assign the result to
variable 'var' if it already exists, possibly replacing the existing binding.
If not, new binding will be created in the global scope
Arguments:
'var' - a symbol naming a variable.
'form' - an expression to be evaluated, the result will be assigned to 'var'.
Returns:
value of the last form, or nil if no pairs were supplied.
builtin form in package base.bindings defined at class io.opsit.explang.Compiler$SETQ
SETV
Assign values to variables, create new local one if the binding does not exist.
(SETV &REST args)
For each pair of arguments it will evaluate the 'form' and assign the result to
variable 'var' if it already exists, possibly replacing values that exist in the
local or an upper scope. If not, new binding will be created in the local scope
Arguments:
'var' - a symbol naming a variable.
'form' - an expression to be evaluated, the result will be assigned to 'var'.
Returns:
value of the last form, or nil if no pairs were supplied.
builtin form in package base.bindings defined at class io.opsit.explang.Compiler$SETV
SYMBOL
(SYMBOL symbol-name)
Makes new Symbol for a string
builtin function in package base.bindings defined at class io.opsit.explang.Funcs$SYMBOL
WITH-BINDINGS
(WITH-BINDINGS args ...)
Evaluate code with bindings from a Java Map.
builtin form in package base.bindings defined at class io.opsit.explang.Compiler$WITH_BINDINGS
WITH-CTX
(WITH-CTX args ...)
Evaluate code in given context.
builtin form in package base.bindings defined at class io.opsit.explang.Compiler$WITH_CTX
base.funcs
APPLY
Call function f
with arguments
expanding the last one.
(APPLY f &REST arguments)
`apply` calls function `f` with given arguments. If the last of the arguments
is a list, its contents will be appended to the list of arguments of `f`.
builtin function in package base.funcs defined at class io.opsit.explang.Funcs$APPLY
BACKTRACE
Return callstack backtrace.
(BACKTRACE &OPTIONAL vars)
Returns string representation of current stack frame.If vars is a sequence print bindings that are contained in a sequence.If vars is not a sequence print all bindings only if vars boolean value is true.
builtin function in package base.funcs defined at class io.opsit.explang.Funcs$BACKTRACE
DEFUN
(DEFUN name ( arglist ) body)
Define named function
builtin form in package base.funcs defined at class io.opsit.explang.Compiler$DEFUN
FUNCALL
Call function f
with arguments
.
(FUNCALL function &REST arguments)
funcall
calls function f
with given arguments.
builtin function in package base.funcs defined at class io.opsit.explang.Funcs$FUNCALL
FUNCTIONP
Check if object is a function.
(FUNCTIONP object)
Returns true if object is a function (built-in or user defined); otherwise, returns false. A function is an object that represents code to be executed when an appropriate number of arguments is supplied. A function can be directly invoked by using it as the first argument to funcall, apply.
builtin function in package base.funcs defined at class io.opsit.explang.Funcs$FUNCTIONP
SYMBOL-FUNCTION
Returns function bound to given symbol.
(SYMBOL-FUNCTION symbol)
If no function bound raises an error. The returned object may be a built-in function, compiled function or built-in special form.
builtin function in package base.funcs defined at class io.opsit.explang.Funcs$SYMBOL_FUNCTION
runtime
ARGV
Access command line arguments.
(ARGV &OPTIONAL n)
When n is provided return nth argument as String, when not -- return list of command line arguments. If n is out of range return NIL.
builtin function in package runtime defined at class io.opsit.explang.Funcs$ARGV
threads
NEW-THREAD
Create new Java thread.
(NEW-THREAD fn &OPTIONAL name)
Creates new Java thread and prepare it for execution of given function fn.fn must not require parameters for it's execution. The created thread is not started.
builtin function in package threads defined at class io.opsit.explang.Funcs$NEW_THREAD
loops
WHILE
While loop construction.
(WHILE condition &REST body)
Execute sequnce of expressions while the consition is true
builtin form in package loops defined at class io.opsit.explang.Compiler$WHILE
base.version
VERSION
Create Version from text specification.
(VERSION spec)
builtin function in package base.version defined at class io.opsit.explang.Funcs$VERSION
base.coercion
BOOL
Coerce Value to Boolean.
(BOOL value)
Value may be a Character, a Number, a Boolean, a Byte, a String, any object or NIL:
* Boolean value will be returned as is
* NIL is false
* Character is false.
* any Number which is equal to zero is false
* an empty String is false
* An empty collection is false
* Any other object is true.
builtin function in package base.coercion defined at class io.opsit.explang.Funcs$BOOL
BYTE
Coerce Value to Byte.
(BYTE value)
Value may be a Number, String, any object or NIL.String will be parsed as number using same rules as numeric literals. The floating point values will be truncated.
builtin function in package base.coercion defined at class io.opsit.explang.Funcs$BYTE
CHAR
Coerce Value to Character.
(CHAR value)
Value may be a Character, a Number, a Boolean, a Byte, a Stringor NIL:
* Character value will be returned as is.
* NIL will be converted to unicode value # .
* a Boolean True value will be returned as character 'T', False as '