Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to return values from dolist, dotimes and do-symbols #389

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lisp/l/common.l
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
(while (< ,(car vars) ,endvar)
,@forms
(setq ,(car vars) (1+ ,(car vars))))
,(caddr vars))))
,@(cddr vars))))

(defmacro dolist (vars &rest forms)
(let ((lists (gensym "DOLIST")) (decl (car forms)))
Expand All @@ -163,7 +163,7 @@
(while ,lists
(setq ,(car vars) (pop ,lists))
,@forms)
,(caddr vars))))
,@(cddr vars))))

(defmacro do-symbols (vars &rest forms)
(let* ((symbols (gensym "DOSYM"))
Expand All @@ -183,7 +183,7 @@
(setq ,v (elt ,svec ,i))
(inc ,i)
(when (symbolp ,v) . ,forms))
,(caddr vars))))
,@(cddr vars))))

(defmacro do-external-symbols (vars &rest forms)
(let* ((symbols (gensym "DOEXTSYM"))
Expand All @@ -203,7 +203,7 @@
(setq ,v (elt ,svec ,i))
(inc ,i)
(when (symbolp ,v) . ,forms))
,(caddr vars))))
,@(cddr vars))))

(defmacro do-all-symbols (var &rest forms)
(let ((apackage (gensym "DOALLSYM")))
Expand Down