Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Importing into KEYWORD.
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  Messages 26 - 41 of 41 - Collapse all  -  Translate all to Translated (View all originals) < Older 
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
RG  
View profile  
 More options Apr 5 2012, 1:47 am
Newsgroups: comp.lang.lisp
From: RG <rNOSPA...@flownet.com>
Date: Wed, 04 Apr 2012 22:47:28 -0700
Local: Thurs, Apr 5 2012 1:47 am
Subject: Re: Importing into KEYWORD.
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?

rg


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tim Bradshaw  
View profile  
 More options Apr 5 2012, 4:55 am
Newsgroups: comp.lang.lisp
From: Tim Bradshaw <t...@tfeb.org>
Date: Thu, 5 Apr 2012 09:55:17 +0100
Local: Thurs, Apr 5 2012 4:55 am
Subject: Re: Importing into KEYWORD.
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

> 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:

(defun intern-into-keyword-perversely (name)
  (let ((s (make-symbol name)))
    (import s (find-package "KEYWORD"))
    s))

) 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.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
RG  
View profile  
 More options Apr 5 2012, 9:54 am
Newsgroups: comp.lang.lisp
From: RG <rNOSPA...@flownet.com>
Date: Thu, 05 Apr 2012 06:54:12 -0700
Local: Thurs, Apr 5 2012 9:54 am
Subject: Re: Importing into KEYWORD.
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:

> (defun intern-into-keyword-perversely (name)
>   (let ((s (make-symbol name)))
>     (import s (find-package "KEYWORD"))
>     s))

This reminds me of the old "Doctor, it hurts when I do this" joke.  
Don't do that.  Just use intern.  It already does the Right Thing.

rg


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tim Bradshaw  
View profile  
 More options Apr 5 2012, 10:33 am
Newsgroups: comp.lang.lisp
From: Tim Bradshaw <t...@tfeb.org>
Date: Thu, 5 Apr 2012 15:33:03 +0100
Local: Thurs, Apr 5 2012 10:33 am
Subject: Re: Importing into KEYWORD.
On 2012-04-05 14:54:12 +0100, RG said:

> uh?  That always returns T.

Does it now?

(constantp 'xyzt)
(import 'xyzt "KEYWORD")
(export 'xyzt "KEYWORD")

And now what's the answer?  I have no idea: I don't think it's
specified and I don't think it should be specified.

> This reminds me of the old "Doctor, it hurts when I do this" joke.
> Don't do that.  Just use intern.  It already does the Right Thing.

As I've said more times than I can count in this thread already.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
RG  
View profile  
 More options Apr 5 2012, 10:52 am
Newsgroups: comp.lang.lisp
From: RG <rNOSPA...@flownet.com>
Date: Thu, 05 Apr 2012 07:52:35 -0700
Local: Thurs, Apr 5 2012 10:52 am
Subject: Re: Importing into KEYWORD.
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

rg


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Pascal J. Bourguignon  
View profile  
 More options Apr 5 2012, 11:04 am
Newsgroups: comp.lang.lisp
From: "Pascal J. Bourguignon" <p...@informatimago.com>
Date: Thu, 05 Apr 2012 17:04:19 +0200
Local: Thurs, Apr 5 2012 11:04 am
Subject: Re: Importing into KEYWORD.

RG <rNOSPA...@flownet.com> writes:
> On which note, why in the world would you want to import something into
> keyword anyway?

I could imagine a hypothetical situation where you want to substitute a
keyword for another:

    (let ((key (make-symbol "DO-SOMETHING")))
      (setf (symbol-value key) :do-something-else)
      (import key :keyword)
      (export key :keyword)) ; to be nice, but it's not needed ;-)

    (ql:quickload :some-library-using-\:do-something)

--
__Pascal Bourguignon__                     http://www.informatimago.com/
A bad day in () is better than a good day in {}.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Pascal J. Bourguignon  
View profile  
 More options Apr 5 2012, 11:09 am
Newsgroups: comp.lang.lisp
From: "Pascal J. Bourguignon" <p...@informatimago.com>
Date: Thu, 05 Apr 2012 17:09:45 +0200
Local: Thurs, Apr 5 2012 11:09 am
Subject: Re: Importing into KEYWORD.

The point is that importing a symbol into KEYWORD doesn't make it a
KEYWORDP.

(keywordp x) = (eq (symbol-package x) (find-package :keyword))

IMPORT doesn't say what happens if the imported symbol already has a
home package, only what happens if it doesn't have one:

clhs import:

    If any symbol to be imported has no home package (i.e.,
    (symbol-package symbol) => nil), import sets the home package of the
    symbol to package.

But it seems obvious the meaning is that the home package is not changed
when it is present.

--
__Pascal Bourguignon__                     http://www.informatimago.com/
A bad day in () is better than a good day in {}.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tim Bradshaw  
View profile  
 More options Apr 5 2012, 11:10 am
Newsgroups: comp.lang.lisp
From: Tim Bradshaw <t...@tfeb.org>
Date: Thu, 5 Apr 2012 16:10:33 +0100
Local: Thurs, Apr 5 2012 11:10 am
Subject: Re: Importing into KEYWORD.
On 2012-04-05 15:52:35 +0100, RG said:

>  Constant variables, such as keywords

keyword n. 1. a symbol the home package of which is the KEYWORD package

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Barry Margolin  
View profile  
 More options Apr 5 2012, 11:11 am
Newsgroups: comp.lang.lisp
From: Barry Margolin <bar...@alum.mit.edu>
Date: Thu, 05 Apr 2012 11:11:35 -0400
Local: Thurs, Apr 5 2012 11:11 am
Subject: Re: Importing into KEYWORD.
In article <87r4w2i5jg....@kuiper.lan.informatimago.com>,
 "Pascal J. Bourguignon" <p...@informatimago.com> wrote:

> RG <rNOSPA...@flownet.com> writes:

> > On which note, why in the world would you want to import something into
> > keyword anyway?

> I could imagine a hypothetical situation where you want to substitute a
> keyword for another:

>     (let ((key (make-symbol "DO-SOMETHING")))
>       (setf (symbol-value key) :do-something-else)
>       (import key :keyword)
>       (export key :keyword)) ; to be nice, but it's not needed ;-)

>     (ql:quickload :some-library-using-\:do-something)

May I throw up now?

--
Barry Margolin, bar...@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
RG  
View profile  
 More options Apr 5 2012, 12:11 pm
Newsgroups: comp.lang.lisp
From: RG <rNOSPA...@flownet.com>
Date: Thu, 05 Apr 2012 09:11:55 -0700
Local: Thurs, Apr 5 2012 12:11 pm
Subject: Re: Importing into KEYWORD.
In article <87mx6qi5ae....@kuiper.lan.informatimago.com>,
 "Pascal J. Bourguignon" <p...@informatimago.com> wrote:

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 just got my Lisp to do this:

? (keywordp :xyzq)
NIL
? (eq (intern "XYZQ" :cl-user) :xyzq)
T

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.

rg


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tim Bradshaw  
View profile  
 More options Apr 5 2012, 1:01 pm
Newsgroups: comp.lang.lisp
From: Tim Bradshaw <t...@tfeb.org>
Date: Thu, 5 Apr 2012 18:01:08 +0100
Local: Thurs, Apr 5 2012 1:01 pm
Subject: Re: Importing into KEYWORD.
On 2012-04-05 17:11:55 +0100, RG said:

> 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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Pascal J. Bourguignon  
View profile  
 More options Apr 5 2012, 1:58 pm
Newsgroups: comp.lang.lisp
From: "Pascal J. Bourguignon" <p...@informatimago.com>
Date: Thu, 05 Apr 2012 19:58:55 +0200
Local: Thurs, Apr 5 2012 1:58 pm
Subject: Re: Importing into KEYWORD.

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.

> I just got my Lisp to do this:

> ? (keywordp :xyzq)
> NIL
> ? (eq (intern "XYZQ" :cl-user) :xyzq)
> T

> 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.

As we should.
--
__Pascal Bourguignon__                     http://www.informatimago.com/
A bad day in () is better than a good day in {}.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tim Bradshaw  
View profile  
 More options Apr 5 2012, 3:29 pm
Newsgroups: comp.lang.lisp
From: Tim Bradshaw <t...@tfeb.org>
Date: Thu, 5 Apr 2012 19:29:09 +0000 (UTC)
Local: Thurs, Apr 5 2012 3:29 pm
Subject: Re: Importing into KEYWORD.
"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.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Pascal J. Bourguignon  
View profile  
 More options Apr 5 2012, 3:40 pm
Newsgroups: comp.lang.lisp
From: "Pascal J. Bourguignon" <p...@informatimago.com>
Date: Thu, 05 Apr 2012 21:40:40 +0200
Local: Thurs, Apr 5 2012 3:40 pm
Subject: Re: Importing into KEYWORD.

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.

--
__Pascal Bourguignon__                     http://www.informatimago.com/
A bad day in () is better than a good day in {}.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Leandro Rios  
View profile  
 More options Apr 5 2012, 7:44 pm
Newsgroups: comp.lang.lisp
From: Leandro Rios <leandroprograma...@gmail.com>
Date: Thu, 05 Apr 2012 20:44:17 -0300
Local: Thurs, Apr 5 2012 7:44 pm
Subject: Re: Importing into KEYWORD.
El 04/04/12 14:11, WJ escribió:

> Worshippers of CL (COBOL-Like) are nothing but bureaucrats and
> language-lawyers.  They are certainly not programmers.

Yes, of course, we're Vogons. Resistance is useless. Don't panic.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tim Bradshaw  
View profile  
 More options Apr 6 2012, 5:10 am
Newsgroups: comp.lang.lisp
From: Tim Bradshaw <t...@tfeb.org>
Date: Fri, 6 Apr 2012 10:10:51 +0100
Local: Fri, Apr 6 2012 5:10 am
Subject: Re: Importing into KEYWORD.
On 2012-04-06 00:44:17 +0100, Leandro Rios said:

> Don't panic.

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

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages < Older 
« Back to Discussions « Newer topic     Older topic »