In article <jligav$jq...@dont-email.me>, Tim Bradshaw <t...@tfeb.org> wrote:
> On 2012-04-04 17:28:16 +0100, RG said:
> > Note that DEFCONSTANT doesn't force the variable being defined to be a
> > constant, it just makes the consequences of changing the variable's
> > value undefined.
> What I meant specifically is that I don't think there is a documented > way of saying for a symbol x that (constantp 'x) should return true > other than defconstant, which, being a macro, is not useful in the > context of programmatically setting up a keyword symbol.
That's true, but you can always define a my-contant-p that does what you want. You can also shadow constantp if you really want to be anal about it.
What you can't do is insure that constantp or my-constant-p or anything else in Common Lisp actually has anything to do with something remaining constant in the face of perverse circumstances.
On which note, why in the world would you want to import something into keyword anyway?
> That's true, but you can always define a my-contant-p that does what you
> want. You can also shadow constantp if you really want to be anal about
> it.
Yes, but none of those make it be the case that, for instance
(loop for x being the external-symbols of (find-package "KEYWORD")
unless (constantp x)
collect x into bads
finally (return (values (null bads) bads)))
should return t, nil
> On which note, why in the world would you want to import something into
> keyword anyway?
I don't think you would (hence my "undefined behaviour" proposed gloss). What I think you would want to to is intern a string into the package (using intern, not implicitly via the reader, because, for instance, you are implementing a reader), and I think this means that intern must do the making-constantp-return-true thing itself. I think if someone decided that import *should* have defined behaviour (perhaps to support something like this:
) then import would need to be defined to do the whole make-it-constantp magic, at least in some cases. But I can not see a case where I would ever want to use import rather than intern.
In article <jljmlk$uo...@dont-email.me>, Tim Bradshaw <t...@tfeb.org> wrote:
> On 2012-04-05 06:47:28 +0100, RG said:
> > That's true, but you can always define a my-contant-p that does what you
> > want. You can also shadow constantp if you really want to be anal about
> > it.
> Yes, but none of those make it be the case that, for instance
> (loop for x being the external-symbols of (find-package "KEYWORD")
> unless (constantp x)
> collect x into bads
> finally (return (values (null bads) bads)))
> should return t, nil
Huh? That always returns T. What isn't guaranteed to return t is:
(or (not (constantp 'x))
(eq x (progn (some-arbitrary-code) x)))
> > On which note, why in the world would you want to import something into
> > keyword anyway?
> I don't think you would (hence my "undefined behaviour" proposed > gloss). What I think you would want to to is intern a string into the > package (using intern, not implicitly via the reader, because, for > instance, you are implementing a reader), and I think this means that > intern must do the making-constantp-return-true thing itself.
And it does. See CLHS 11.1.2.3.1.
> I think > if someone decided that import *should* have defined behaviour (perhaps > to support something like this:
> > In article <jlkaev$ag...@dont-email.me>, Tim Bradshaw <t...@tfeb.org> > > wrote:
> >> On 2012-04-05 14:54:12 +0100, RG said:
> >> > uh? That always returns T.
> >> Does it now?
> > In a conforming implementation, yes:
> > Function CONSTANTP
> > Description:
> > Returns true if form can be determined by the implementation to be a > > constant form ...
> > The following kinds of forms are considered constant forms:
> > ...
> > * Constant variables, such as keywords
> The point is that importing a symbol into KEYWORD doesn't make it a
> KEYWORDP.
There are certain things that, while not prohibited by the laws of physics, members of a civilized society ought to agree not to do for the sake of the common good. These include things like torturing kittens, calling forth Cthulu, and importing symbols into the keyword package.
If you choose to defect and do any of these things you're on your own.
> I will now restart my Lisp to banish this monstrosity permanently to the
> cosmic void, and spend the rest of the day repenting of my sin.
I am rather afraid it is too late for that: it is in the world now and it will not wish to go back from whence it came. I would try not to sleep if I were you and, if sleep you must, not at night. I wish I could offer some hope, but I fear there can be none.
Contradictio Salomonis cum demonio nocturno. Albericus de Mauleone delineavit. V. Deus in adiutorium. Ps. Qui habitat. Sancte Bertrande, demoniorum effugator, intercede pro me miserrimo. Primum uidi nocte 12mi Dec. 1694: uidebo mox ultimum. Peccaui et passus sum, plura adhuc passurus. Dec. 29,1701
RG <rNOSPA...@flownet.com> writes:
>> The point is that importing a symbol into KEYWORD doesn't make it a
>> KEYWORDP.
> There are certain things that, while not prohibited by the laws of > physics, members of a civilized society ought to agree not to do for the > sake of the common good. These include things like torturing kittens, > calling forth Cthulu, and importing symbols into the keyword package.
> If you choose to defect and do any of these things you're on your own.
That's not the point. ANSI-TEST should test the implementation
conformance, not whether you've modified the environment or not.
"Pascal J. Bourguignon" <p...@informatimago.com> wrote:
> That's not the point. ANSI-TEST should test the implementation
> conformance, not whether you've modified the environment or not.
An implementation can be fully conforming while having entirely undefined
behavior in some cases. You can not test for that because any result is
conforming.
Tim Bradshaw <t...@tfeb.org> writes:
> "Pascal J. Bourguignon" <p...@informatimago.com> wrote:
>> That's not the point. ANSI-TEST should test the implementation
>> conformance, not whether you've modified the environment or not.
> An implementation can be fully conforming while having entirely undefined
> behavior in some cases. You can not test for that because any result is
> conforming.
Yes, that's I think the current keyword.lsp ANSI-TESTS are wrong.
Use your wheels, it is what they are for
Do not attempt to rescue friends, relatives, loved ones.
You have only a few seconds to escape
Use those seconds sensibly or you will inevitably die
Do not panic
Think only of yourself
Think only of yourself