Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
slots, get, packages, macro
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
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
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
 
Raphael.Maree.  
View profile  
 More options Mar 24 2000, 3:00 am
Newsgroups: comp.lang.lisp
From: "Raphael.Maree." <Raphae...@nospams.net>
Date: 2000/03/24
Subject: [Q] slots, get, packages, macro
Hello,

My slots defined in the user package can be read with
(get 'age 'source)
Important note: age and source are unbound.

I would like to read these slots from
a function in the foo package.
(get user:'age user:'source) and user:(get 'age 'source) work,
but the first name (here: age) is not always the same,
it's read in a list of string in the foo package.

For example, in the foo package i have the list ("age") and i would
like that myfunction access slots defined in the user package.
So, what i want is something like that:
(defun myfunction (name)
   (mymacro name source)
)
and (myfunction "age") should return the slots value.

Is it possible ?
Thanks.
--


 
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 Mar 24 2000, 3:00 am
Newsgroups: comp.lang.lisp
From: Barry Margolin <bar...@bbnplanet.com>
Date: 2000/03/24
Subject: Re: [Q] slots, get, packages, macro
In article <38DBF243.63B...@nospams.net>,

Raphael.Maree. <Raphae...@nospams.net> wrote:
>Hello,

>My slots defined in the user package can be read with
>(get 'age 'source)
>Important note: age and source are unbound.

>I would like to read these slots from
>a function in the foo package.
>(get user:'age user:'source) and user:(get 'age 'source) work,
>but the first name (here: age) is not always the same,
>it's read in a list of string in the foo package.

The correct syntax is (get 'user:age 'user:source).  The colons are part of
the syntax for entering symbols.

>For example, in the foo package i have the list ("age") and i would
>like that myfunction access slots defined in the user package.
>So, what i want is something like that:
>(defun myfunction (name)
>   (mymacro name source)
>)
>and (myfunction "age") should return the slots value.

(defun myfunction (name)
  (get (intern name 'user) 'source))

Note that the proper way to call this would be (myfunction "AGE"), since
symbol names are normally uppercased by the reader.

--
Barry Margolin, bar...@bbnplanet.com
GTE Internetworking, Powered by BBN, Burlington, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.


 
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
« Back to Discussions « Newer topic     Older topic »