[iterate-devel] towards cl:locally support in Iterate

Hoehle, Joerg-Cyril Joerg-Cyril.Hoehle at t-systems.com
Mon Nov 15 15:50:23 UTC 2004


Hi,

J.amsterdam wrote:
;;; - Consider allowing (locally...).  The semantics would be quite
;;;   odd, however.

I have some code for locally, but there's one thing open:

A) Should the forms therein be considered top-level or not w.r.t. Iterate?
ANSI-CL processes locally at top-level, in a possibly non-null lexical environment...
That's ANSI, but here we care about Iterate: shall it accept clauses like
(FOR ...) which are otherwise limited to Iterate's top-level?

My implementation is currently as follows: locally is walked with declarations therein ignored. Sorry, that's already too vague...

What do you think?

(iterate
  (repeat 10)
  (locally
    (declare whatever)
    (for i in '(1 2 3))
    (declare (fixnum i))))
B1) allow top-level clause or not?
B2) if allowed: recognize/create global fixnum declaration or not?
    not how (declare fixnum) is not at the right place for locally, but at a typical place of iterate clauses.

Sorry, maybe this is too confusing. Maybe I should just go ahead and implement something, and you tell me if you're happy. The issue is somewhat similar to macrolet and lexical scoping: there could be cases where the code is incorrect, yet Iterate could still be useful -- "good enough for daily use". Possible incorrectness is not quite the environment that I appreciate, but...

BTW, I'd appreciate if somebody could come up with an example of a non-top-level clause endangered by use of locally.
I'm looking for something different from the trivial (declare special) corruption.

C) Would you mind if B2) differed from
(iterate
  (repeat 10)
  (locally
    (declare whatever)
    (declare (fixnum i))
    (for i in '(1 2 3))))
or would you take this to conclude
C2) that every declaration information from within locally shall be thrown away, not just the first ones?
C3) Top-level inside locally is bad anyway?

Regards,
	Jörg Höhle.




More information about the iterate-devel mailing list