lfe_cl(3)
π NAME π
okay bestie, meet lfe_cl β section 3 of the manual, aka the LFE Common Lisp interface library β¨. Itβs the little bridge where LFE gets a whole set of Common Lisp functions and macros, and weβre gonna walk the entire export list together, no skips π
.
β¨ SYNOPSIS β¨
This module provides a set of Common Lisp functions and macros for use in LFE. The definitions closely follow the CL definitions and wonβt be documented here. So yes, bestie, we are not re-documenting every CL classic on this page π.
π DATA TYPES π
The boolean values used here are the standard LFE true and false and NOT the Common Lisp values. Periodt. π
π¦ EXPORTS π¦
Hereβs the full roster, exactly as listed β every single one, no vibe-based omissions πΈ.
πΈ Boolean conversion functions
make-lfe-bool cl-valuemake-cl-bool lfe-bool
π« Control structures
do vars (end-test result) bodyβ[macro]. The value ofbodyis bound to the variabledo-state, which can be used when updatingvarsand in theend-test. This is the only way to get a value out of the body. πmapcar function listmaplist function listmapc function listmapl function list
π§ Symbol functions
symbol-plist symbolsymbol-name symbolget symbol pnameget symbol pname defaultgetl symbol pname-listputprop symbol value pnameremprop symbol pname
Atoms (symbols) in LFE donβt have property lists associated with them. However, here we have experimented with having a global ETS table lfe-symbol-plist which associates an atom with a property list. This is very unLFEy, but quite fun. πβ¨
π Property list functions
getf plist pnamegetf plist pname defaultputf plist value pnameremf plist pnameget-properties plist pname-list
The function putf/3 does not exist in Common Lisp but is included to complete the operations on property lists. iykyk π
π Simple sequence functions
elt index sequencelength sequencereverse sequence
π₯ Concatenation, mapping and reducing functions
some predicate sequenceevery predicate sequencenotany predicate sequencenotevery predicate sequencereduce function sequencereduce function sequence βinitial-value xreduce function sequence βfrom-end βtruereduce function sequence βinitial-value x βfrom-end βtrue
π Modifying sequences
remove item sequenceremove-if predicate sequenceremove-if-not predicate sequenceremove-duplicates sequencesubstitute new old sequencesubstitute-if predicate sequencesubstitute-if-not predicate sequence
π Searching sequences
find item sequencefind-if predicate sequencefind-if-not predicate sequencefind-duplicates sequenceposition item sequenceposition-if predicate sequenceposition-if-not predicate sequenceposition-duplicates sequencecount item sequencecount-if predicate sequencecount-if-not predicate sequence
π§ Lists
car listfirst listcdr listrest listnth index listnthcdr index listlast listbutlast list
β¨ Substitution of expressions
subst new old treesubst-if new test treesubst-if-not new test treesublis alist tree
π Lists as sets
member item listmember-if predicate listmember-if-not predicate listadjoin item listunion list listintersection list listset-difference list listset-exclusive-or list listsubsetp list list
π Association list functions
acons key data alistpairlis list listpairlis list list alistassoc key alistassoc-if predicate alostassoc-if-not predicate alostrassoc key alistrassoc-if predicate alostrassoc-if-not predicate alost
π¦ Types
type-of objectcoerce object type
πΈ Type testing macros
Thereβs an include file you may want to use in your LFE programs: (include-lib "lfe/include/cl.lfe"). Currently this offers Common Lisp predicates, but may include other useful macros and functions in the future. The provided predicate macros wrap the various is_* Erlang functions; since these are expanded at compile time, they are usable in guards. It includes the following:
alivep xatomp xbinaryp xbitstringp xboolp xbooleanp xbuiltinp xfloatp xfuncp xfunctionp xintp x and integerp xlistp xmapp xnumberp xpidp xprocess-alive-p xrecordp x tagrecordp x tag sizerefp xreferencep xtuplep x
π AUTHORS π
Robert Virding. π
Thatβs the whole page, bestie β the 2017 edition of lfe_cl(3), signing off with maximum sparkle π«Άβ¨
π¦ where this page comes from
- alpine 3.24: lfe-doc 2.2.0-r2 Β· Apache-2.0
- nixos 26.05: erlang27.3.4.19-lfe 2.2.0
- nixpkgs unstable: erlang27.3.4.19-lfe 2.2.2
- nixpkgs unstable: erlang28.5.0.8-lfe 2.2.2
- nixpkgs unstable: erlang29.1.2-lfe 2.2.2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms