Re: Sharp with exports in defpackage??



josephoswaldgg@xxxxxxxxxxx <josephoswald@xxxxxxxxx> wrote:
+---------------
| Jonathon McKitrick wrote:
| > Is there an advantage in using # with exports in defpackage? ...
|
| More precisely, #:name symbols do not get interned by the reader into
| any package. :name symbols also can be used reliably, but get interned
| by the reader into the keyword package. "NAME'" strings do not get
| interned into any package, either, but require one to strike the caps
| lock key twice, or remember the upcase keystroke in your editor...
+---------------

Another reason to use symbols [whether uninterned or keyword]
instead of "NAME" strings is to avoid problems when the user
is running with a non-standard READTABLE-CASE mode. When symbols
such as #:name are typed in in lowercase, they'll "do the right
thing" regardless of whether (READTABLE-CASE *READTABLE) is the
CLHS default :UPCASE or the increasingly-popular-when-doing-FFI
:INVERT mode. Whereas "NAME" breaks in the latter case...


-Rob

-----
Rob Warnock <rpw3@xxxxxxxx>
627 26th Avenue <URL:http://rpw3.org/>
San Mateo, CA 94403 (650)572-2607

.



Relevant Pages

  • Re: CRIT: Proposed opening of WIP
    ... some people might get that upon reading about the window. ... lady in the nursing home battling the dragon who set the fire!. ... OP for the reader to not be sure which old woman is which -- whether the ... who gave her the package or the one she's taking the package to? ...
    (rec.arts.sf.composition)
  • Re: Sandboxing user code?
    ... So you need to define your own reader, ... Once you've prevented the user to get out of the given package, ... okp; the parsed lisp object if okp, or an error message if ... ((rom (&body body) ...
    (comp.lang.lisp)
  • Re: SymClashesHowToGetRid-Part-2 (Pascal, I seemed to fix a bug in your reader, take a look)
    ... reader instead of a standard reader. ... Hope I'll get time to change ccl lisp reader (which is under ... I found that no change in package system would help to make ... I still think see-packages is a great thing, ...
    (comp.lang.lisp)
  • Re: packages revisited
    ... you want to add to the general CL reader. ... I see no reason for not doing that. ... it in every package we are "in". ... If there is no such symbol, it is interned to:a-package ...
    (comp.lang.lisp)
  • Re: CRIT: Proposed opening of WIP
    ... I don't equate fiction with either kind; some fiction is clear and smooth, ... lose some readers to confusion, but YM obviously is better in this case. ... Trying to be clever can lose me the reader. ... who gave her the package or the one she's taking the package to? ...
    (rec.arts.sf.composition)