[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Kawa-commonlisp-dev] tagbodies
From: |
Charles Turner |
Subject: |
[Kawa-commonlisp-dev] tagbodies |
Date: |
Thu, 26 Jul 2012 15:30:21 +0100 |
Most other Lisps use tag bodies quite heavily in some of the system
functions, SBCL has this in its parse-body routine:
(tagbody
:again
(if forms
(let ((form1 (first forms)))
;; Note: The (IF (IF ..) ..) stuff is because we don't
;; have the macro AND yet.:-|
(if (doc-string-p form1 (rest forms))
(setq doc form1)
(if (declaration-p form1)
(setq reversed-decls
(cons form1 reversed-decls))
(go :done)))
(setq forms (rest forms))
(go :again)))
:done)
(values forms
(nreverse reversed-decls)
doc))))
I'm sure there's a way to reformulate this without the goto's, maybe
something like
(let ((end-test nil))
(do ((form-iter forms (cdr form-iter)))
(end-test (values forms (reverse reversed-decls) doc))
(if form-iter
(let ((form1 (car form-iter)))
(if (doc-string-p form1 (cdr form-iter))
(setq doc form1)
(if (declaration-p form1)
(setq reversed-decls
(cons form1 reversed-decls))
(setq end-test t)))))))
(haven't tested that)
but I'm wondering if these sorts of kludges are worth it? How hard
would it be to implement TAGBODY? Seems like I could just use BlockExp
to do it. Implementations also use MACROLET quite a bit too, but I'm
not sure how to approach that. There's also docstrings..!
Frankly, I'm loosing my way a bit here in terms of what my goals
should be, I'm spending a lot of time on just trying to port code from
SBCL, and I don't feel like I'm making good progress.
DESTRUCTURING-BIND was the goal, but I've pushed several things on my
todo stack before that can be implemented. Apologies for
disorientation! I'm still struggling with the whole "what should I
implement to the spec, what should I skim over to fix later".
Charles.
- [Kawa-commonlisp-dev] tagbodies,
Charles Turner <=
- Re: [Kawa-commonlisp-dev] tagbodies, Helmut Eller, 2012/07/26
- Re: [Kawa-commonlisp-dev] tagbodies, Jamison Hope, 2012/07/26
- Re: [Kawa-commonlisp-dev] tagbodies, Charles Turner, 2012/07/27
- Re: [Kawa-commonlisp-dev] tagbodies, Charles Turner, 2012/07/27
- Re: [Kawa-commonlisp-dev] tagbodies, Charles Turner, 2012/07/27
- Re: [Kawa-commonlisp-dev] tagbodies, Jamison Hope, 2012/07/27
- Re: [Kawa-commonlisp-dev] tagbodies, Charles Turner, 2012/07/27
Re: [Kawa-commonlisp-dev] tagbodies, Charles Turner, 2012/07/27