help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Defining functions on the fly


From: Tassilo Horn
Subject: Re: Defining functions on the fly
Date: Mon, 15 Jun 2015 13:24:29 +0200
User-agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.0.50 (gnu/linux)

Michael Heerdegen <michael_heerdegen@web.de> writes:

>> > 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.

Ah, yes, so that's basically as if

  (defalias '(intern (concat pfxd "-foo")) ...)

had been written.

Bye,
Tassilo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]