[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Defining functions on the fly
From: |
Michael Heerdegen |
Subject: |
Re: Defining functions on the fly |
Date: |
Mon, 15 Jun 2015 13:19:18 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
Tassilo Horn <tsdh@gnu.org> writes:
> > (defvar pfxd "pfxd-")
> >
> > (defun (intern (concat pfxd "-foo")) ())
> >
> > -->
> >
> > Debugger entered--Lisp error: (wrong-type-argument symbolp (intern
> > (concat pfxd
> > "-foo")))
> > defalias((intern (concat pfxd "-foo")) (lambda nil nil))
>
> This might depend on emacs version. At least with the current git
> version, `defalias' evaluates its first argument:
>
> (defalias (intern "foo-bar") #'forward-sexp) ;; Works fine
In the example above, in the expansion of the `defun' call the first
argument to defalias is the (unevaluated!) list:
(intern (concat pfxd "-foo"))
The corresponding call to defalias will also fail on trunk.
Michael.
- Defining functions on the fly, Andreas Röhler, 2015/06/15
- Re: Defining functions on the fly, Dmitry Gutov, 2015/06/15
- Re: Defining functions on the fly, Alexis, 2015/06/15
- Re: Defining functions on the fly, Andreas Röhler, 2015/06/15
- Re: Defining functions on the fly, Alexis, 2015/06/15
- Re: Defining functions on the fly, Michael Heerdegen, 2015/06/15
- Re: Defining functions on the fly, Tassilo Horn, 2015/06/15
- Re: Defining functions on the fly, Alexis, 2015/06/15
- Re: Defining functions on the fly,
Michael Heerdegen <=
- Re: Defining functions on the fly, Tassilo Horn, 2015/06/15
- Re: Defining functions on the fly, Michael Heerdegen, 2015/06/15
Re: Defining functions on the fly, Tassilo Horn, 2015/06/15
Message not available
- Re: Defining functions on the fly, Stefan Monnier, 2015/06/15
- Re: Defining functions on the fly, Andreas Röhler, 2015/06/16
- Re: Defining functions on the fly, Tassilo Horn, 2015/06/16
- Re: Defining functions on the fly, Andreas Röhler, 2015/06/16
- Re: Defining functions on the fly, Tassilo Horn, 2015/06/16
- Re: Defining functions on the fly, Andreas Röhler, 2015/06/16