lfe_cl(3)

πŸ“¦ version 2.2.0, in alpine 3.24, nixos 26.05, nixpkgs unstable

πŸ’– 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-value
  • make-cl-bool lfe-bool

πŸ’« Control structures

  • do vars (end-test result) body β€” [macro]. The value of body is bound to the variable do-state, which can be used when updating vars and in the end-test. This is the only way to get a value out of the body. πŸ‘‘
  • mapcar function list
  • maplist function list
  • mapc function list
  • mapl function list

🧚 Symbol functions

  • symbol-plist symbol
  • symbol-name symbol
  • get symbol pname
  • get symbol pname default
  • getl symbol pname-list
  • putprop symbol value pname
  • remprop 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 pname
  • getf plist pname default
  • putf plist value pname
  • remf plist pname
  • get-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 sequence
  • length sequence
  • reverse sequence

πŸ”₯ Concatenation, mapping and reducing functions

  • some predicate sequence
  • every predicate sequence
  • notany predicate sequence
  • notevery predicate sequence
  • reduce function sequence
  • reduce function sequence ’initial-value x
  • reduce function sequence ’from-end ’true
  • reduce function sequence ’initial-value x ’from-end ’true

πŸ’œ Modifying sequences

  • remove item sequence
  • remove-if predicate sequence
  • remove-if-not predicate sequence
  • remove-duplicates sequence
  • substitute new old sequence
  • substitute-if predicate sequence
  • substitute-if-not predicate sequence

πŸ‘‘ Searching sequences

  • find item sequence
  • find-if predicate sequence
  • find-if-not predicate sequence
  • find-duplicates sequence
  • position item sequence
  • position-if predicate sequence
  • position-if-not predicate sequence
  • position-duplicates sequence
  • count item sequence
  • count-if predicate sequence
  • count-if-not predicate sequence

🧚 Lists

  • car list
  • first list
  • cdr list
  • rest list
  • nth index list
  • nthcdr index list
  • last list
  • butlast list

✨ Substitution of expressions

  • subst new old tree
  • subst-if new test tree
  • subst-if-not new test tree
  • sublis alist tree

πŸŽ€ Lists as sets

  • member item list
  • member-if predicate list
  • member-if-not predicate list
  • adjoin item list
  • union list list
  • intersection list list
  • set-difference list list
  • set-exclusive-or list list
  • subsetp list list

πŸ’… Association list functions

  • acons key data alist
  • pairlis list list
  • pairlis list list alist
  • assoc key alist
  • assoc-if predicate alost
  • assoc-if-not predicate alost
  • rassoc key alist
  • rassoc-if predicate alost
  • rassoc-if-not predicate alost

πŸ¦‹ Types

  • type-of object
  • coerce 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 x
  • atomp x
  • binaryp x
  • bitstringp x
  • boolp x
  • booleanp x
  • builtinp x
  • floatp x
  • funcp x
  • functionp x
  • intp x and integerp x
  • listp x
  • mapp x
  • numberp x
  • pidp x
  • process-alive-p x
  • recordp x tag
  • recordp x tag size
  • refp x
  • referencep x
  • tuplep 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