From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: C K Kashyap Newsgroups: gmane.emacs.help Subject: Re: emacs lisp - unable to write a function maker Date: Fri, 16 Sep 2011 15:47:19 +0530 Message-ID: References: <87pqj0q2wo.fsf@ambire.localdomain> <87iposlshu.fsf@ericabrahamsen.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=90e6ba6e8e585df8d904ad0c4c8e X-Trace: dough.gmane.org 1316168285 6861 80.91.229.12 (16 Sep 2011 10:18:05 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 16 Sep 2011 10:18:05 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Eric Abrahamsen Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Sep 16 12:17:29 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1R4VU8-0005sn-3K for geh-help-gnu-emacs@m.gmane.org; Fri, 16 Sep 2011 12:17:28 +0200 Original-Received: from localhost ([::1]:37104 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R4VU7-0002Ty-CY for geh-help-gnu-emacs@m.gmane.org; Fri, 16 Sep 2011 06:17:27 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:56705) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R4VU1-0002Ts-Pf for help-gnu-emacs@gnu.org; Fri, 16 Sep 2011 06:17:22 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R4VU0-0008H1-QY for help-gnu-emacs@gnu.org; Fri, 16 Sep 2011 06:17:21 -0400 Original-Received: from mail-gx0-f172.google.com ([209.85.161.172]:49568) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R4VU0-0008Gt-MB for help-gnu-emacs@gnu.org; Fri, 16 Sep 2011 06:17:20 -0400 Original-Received: by gxk19 with SMTP id 19so3343395gxk.31 for ; Fri, 16 Sep 2011 03:17:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=aRIio8XYVRkNRd3bVsGntR4D2hVpfBrKeWK58Q9usfA=; b=tjKNs79bsQw5vvl0awaTRFcrE/cYAg43n3RC/EesP8N4B2z6BYAbJnmgBWGYpO7LF+ Oluytn9OcsnuXgUv61/k/dEB3U8RZHP2bQ6x5Wob0TUuCILYl5Ys907D445DshRWveDP KmmilsgHW/vWJz0zaCt8d5KbCulgJBA20fOsg= Original-Received: by 10.42.161.3 with SMTP id r3mr1776011icx.186.1316168239282; Fri, 16 Sep 2011 03:17:19 -0700 (PDT) Original-Received: by 10.42.176.72 with HTTP; Fri, 16 Sep 2011 03:17:19 -0700 (PDT) In-Reply-To: <87iposlshu.fsf@ericabrahamsen.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.161.172 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:82249 Archived-At: --90e6ba6e8e585df8d904ad0c4c8e Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable > > Perhaps I'm ruining some didactic exercise here, but if you're using > eval on something you don't want eval'd until the function is run, you > should backquote it. This works for me: > > > (defun functionmaker (name form) > (eval > `(defun ,name () > ,form))) > > I used to associate backquoting exclusively with macros, but I think > that was wrong thinking. > > Hope someone will correct me if I've done something dumb here=85 > Wow .. .This worked as I was wanting ... Could you please point me to some documentation that would help me with things like, when to use "," in front of the name etc? Regards, Kashyap --90e6ba6e8e585df8d904ad0c4c8e Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: quoted-printable
Perhaps I'm = ruining some didactic exercise here, but if you're using
eval on something you don't want eval'd until the function is run, = you
should backquote it. This works for me:


(defun functionmaker (name form)
=A0(eval
=A0 `(defun ,name ()
=A0 =A0 =A0,form)))

I used to associate backquoting exclusively with macros, but I think
that was wrong thinking.

Hope someone will correct me if I've done something dumb here=85


Wow .. .This worked as I was w= anting ... Could you please point me to some documentation that would help = me with things like, when to use "," in front of the name etc?

Regards,
Kashyap=A0
--90e6ba6e8e585df8d904ad0c4c8e--