Newsgroups: comp.lang.lisp
Path: cantaloupe.srv.cs.cmu.edu!rochester!cornellcs!travelers.mail.cornell.edu!news.kei.com!newshost.marcam.com!usc!math.ohio-state.edu!howland.reston.ans.net!EU.net!sun4nl!aie.nl!news
From: geert@sparc.aie.nl (Geert-Jan van Opdorp)
Subject: Re: help! getting a functions symbol from within itself?
Sender: news@aie.nl (Usenet News)
Message-ID: <GEERT.95Oct10141805@sparc.aie.nl>
In-Reply-To: sjros2@penfold.cc.monash.edu.au's message of 8 Oct 1995 17:23:17 GMT
Date: Tue, 10 Oct 1995 13:18:05 GMT
Lines: 29
X-Nntp-Posting-Host: sparc.aie.nl
References: <4591e5$7qt@harbinger.cc.monash.edu.au>
Organization: AI Engineering BV, Amsterdam, Netherlands

In article <4591e5$7qt@harbinger.cc.monash.edu.au> sjros2@penfold.cc.monash.edu.au (Mr SJ Rosin) writes:


> Howdy,
> 
> I am a bit of a newcomer to lisp (not too new) and I have a VERY specific need-
> 
> 	I am writing a Genetic Alg. where functions are created and assigned
> names by the system (using gensym) thus my code does not know what its 
> name is when it is called - why is this a problem? Because the function 
> is given several properties (and I want to give it more!) so I need to 
> know how to get the name of the current function from within itself ie. 
> I want to get a property from the currently executing function, without 
> declaring variables to store the function as a symbol 
> ....PLEASE SEND HELP SOON!

What about creating a hash-table with the function as a key
and the propertylist as value? You don't even need gensym then.

Check out the hash-table functions if you use Common Lisp



Geert-Jan
-- 
Geert-Jan van Opdorp
AI-Engineering
Amsterdam, The Netherlands
geert@aie.nl
