Attila Lendvai writes:
this entire stuff is probably a few minutes for you probably :)
Never. I'm used to double check the code, double-check the macro output (with and without multiple uses etc.). And I did not mention the need to add testcases, nor update the TeX documentation... Nor use of RCS/darcs/you-name-it. OTOH, answering e-mails always seems to take little time and little care :-)
I think a first-iteration-p would be more useful then an entire if-... construct. Same for first-time-p
Indeed. You're completely right. Thanks for opening my eyes! A single predicate integrates even better with the rest of CL (which is one of Iterate's points over LOOP) than another custom IF*.
BTW, what's the iteration pattern that lead you to ...
Some other question comes to mind: does the need justify a new construct, or are the present ones "good enough"? I.e. if-first-iteration (non-sharing) could also be done using (for first-iteration initially t then nil)
Of course, that would not share variables, but in DSL terms, it looks like a growth of non-orthogonal features, with slight variations between each (e.g. yours shares variables, if-first-time allows non-top-level use, if initially then is not as efficient (who cares?) etc.)
(finally (return `(progn ,@it)))
Why not just `(progn .,(iter #)) ; read . , if you prefer -- it's not ,. or `(progn ,@(iter #)) since the "final" clause it never conditional?
Regards, Jörg Höhle.
Some other question comes to mind: does the need justify a new construct, or are the present ones "good enough"? I.e. if-first-iteration (non-sharing) could also be done using (for first-iteration initially t then nil)
Well, to be honest i didn't know about the possibility of the above expression. I think it may even invalidate first-iteration-p... but still i think you need it often enough that having some frequently used constructs out of the box may be worth it.
Of course, that would not share variables, but in DSL terms, it looks like a growth of non-orthogonal features, with slight variations between each (e.g. yours shares variables, if-first-time allows non-top-level use, if initially then is not as efficient (who cares?) etc.)
Well, technically your above initially-then solution is the same as first-iteration-p would be, it just needs an extra line of user code. But on the other hand you are right: if we add first-iteration-p, then why don't we add x, y, and z...
My take is: if a feature makes the user code smaller and is obvious enough then i think it's worth adding it, even if it's not orthogonal. But if it needs a long documentation about possible interferences/etc then it's not worh adding it.
(finally (return `(progn ,@it)))
Why not just `(progn .,(iter #)) ; read . , if you prefer -- it's not ,. or `(progn ,@(iter #)) since the "final" clause it never conditional?
I couldn't make them work, so i assume these are alternative syntax ideas, but then I prefer "it"... (please note the quotes :)
thanks for the ideas,
- attila
hi!
i've implemented another version of first-iteration-p and first-time-p as discussed. please find a patch attached with some tests, it's relative to the 1.4 release.
am i right when i assume there's no source control for iterate currently and the arch/tla source tree (at iterate-devel@common-lisp.net--2004/iterate--main--1.4) i was working from is obsolete? seems like that from the info pieces and the sources...
(iter (for ...) (if (first-iteration-p) ...))
hope you like it,
- attila
Hello,
On 1/13/06, Attila Lendvai attila.lendvai@gmail.com wrote:
am i right when i assume there's no source control for iterate currently and the arch/tla source tree (at iterate-devel@common-lisp.net--2004/iterate--main--1.4) i was working from is obsolete? seems like that from the info pieces and the sources...
This seem to be the case, this and the lack of a version bump in the 'newest' tar.gz's asd file makes life difficult for this debian maintainer.
Groetjes, Peter
-- signature -at- pvaneynd.mailworks.org http://www.livejournal.com/users/pvaneynd/ "God, root, what is difference?" Pitr | "God is more forgiving." Dave Aronson|