Skip to content

Index of functions

Claude Roux edited this page Jun 13, 2025 · 31 revisions

Functions

Here is the list of functions available in lispe:

@ : get value from a container at positions k1..kn

@@: (@@ e i1 (i2)), i2 is optional

@@@: (@@@ list shape k1...kn)

acos (val) calculates the arc cosine

acosh (val) calculates the hyperbolic arc cosine

alphap (str) Checks if the string contains only alphabetic characters

and: (and cond1 cond2 cond3)

andvalue: (andvalue cond1 cond2 value)

apply: (apply fonc a1 a2...)

asin (val) calculates the sine arc

asinh (val) calculates the hyperbolic sine arc

at: (see @)

atan (val) calculates the tangent arc

atanh (val) calculates the hyperbolic arc tangent

atomp: (atomp e)

atoms: (atoms)

atshape: (extracts values in a flat list according to a shape)

bappend: (bappend pathname list_of_shorts)

bernoulli_distribution: Bernoulli distribution

binomial_distribution: binomial distribution

block

bodies: (bodies name)

bread: (bread pathname)

bwrite: (bwrite pathname list_of_shorts)

bytes: (bytes string)

car, cdr, cadr...

catch

cauchy_distribution: Cauchy distribution

cbrt (val) calculates the cubic root

check : (check CONDITION I1..In)

chi_squared_distribution: Chi-squared distribution

chr (nb) Returns the Unicode character corresponding to the code 'nb'

chrono: creates a chrono object

clone: clone structure

command (cmd) Executes a system command and returns the result as a list

complex: complex numbers

cond: (cond (cond1 instructions)...)

cons: (cons e l)

consb: (consb l e)

consonantp (str) Checks if the string only contains consonants

consp: (consp e)

containerkeys : (containerkeys dict)

containervalues : (containervalues dict)

convert_in_base value base

cos (val) calculates the cosine

cosh (val) calculates the hyperbolic cosine

cosine (val1 val2) cosine similarity

count object sub pos

curl: Create a 'curl' object

curl_execute

curl_options

curl_passwrd

curl_proxy

curl_set_function

curl_set_headers

curl_url

cutlist list size

cyclicp: (cyclicp e)

data: (data D1 D2 ..)

date Initializes a 'date' object

day (date (d -1)) day(int d): returns the day (d = -1) or changes it

deaccentuate (str) Replaces accented letters with their non-accented form

deflib: Internal use of the interpreter

defmacro

defpat: pattern function definition

defpred: predicate pattern function definition

defprol: à la Prolog pattern function definition

defspace: defines a space

defun: Function definition

degree (val) converts from radian into degree

dethread: Launching a thread

dictionary: creates a dictionary indexes on strings

dictionaryi: creates a dictionary indexes on integers

dictionaryn: creates a dictionary indexes on numbers

dictionarytree: creates a dictionary ordered on strings

dictionarytreei: creates a dictionary ordered on integers

dictionarytreen: creates a dictionary ordered on numbers

discrete_distribution: Discrete distribution

digitp (str) Checks if the string contains only digits

droplist: (droplist condition list)

editdistance str strbis Computes the edit distance between 'str' and 'strbis'

emptyp

endwith: (endwith str fnd)

enum: (loop c (enum l) ...)

eq/neq: (eq e1 e2)

erf (val) calculates the error function

erfc (val) calculates the complementary error function

eval

evaljs (JavaScript Interpreter, only available in LispE WASM)

exp (val) returns e high to the requested power

exp2 (val) returns 2 high to the requested power

explode: (explode string)

expm1 (val) returns high e to the requested power minus 1

exponential_distribution: Exponential distribution

extract: (extract e i1 (i2)), i2 is optional

extreme_value_distribution: Extreme Value distribution

f_: same as as in Python f".."

fabs (val) calculates the absolute value of a float

fappend: (append pathname data)

fclose: (fclose fe)

fgetchars: (fgetchars fe nb)

file (path (mode (quote r))) Open a file with 'pathname' and action == 'r|'w|'a

file_close (stream) Close a file

file_eof (stream) Check if a file reached 'end of file'

file_getchar (stream) Read one UTF8 character at a time

file_getstruct (stream o c) Read an embedded structure

file_read (stream (nb -1)) Read the whole file at once or nb characters

file_readline (stream) Read one line from the file

file_readlist (stream) Read the whole file and store each line in a list

file_seek (stream nb (offset 0)) Positions the head at nb

file_tell (stream) Returns the current position in the stream

file_write (stream str) Write a string to a file

fileinfo (path) Returns information about a file

fill c nb Returns a string, which contains the string 'c' 'nb' times

filterlist: (filterlist condition list)

find : (find e o pos)

findall : (findall chaine chaine pos)

fish_distribution: Fish distribution (alpha = 1)

fisher_distribution: Fisher F-distribution

flatten: (flatten l)

flip: (flip (f x y))

float: (float e)

floats: (floats e)

floor (val) returns the nearest lower integer

fopen: (fopen pathname op)

format str e1 e2 ... e9

fputchars: (fputchars fe str)

fread: (fread pathname)

fseek: (fseek fe pos)

fsize: (fsize fe)

ftell: (ftell fe)

fwrite: (fwrite pathname data)

gamma_distribution: Gamma distribution

gcd v1 v2) Greater Common Diviso

geometric_distribution: Geometric distribution

get_tokenizer_operators (rules), "%o" is associated with a set of operators

get_tokenizer_rules (rules), returns a vector of all rules in memory

getenv (name) Retrieves the value of an environment variable

getstruct (str o c (pos)) Read an embedded structure

hcf v1 v2) Higher Common Factor

heap: (heap comparison v1 v2...)

hour (date (d -1)) hour(int d): returns the time (d = -1) or changes it

iabs (val) calculates the absolute value of an integer

if : (if (predicate) THEN ELSE)

imaginary: imaginary part of a complex number

in : (in e o pos)

input

insert : (insert l e idx)

integer : (integer e)

integers : (integers e)

isdirectory (path) checks if 'path' is a directory

join: (join l sep)

json (element) Returns the element as a JSON string

json_parse (str) Compile a JSON string

json_read (filename) Reads a JSON file

keys@: (keys@ dictionary)

label : (label lab exp)

lambda : lambda function definition

last : (last e)

left (str nb) Returns the 'n' characters on the left

let : (let ((v1 val1)..(vn valn)) i1..in)

lgamma (val) natural logarithm

link: (link str atom)

list : (list e1 e2 ..)

llist : (llist e1 e2 ..)

lloop (x1 x2 x3...) l1 l2 l3... instructions)

load : (load filename (namespace))

loadcode : (loadcode string (namespace))

lock : mutex

log (val) calculates the natural logarithm (in base e)

log10 (val) calculates the logarithmic decimal (base 10)

log1p (val) natural logarithm in base e

log2 (val) calculates the binary logarithm

logb (val) extracts the exponent of a number

lognormal_distribution: Lognormal distribution

loop : (loop var liste instruction1 instruction2...)

loopcount: (loopcount nb instructions)

lower (str) puts in lower case

lowerp (str) Checks if the string is only lowercase

ls (path) returns the contents of a directory

mapcar : (mapcar function list)

maplist : (maplist function list)

mark: (mark l B) marks lists for controlling infinite loops

mask : (mask Bools LTRUE LFALSE)

max : (max a1 a2 a3) / (max '(e1 e2 e3))

maybe: (maybe c)

middle (str pos nb) Returns the 'n' characters from the 'p' position

min : (min a1 a2 a3) / (min '(e1 e2 e3))

minmax : (minmax a1 a2 a3) / (minmax '(e1 e2 e3))

minute (date (d -1)) minute(int d): returns the minute (d = -1) or changes it

mloop : (mloop (x1 x2 x3...) c1 c2 c3... instructions)

month (date (d -1)) month(int d): returns the month (d = -1) or modifies it

ncheck: (ncheck CONDITION ELSE I1 I2..)

nconc: (nconc l1 l2...)

nconcn: (nconcn l1 l2...)

nearbyint (val) returns the nearest integer using the current rounding method

negative_binomial_distribution: Negative binomial distribution

ngrams (str nb)) Builds a lists of ngrams of size n

normal_distribution: Normal distribution

not : (not e)

nth : (nth l i)

nullp : check if the argument is nil

number : (number e)

numberp : check if the argument is a number

numbers : (numbers e)

ontology (name) Creates an ontology

ontology_absurd (h) Returns the '_absurd' concept for this ontology

ontology_absurdp (conc) Checks if the concept is '_absurd'

ontology_add (conc a) Enriches the concept definition in the ontology with the other concept

ontology_all (h) Returns the list of all concepts

ontology_concept (h name) Returns the concept associated with this name

ontology_contain (large_conc conc) Check if large_conc contains conc

ontology_create (h name (conc)) Creates a new concept definition with a name. The concept description can also be provided

ontology_find (h conc) Checks if a concept list has a name in the ontology

ontology_intersect (conc a) Checks if two concepts have concepts in common

ontology_list (conc) Returns the list of concepts stored in concepts

ontology_ontology (conc) Returns the ontology in which this concept is declared

ontology_remove (conc a) Removes a concept from another concept definition in the ontology

or : or Boolean

ord (str) Returns the Unicode codes of each character of 'str'

over: (over 'function lst)

padding str c nb Pads the string str with c string up to nb characters

piecewise_constant_distribution: Piecewise constant distribution

piecewise_linear_distribution: Piecewise linear distribution

pipe : (pipe)

poisson_distribution: Poisson distribution

pop : (pop e cle)

popfirst : (popfirst e)

poplast : (poplast e)

prettify : (prettify l)

prgx (exp (str)) Creates a posix regular expression from a string

prgx_find (exp str (pos 0)) Searches in 'str' for the sub-string that matches the posix regular expression from 'pos'.

prgx_find_i (exp str (pos 0)) Returns the positions in 'str' of the sub-string that matches the regular expression from 'pos'

prgx_findall (exp str (pos 0)) Searches in 'str' all the sub-strings that matches the posix regular expression

prgx_findall_i (exp str (pos 0)) Returns the positions in 'str' of all the sub-strings that matches the regular expression.

prgx_match (exp str) Checks that 'str' matches the posix regular expression

prgx_replace (exp str rep) Replaces 'str' by 'rep' via a posix regular expression

prgx_split (exp str) Split 'str' via a posix regular expression

print : (print e1 e2 .. en)

printerr : (printerr e1 e2 .. en)

printerrln : (printerrln e1 e2 .. en)

println : (println e1 e2 .. en)

punctuationp (str) Checks if the string contains only punctuation

push : (push l a)

pushfirst : (pushfirst l a)

pushlast : (pushlast l a)

pushtrue : (pushtrue l a)

quote : (quote arg)

radian (val) converts from degree into radian

random (nb) returns a random value between 0 and nb

random_choice (nb list initial) returns a list of nb random values among the elements in 'list', and (initial/size list) > 1

range : (range initial limit step)

rangein : (rangein initial limit step)

real: real part of a complex number

realpath (path) Returns the full path corresponding to a partial path

replace (str fnd rep (index)) Replaces all sub-strings from index (default value is 0

replaceall : (replaceall object search replace)

resetmark: resets marks for controlling infinite loops

return : (return a)

reverse : (reverse l local)

rfind : (find chaine subch)

rgx (exp (str)) Create a regular expression from a string

rgx_find (exp str (pos 0)) Searches in 'str' the sub-string that matches the regular expression from 'pos'

rgx_find_i (exp str (pos 0)) Returns the positions in 'str' of the sub-string that matches the regular expression from 'pos'

rgx_findall (exp str (pos 0)) Searches in 'str' all the sub-strings that matches the regular expression.

rgx_findall_i (exp str (pos 0)) Returns the positions in 'str' of all the sub-strings that matches the regular expression.

rgx_match (exp str) Checks that 'str' matches the regular expression

rgx_replace (exp str rep) Replaces 'str' by 'rep' via a regular expression

rgx_split (exp str) Split 'str' via a regular expression

right (str nb) Returns the last 'n' characters on the right

rint (val) returns the closest integer using the current rounding method with exception if the result is different

rotate : (rotate x nb)

round (val) returns the nearest integer, following the rounding rules

scanlist : (scanlist action let)

second (date (d -1)) second(int d): returns the second (d = -1) or modifies it

segment (str (point) Splits the string into a list of tokens

segment_e (str (point) same as 'segment' but keeps the blanks

segmenter (keepblanks point), returns the segmenter which is used in instruction segment

select: (select c1 c2 c3)

self : (self e1 e2..)

set: set, sets, seti, setn

set@ : modify container at positions k1...kn

set@@ : same as setrange

set@@@ : same as setshape

set_tokenizer_operators (rules a_set), modify the set of operators with which "%o" is associated

set_tokenizer_rules (rules lst), change the rules in memory to a new ensemble. Rules are then recompiled on the fly

setdate(y,m,d,H,M,S): Creates a date

setenv (name value) Creates or modifies an environment variable

setg : (setg label valeur)

seth : (seth label value)

setq : (setq label value)

setrange : modify container between position b e

setshape : (setshape container shape k1...kn value)

shift: (shift op lst (nb))

short: (short e)

shorts: (shorts e)

shuffle (list) randomly mixes items in a list

sign : (sign e)

signp : (signp e)

sin (val) calculates the sinus

sinh (val) calculates the hyperbolic sinus

size : (size e)

sleep: (sleep tm)

slice list size

socket_blocking

socket_close

socket_connect (hostname port) connect to the server

socket_create (port nblients (hostname)) create a server

socket_get (sock (socketClientId -1)) get one character from a socket

socket_gethostname (sock) return the current host name

socket_getpeername (sock socketClientId) return the current peer name

socket_port (sock) return the current port number

socket_read (sock (socketClientId -1)) read a string on a socket

socket_receive (sock nb (socketClientId -1)) read a string on a socket in a raw environment

socket_send (sock str (socketClientId -1)) write the string s on the socket

socket_settimeout (sock tm) Set a time out of 't' seconds on the socket

socket_wait (sock) wait for a client to connect and returns its socket id

socket_write (sock str (socketClientId -1)) write the string s on the socket

sort : (sort a list)

space : (call functions defined in a space)

split (str fnd) Splits the string into sub-strings according to a given string

splite (str fnd) Same as split but keeps the empty strings

sqlite_begin (sqlitev mode) enters commit mode

sqlite_close (sqlitev) close a database

sqlite_commit (sqlitev) Processing SQL commands

sqlite_create (sqlitev table (() args)) create a table

sqlite_execute (sqlitev command) execute a raw sql command

sqlite_insert (sqlitev table (() columns)) insert a line in a table

sqlite_open (sqlitev dbname) open a database

sqlite_process (sqlitev command) process a sql command in a 'loop'

sqlite_run (sqlitev command) execute a sql command

sqrt (val) calculates the square root

startwith: (startwith str fnd)

string : (string e)

stringp : (stringp e)

strings : (strings e)

student_distribution: Student T-Distribution

swap : (swap l p1 (p2))

switch

takelist: (takelist condition list)

takenb: (takenb nb lst)

tally: (tally m)

tan (val) calculates the tangent

tanh (val) calculates the hyperbolic tangent

tgamma (val) calculates the gamma function

threadclear : clear protected list for threads

threadretrieve : protected list for threads

threadspace : (threadspace...)

threadstore : (threadstore namespace e)

to_list: (to_list object)

to_llist: (to_llist object)

to_tensor: (to_tensor object)

tokenize (rules str (types)), tokenize a string using a specific tokenizer, can also returns the type of each element

tokenizer (), returns a copy of the main tokenizer

tokenizer_display (rules), display the rules as indented automata

tokenizer_main (), returns the main tokenizer of LispE, which used to tokenize LispE code

trace : (trace bool)

transducer ((filename)) create a transducer object

transducer_add: add a dictionary to the automaton

transducer_build: Build a transducer file out of a text file

transducer_compilergx: Compile a regular expression

transducer_factorize (trans) factorize the arcs and states of the automaton.

transducer_flags () Display the edit distance flags

transducer_load (trans filename) Load a transducer

transducer_lookdown: lookdow for the surface form

transducer_lookup: lookup for a word with a threshold and flags

transducer_parse: parse a sentence based on lexicon content

transducer_store: store an automaton

tree: (tree k v k v kv)

treei: (treei k v k v kv)

treen: (treen k v k v kv)

trigger: (trigger key)

trim (str) Cuts all 'space' characters

trim0 (str) remove '0' at the end of the string

trimleft (str) Trim all 'space' characters to the left

trimright (str) Cuts all 'space' characters to the right

trunc (val) returns the nearest integer whose absolute value is lower

type : (type e)

uniform_distribution: Uniform discrete distribution

unique: (unique lst)

upper (str) is capitalized

upperp (str) Checks if the string is only capitalized

use : (use bib)

uuid : Universally Unique Identifier

values@: (values@ dictionary)

vowelp (str) Checks if the string only contains vowels

wait : wait for threads to end

waiton: (waiton key)

weekday (date) weekday(): returns the day of the week

weibull_distribution: weibull distribution

while : (while (condition) instruction1 instruction2 ...)

whilein : (whilein var lst condition instruction1 instruction2 ...)

xml_child (node) Return the first child node

xml_content (node) Return the node content

xml_line (node) Return the node line number

xml_load (pathname) Load an XML document

xml_name (node) Return the node name

xml_namespace (node) Return the node name space

xml_next (node) Return the next node

xml_nodeid (node) Return the node internal id

xml_parent (node) Return the parent node

xml_parse (buffer) Load an XML document

xml_previous (node) Return the previous node

xml_properties (node) Return the node properties

xml_root (doc) Return the root node of the document

xml_setnodeid (node id) Set an internal numerical value to the current xml node

xml_type (node) Return the node type

xor : Exclusive Boolean or

year (date (d -1)) year(int d): returns the year (d = -1) or modifies it

yearday (date) yearday(): returns the number of the day in the year

zerop : returns true if value is zero

Haskell Functions

Composition

map : (map op list)

filter : (filter condition list)

drop : (drop nb list)

dropwhile : (dropwhile condition list)

take : (take nb list)

replicate : (replicate nb value)

repeat : (repeat nb)

cycle : (cycle list)

takewhile : (takewhile condition liste)

irange: (irange initial increment)

foldl : (foldl op list initial)

foldl1 : (foldl1 op list)

foldr : (foldr op list initial)

foldr1 : (foldr1 op list)

scanl : (scanl op liste initial)

scanl1 : (scanl1 op list)

scanr : (scanr op list initial)

scanr1 : (scanr1 op list)

zip : (zip l1 l2 l3...)

zipwith : (zipwith op l1 l2 l3...)

APL Functions

backreduce

backscan

concatenate

determinant of a matrix

inner product

invert/solve

iota

irank: (irank m D1 D2...)

ludcmp

lubksb

member

outer product

rank: (rank m D1 D2...)

reduce: (reduce op lst)

rho

scan: (scan op lst)

transpose: (transpose m)

Description of these operators in APL

Clone this wiki locally