Re: Determine object passed as argument

Heime <[email protected]>
Newsgroups gmane.emacs.help
Message-ID <upNgAdw-l9eVfTB2KZx0sweWmeMB9vIFPRqW5YVnLlyyKI2m72uA7n9W86ZkIZLd6w5Ck2Ypw1TayWpq23bbdvIuZT6kXLA_xJBp5iuiHXI=@protonmail.com>
On Sunday, April 12th, 2026 at 3:27 AM, Heime <[email protected]> wrote:

> 
> On Sunday, April 12th, 2026 at 2:38 AM, [email protected] <[email protected]> wrote:
> 
> > [email protected] writes:
> >
> > > Heime <[email protected]> writes:
> > >
> > >> Can a function determine the object being passed as argument and
> > >> print its name.  For instance that I passed if I pass fpln when
> > >> calling (lana-du-fpln 'fpln).
> > >>
> > >> (defun lana-du-fpln (datenstruk &optional bname)
> > >>
> > >
> > >   (defun lana-du-fpln (datenstruk &optional bname)
> > >     (symbol-name datenstruk))
> > >
> > >   (lana-du-fpln 'fpln)
> > >   => "fpln"
> > >
> > > Or,
> > >
> > >   (defun lana-du-fpln (datenstruk &optional bname)
> > >     (format "Name of symbol: %s" (symbol-name datenstruk)))
> > >
> > >   (lana-du-fpln 'fpln)
> > >   => "Name of symbol: fpln"
> >
> > Or,
> >
> >   (defun lana-du-fpln (datenstruk &optional bname)
> >     (if (cl-typep datenstruk 'symbol)
> >       (symbol-name datenstruk)
> >       ;; Else
> >       "Not a symbol"))
> >
> >   (lana-du-fpln 'fpln)
> >   => "fpln"
> >   (lana-du-fpln '(a b c))
> >   => "Not a symbol"
> >   (lana-du-fpln "abc")
> >   => "Not a symbol"
> 
> No need for boundp as outlines by Jean?

Can I use (symbolp datenstruk)

If the test fails and is not a symbol, then what is the
argument?  Anonymous?

Can I determine whether the input is a hash-table, plist, 
alist or something else?

> > --
> > The lyf so short, the craft so long to lerne.
> > - Geoffrey Chaucer, The Parliament of Birds.
> >
> >
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.