Re: Determine object passed as argument

Jean Louis <[email protected]>
Newsgroups gmane.emacs.help
Message-ID <[email protected]>
* Heime <[email protected]> [2026-04-12 11:45]:
> On Sunday, April 12th, 2026 at 5:19 PM, Jean Louis <[email protected]> wrote:
> 
> > On 2026-04-11 17:28, Heime wrote:
> > 
> > > I actually need symbol-name.  Cannot understand the problem you are
> > > trying to describe to me.
> > 
> > (defun lana-du-fpln (datenstruk-symbol &optional bname)
> >    (message "Processing variable: %s" (symbol-name datenstruk-symbol)))
> > 
> >    (lana-du-fpln 'fpln) ⇒ "Processing variable: fpln"
>  
> 
> In my implementation I use (lana-du-fpln myplist) rather than 
> (lana-du-fpln 'myplist).  Only in the second does the symbol 
> name myplist get printed.  
> 
> Would I be capable of doing something with myplist when
> using (lana-du-fpln 'myplist) - to print its key-value pairs?

;; Without quote - passes the VALUE of myplist
(lana-du-fpln myplist)  ; passes the actual list/object

;; With quote - passes the SYMBOL 'myplist itself
(lana-du-fpln 'myplist) ; passes the symbol, not its value

So if you wish to see the name of symbol you must use the second
solution and then derive the value from it.

(setq myplist '(:a 1 :b 2))

(defun show-info (sym)
  (message "Symbol name: %s" (symbol-name sym))
  (message "Symbol value: %S" (symbol-value sym)))

(show-info 'myplist) ⇒ "Symbol value: (:a 1 :b 2)"

Symbol name: myplist
Symbol value: (:a 1 :b 2)

-- 
Jean Louis
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.