Page 1 of 1

collect clause in progn in loop facility

PostPosted: Sun Sep 22, 2013 3:28 am
by jiyoo
Suppose I have a loop form (using the loop facility) and within it is a do clause, and within the do clause is a let form, and somewhere deep within the let form are two collect clauses (like COLLECT .. INTO ..), except it's not a legal syntax to put collect clauses or any clauses in those positions. What are my options in this case?

If it were just one collect clause, I could instead put the entire let form inside a collect clause. Things seem tricky when there are two collect clauses.

I could turn the two collect clauses into two push forms but then I would be sort of reinventing the loop facility's collect feature.

Re: collect clause in progn in loop facility

PostPosted: Mon Sep 23, 2013 10:37 am
by nuntius
CL's LOOP can be a useful tool, but it is not fully general purpose. Many language purists find it to be an abomination. Many pragmatists find it to be beautiful despite its rough spots.

Recommendation: Value results over style. Only worry about style when bugs keep cropping up in the same section of ugly code. Then refactor that code, remembering to value results over style.

:-)

Re: collect clause in progn in loop facility

PostPosted: Mon Sep 23, 2013 12:26 pm
by Goheeca
It's better to specify a particular snippet why do you need have collects in a let form than just saying. In this case I can only link you to loop that it has also intial and final clauses which with collect might be used in your issue.