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

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

docstrings (was: Re: Prefix Argument and optional argument)


From: Emanuel Berg
Subject: docstrings (was: Re: Prefix Argument and optional argument)
Date: Thu, 07 Jul 2022 19:03:24 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Christopher Dimech wrote:

> (defun poke (prefix)
>  "TODO."
>  (interactive "P"))
>
> It is only because body is empty then, right?

The way it is implemented actually the docstring is part of
the body!

Eval this which has the same interface/signature as the
`defun' macro:

  (defmacro defun-ds (name args &rest body)
    (car body) )

And then try it:

  (defun-ds f (x) "Doc string." x)

-- 
underground experts united
https://dataswamp.org/~incal




reply via email to

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