From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Philippe M. Coatmeur Newsgroups: gmane.emacs.help Subject: Re: Concat var names ? Date: Mon, 28 May 2012 07:39:14 +0000 Organization: A noiseless patient Spider Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Trace: dough.gmane.org 1338187828 19387 80.91.229.3 (28 May 2012 06:50:28 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 28 May 2012 06:50:28 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon May 28 08:50:27 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SYtma-0003Ri-Iu for geh-help-gnu-emacs@m.gmane.org; Mon, 28 May 2012 08:50:24 +0200 Original-Received: from localhost ([::1]:37187 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SYtma-0006vh-5y for geh-help-gnu-emacs@m.gmane.org; Mon, 28 May 2012 02:50:24 -0400 Original-Path: usenet.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.news.xs4all.nl!news2.euro.net!newsfeed.freenet.ag!newsfeed.kamp.net!newsfeed.kamp.net!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 38 Injection-Info: mx04.eternal-september.org; posting-host="HXRtxP3eotRXsoacdvcZiQ"; logging-data="4853"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+MJPUij7ekhYHOAEsLoGPRXvyp88sGSjo=" User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/24.1 Mule/6.0 (HANACHIRUSATO) In-Reply-To: Cancel-Lock: sha1:fmrEWlyTca7FiHlEwu314SHegUY= Original-Xref: usenet.stanford.edu gnu.emacs.help:192622 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:85028 Archived-At: At Mon, 28 May 2012 00:26:37 -0400, Barry Margolin wrote: > > In article , > XeCycle wrote: > > > Philippe M. Coatmeur writes: > > > > > Hi ; I have those two functions and I want to make them one : (...) > > > > > > But I have to create distinct lists, so I'd really like to be able to > > > say > > > > > > (setq suffix "plop") > > > (setq myvar-plop "value") > > > (message "%s" (concat "myvar-" suffix)) > > > > > > And get "myvar-value" instead of myvar-plop... > > > > Check what `intern' does. > > You also need to use symbol-value to get the value of the variable > instead of just its name: > > (message "%s" (symbol-value (intern (concat "myvar-" suffix")))) Guys, thank you very much, it works like a charm, and with "symbol-value" I can do pretty much whatever I want with the object returned. Phil > > -- > Barry Margolin, barmar@alum.mit.edu > Arlington, MA > *** PLEASE post questions in newsgroups, not directly to me ***