Re: Woohoo! My macros are now (semi) hygienic



On Feb 25, 4:05 pm, Maciej Katafiasz <mathr...@xxxxxxxxx> wrote:
Den Mon, 25 Feb 2008 15:17:43 -0800 skrev Kaz Kylheku:

Suppose foo has a member x that you access in the DO block, and bar
doesn't have any member called x. So in that lexical scope, the name x
refers to foo.x. Suppose that someone now edits the type definition of
bar_record such that it acquires a member called x. Now when you
recompile the WITH statement above, the expression x suddenly refers to
bar.x! If bar.x is suitably typed, there will be no compiler error.
Unintentional shadowing of a local variable can also take place: bad
hygiene.

And that is different from (use-package :foo) how?

It's different in that USE-PACKAGE is required to detect conflicts,
which you have to explicitly deal with using SHADOW (resolve in favor
of local package) or UNINTERN (resolve in favor of library being
used).

But USE-PACKAGE (and the :USE interface of DEFPACKAGE) are
nevertheless blunt instruments.

What Ron is saying is that maintaining export lists by hand is some
kind of bug in packages that lexicons will fix for you. That's the
only the case if you are using both systems in a certain way.

If you care about precisely what is accessible where, you have to
maintain lists, no matter what namespace system you are using.

In the case of packages, you'd be maintaining import lists rather than
export lists. I.e. lists of symbols which are arguments to :IMPORT-
FROM or :SHADOWING-IMPORT-FROM in a DEFPACKAGE. (Since you can import
symbols which are not exported, exporting is somewhat immaterial,
except to the extent that it documents what is intended to be public
and affects whether you can use a single colon in qualified names).

.



Relevant Pages

  • Re: Woohoo! My macros are now (semi) hygienic
    ... bar_record such that it acquires a member called x. ... the expression x suddenly refers to ... The problem is that conflict-detection system for packages produces ... lexicons don't currently warn when existing bindings get shadowed ...
    (comp.lang.lisp)
  • brad does the neener neener gambit
    ... a faculty member of the College System in Minnesota. ... He made up some lies that he had some reason ... And it was ALWAYS with the strong support of hundreds of other list members. ... ever got any support from other members of lists. ...
    (sci.psychology.psychotherapy)
  • Re: why cl packages are hard to use ?
    ... somebody who teaches lisp and his/her ... Packages operate at read-time, ... The solution is: don't manage exported lists. ... But exported symbols are not just documentary. ...
    (comp.lang.lisp)
  • Re: Distribution List Resolution with new Contact List
    ... ..AddMember method, and you double-click that member, it doesn't open their ... Outlook version number. ... Distribution Lists if you use existing Outlook functionality. ...
    (microsoft.public.outlook.program_vba)
  • Re: help on EZScriptomatic mod
    ... > If strmanagedBy "" Then ... > For Each Item in strmember ... but it pulls the group members and reports>> the member DN to the file.) ... >>>I was trying to just get a list of users for some the groups, since there>>>are bunch of groups with hundreds of users I was using EZADScriptomatic>>>but for the members properties page it lists all of the info the member>>>users, I just wanted to get the name of the users and that's it. ...
    (microsoft.public.windows.server.active_directory)