[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:31:11 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
Tassilo Horn <tsdh@gnu.org> writes:
> Ah, yes, so that's basically as if
>
> (defalias '(intern (concat pfxd "-foo")) ...)
>
> had been written.
Yip: (macroexpand '(defun (concat "current-prefix-" foo) ())) ==>
(defalias
'(concat "current-prefix-" foo)
#'(lambda nil nil))
The "problem" is that the defun macro (intentionally) adds a quote, so
that
(defun name ..)
expands to
(defalias 'name ...)
and `name' doesn't get evaluated. If the defun macro would not add that
quote, you would have to write
(defun 'name ...)
but (defun (intern name) ...) would work then.
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, 2015/06/15
- Re: Defining functions on the fly, Tassilo Horn, 2015/06/15
- Re: Defining functions on the fly,
Michael Heerdegen <=
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
- Re: Defining functions on the fly, Tassilo Horn, 2015/06/16
- Re: Defining functions on the fly, Andreas Röhler, 2015/06/16