Skip to content

Instantly share code, notes, and snippets.

@southly
Created November 26, 2010 11:34
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 southly/716591 to your computer and use it in GitHub Desktop.
Save southly/716591 to your computer and use it in GitHub Desktop.
fix flet, labels, macrolet. #xyzzy
diff --git a/src/cons.h b/src/cons.h
index 82961bd..aeb9c86 100644
--- a/src/cons.h
+++ b/src/cons.h
@@ -10,6 +10,7 @@ public:
};
# define consp(X) typep ((X), Tcons)
+# define listp(X) ((X) == Qnil || consp (X))
inline void
check_cons (lisp x)
diff --git a/src/eval.cc b/src/eval.cc
index 2cc5fb4..6d5d1d3 100644
--- a/src/eval.cc
+++ b/src/eval.cc
@@ -1295,7 +1295,7 @@ Fsi_set_function_name (lisp closure, lisp name)
static lisp
flet (lisp arg, lex_env &olex, lex_env &nlex, int macrop)
{
- if (!consp (arg) || !consp (xcar (arg)) || !consp (xcdr (arg)))
+ if (!consp (arg) || !listp (xcar (arg)) || !listp (xcdr (arg)))
FEtoo_few_arguments ();
lisp ofns = nlex.lex_fns;
for (lisp defs = xcar (arg); consp (defs); defs = xcdr (defs))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment