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

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

Re: [External] : Why I cannot use this variable in macro call from funct


From: Jean Louis
Subject: Re: [External] : Why I cannot use this variable in macro call from function?
Date: Tue, 8 Jun 2021 17:47:11 +0300
User-agent: Mutt/2.0.7+183 (3d24855) (2021-05-28)

* Drew Adams <drew.adams@oracle.com> [2021-06-08 16:42]:
> > (defmacro rcd-db-completing-table-history (table)
> >   (let ((variable
> >           (intern
> >            (concat "rcd-db-completing-table-history-"
> >                    table))))
> 
> > (defun my-fun-123 ()
> >   (let ((var "new"))
> >     (rcd-db-completing-table-history var)))
> > 
> > (my-fun-123)
> > 
> > Debugger entered--Lisp error: (wrong-type-argument sequencep var)
> >   concat("rcd-db-completing-table-history-" var)
> 
> You are passing the symbol `var' as the arg
> to your macro.  Macros don't automatically
> evaluate their args.  What you are expecting
> is presumably to pass the _value_ of symbol
> `var', i.e., treat the symbol as a variable
> and pass its value.

I hoped I will solve it with the function `symbol-value', but this
does not work:

(let ((var "new-table"))
  (rcd-db-completing-table-history (symbol-value var)))

How do you mean?




-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/



reply via email to

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