Created
November 5, 2010 18:53
-
-
Save dumbs/664599 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun make-stat-env (params &optional env) | |
(append | |
(loop | |
for var in params | |
for j = 1 then (+ j 1) | |
for num-env = (if (or (eq (first env) '&optional) | |
(eq (first env) '&rest)) nil (+ (or (second (first env)) -1) 1)) | |
collect (list var num-env j) | |
) | |
env)) | |
(make-stat-env '(a b &optional c)) => ((A 0 1) (B 0 2) (&OPTIONAL 0 3) (C 0 4)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment