[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

DO-SYMBOLS



    Date: Wed, 3 Jun 87 16:29 EDT
    From: Guy Steele <gls@Think.COM>

    So suppose each of two packages uses the other,
    and each happens to export the same symbol?

    (SETQ A (MAKE-PACKAGE 'A))
    (SETQ B (MAKE-PACKAGE 'B))
    (EXPORT (INTERN "ASYM" A) A)
    (USE-PACKAGE A B)
    (EXPORT 'B:ASYM B)
    (USE-PACKAGE B A)
    (DO-ALL-SYMBOLS (X B) (PRINT X))  ;will this print ASYM once, twice,
				      ; an infinite number of times, or what?

DO-SYMBOLS:ALLOWED proposes to allow it to print ASYM once or twice, the
way I read it.  I don't see how it could print it an infinite number of
times.  (package-use-list (find-package 'a)) has no effect on
(package-external-symbols (find-package 'a)), hence should have no effect
on (do-symbols (x b) ...).  Or are you saying that the specification
should be loosened up to the point where do-symbols is allowed to
recurse on packages used, and then only look at a subset of the symbols
in those packages?

Nit picking: I assume you meant (DO-SYMBOLS (X B) (PRINT X)) rather
than (DO-ALL-SYMBOLS (X B) (PRINT X)).  I have no idea how many times
the latter should print ASYM, before it returns the value of B, except
that it shouldn't be an infinite number.

package-external-symbols is missing from the Common Lisp language for
some unfathomable reason, but you can define it in terms of do-external-symbols.

The example didn't run until I changed B:ASYM to B::ASYM.

End of nit picking: Does this mean the DO-SYMBOLS issue file needs to be
beefed up to discuss these issues, or are you and I just rambling while
waiting for our Thinking Machines (TM) central nervous system prosthetics
to be installed?