Skip to content

Instantly share code, notes, and snippets.

@hdurer
Last active November 30, 2016 20:54
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hdurer/b2850329e3d444ce2df8 to your computer and use it in GitHub Desktop.
Save hdurer/b2850329e3d444ce2df8 to your computer and use it in GitHub Desktop.
LFE predefined syntax

I tried to list all predefined syntax (what eval and codegen understand directly or what is expanded as a predefined macro).

The essential? column is obviously somewhat subjective. I am not going for minimalistic here but for non-opulent.

The comment of "dupe" is also vague. There might be differences in syntax and capabilities. All I am saying is: pick one and make that the right one.

symbol essential? comments
quote y
cons y
car y A less archaic name would have been nicer. hd?
cdr y A less archaic name would have been nicer. tl?
list y
tuple y
binary y
lambda y Of course we also have fun. We could have re-used that.
match-lambda y
let y
let-function y
letrec-function y
let-macro y
progn y
if y
case y
receive y ? has more options but why not extend this?
catch y
try y
funcall y
call y
define-function y
caar These are obviously a matter of taste. I see no need for these functions.
cadr
cdar
cddr
caaar
caadr
cadar
caddr
cdaar
cdadr
cddar
cdddr
caaaar
caaadr
caadar
caaddr
cadaar
cadadr
caddar
cadddr
cdaaar
cdaadr
cdadar
cdaddr
cddaar
cddadr
cdddar
cddddr
- y
* y
/ y
++ y
: y
? Same as receive?
list* ?
let* y
flet* y
cond y
do
lc y
list-comp Dupe of lc
bc y
binary-comp Dupe of bc
andalso y
orelse y
fun y
defrecord y
begin Dupe of progn?
define Dupe of define-function?
define-record y Dupe of defrecord?
define-syntax Dupe of let-macro?
let-syntax Dupe of let-macro?
defmodule
defun Dupe of define-function?
defmacro
defsyntax
flet Dupe of let-functon?
fletrec Dupe of letrec-function?
macrolet Dupe of let-macro?
syntaxlet Different syntax than let-macro?
prog1 ? Do people use these often enough to warrant them?
prog2 ?
match-spec y
qlc y
mref y
map-get Dupe of mref
mset y
map-set Dupe of mset
mupd y
map-update Dupe of mupd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment