From: Douglas K. <do...@go...> - 2016-01-13 21:51:35
|
Jean-Philippe Paradis, You're my hero. This is compelling evidence in favor of half of https://bugs.launchpad.net/sbcl/+bug/922952 which I filed saying that the compiler should be free to transform (KEYWORDP :ANY-KEYWORD) into the constant T. (The negative case is not true because of point 1). On Wed, Jan 13, 2016 at 4:19 PM, Jean-Philippe Paradis <hex...@gm...> wrote: > Uninterning of keywords has undefined consequences, since: > > 1. CLHS Type KEYWORD ( > http://www.lispworks.com/documentation/HyperSpec/Body/t_kwd.htm) > specifies: > > "Interning a symbol in the KEYWORD package has three automatic effects: > [...] 2. It causes the symbol to become an external symbol of the KEYWORD > package." > > 2. CLHS Function UNINTERN ( > http://www.lispworks.com/documentation/HyperSpec/Body/f_uninte.htm) > specifies: > > "If package is the home package for symbol, symbol is made to have no home > package." > > 3. CLHS System Class SYMBOL ( > http://www.lispworks.com/documentation/HyperSpec/Body/t_symbol.htm) > specifies: > > "The consequences are undefined if an attempt is made to alter the home > package of a symbol external in the COMMON-LISP package or the KEYWORD > package." (Easily found by searching for "keyword" at > http://www.hexstreamsoft.com/articles/notes-tips-standard-common-lisp-symbols/themes/unspecified-behavior/, > btw.) > > > >> On Wed, Jan 13, 2016 at 2:26 PM, Douglas Katzman <do...@go...> >> wrote: >> >>> You could file a bug. Some folks may point out that keywordness of >>> symbols can be changed anyway and that the subtypep test is not >>> well-defined: >>> >>> * (defvar *x* :x) >>> *X* >>> * (typep *x* 'keyword) >>> T >>> * (unintern *x* 'keyword) >>> T >>> * (typep *x* 'keyword) >>> NIL >>> >> http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140 >> _______________________________________________ >> Sbcl-devel mailing list >> Sbc...@li... >> https://lists.sourceforge.net/lists/listinfo/sbcl-devel >> >> > |