From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Pascal J. Bourguignon" Newsgroups: gmane.emacs.help Subject: Re: symbols and cells Date: Thu, 15 May 2014 20:07:59 +0200 Organization: Informatimago Message-ID: <87mweioqyo.fsf@kuiper.lan.informatimago.com> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1400177726 4583 80.91.229.3 (15 May 2014 18:15:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 15 May 2014 18:15:26 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu May 15 20:15:21 2014 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 1Wl0Bc-00056f-1J for geh-help-gnu-emacs@m.gmane.org; Thu, 15 May 2014 20:15:20 +0200 Original-Received: from localhost ([::1]:59854 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wl0Bb-0005Ve-HB for geh-help-gnu-emacs@m.gmane.org; Thu, 15 May 2014 14:15:19 -0400 Original-Path: usenet.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 33 Original-X-Trace: individual.net Q7cM1s39k/5aTMK8vYW9BwRp3XTCB9lTiaEsISWz9Bw7XyDRhF Cancel-Lock: sha1:MTM5ZTdlZmVhYTA3NTk4MjRjNDUwZDcxODE5Mjk4OTJjZDQ1NzMxMQ== sha1:5Ye/2j/bmpTV3KZSUYvLwl2vY9E= Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAQMAAABtzGvEAAAABlBMVEUAAAD///+l2Z/dAAAA oElEQVR4nK3OsRHCMAwF0O8YQufUNIQRGIAja9CxSA55AxZgFO4coMgYrEDDQZWPIlNAjwq9 033pbOBPtbXuB6PKNBn5gZkhGa86Z4x2wE67O+06WxGD/HCOGR0deY3f9Ijwwt7rNGNf6Oac l/GuZTF1wFGKiYYHKSFAkjIo1b6sCYS1sVmFhhhahKQssRjRT90ITWUk6vvK3RsPGs+M1RuR mV+hO/VvFAAAAABJRU5ErkJggg== X-Accept-Language: fr, es, en User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Original-Xref: usenet.stanford.edu gnu.emacs.help:205413 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:97681 Archived-At: Christopher Howard writes: > I'm still working through the earlier parts of the Elisp > documentation, but I am curious: How does one define the variable cell > and function cell for an /uninterned/ symbol? The docs indicate you > can do this: > > (defvar sym (make-symbol "foo")) > > But how do you add a function or variable value to foo without > interning it? (require 'cl) (setf (symbol-value sym) 42 (symbol-function sym) (lambda () 33)) (eval sym) --> 42 (eval (list sym)) --> 33 > On a related note, I'm curious about this perverse construction: > > (defvar sym1 (lambda (n) (+ 1 n))) > > Is it actually possible to call the the lambda somehow? (funcall sym1 (symbol-value sym)) --> 43 -- __Pascal Bourguignon__ http://www.informatimago.com/ "Le mercure monte ? C'est le moment d'acheter !"