Discussion:
Historical curiosity
(too old to reply)
Olve
2014-04-19 07:32:41 UTC
Permalink
Hi,

(defun who help-string what)
(defvar who help-string what)
(defconst who what help-string)

Any idea as to what that came to be?
Best, O.
Barry Margolin
2014-04-19 11:13:47 UTC
Permalink
Post by Olve
Hi,
(defun who help-string what)
(defvar who help-string what)
It's

(defvar who what help-string)
Post by Olve
(defconst who what help-string)
Any idea as to what that came to be?
You mean why it's different for defun than the others? Because the
"what" of a defun is often long, and you don't want to have to scroll to
the end to find the doc string. Also, a function returns the last thing
in its body, so if you put the docstring at the end, it would actually
be the return value. A string by itself at the beginning of the body has
no effect, so it could be recognized as the doc string.
--
Barry Margolin, ***@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
Pascal J. Bourguignon
2014-04-19 11:43:29 UTC
Permalink
Post by Olve
Hi,
(defun who help-string what)
(defvar who help-string what)
(defconst who what help-string)
Any idea as to what that came to be?
From your crazy mind?

It's:

(defun who what help-string how)
(defvar who what help-string)
(defconst who what help-string)

ex.:

(defconst +twiddle+ 'object "A constant twiddle object")
(defvar *twiddle* 'object "A variable twiddle object")
(defun twiddle (object) "Twiddle the `OBJECT`" (twiddle *twiddle* (twiddly object +twiddle+)))
--
__Pascal Bourguignon__
http://www.informatimago.com/
"Le mercure monte ? C'est le moment d'acheter !"
Olve
2014-04-19 17:18:52 UTC
Permalink
[...]
Post by Pascal J. Bourguignon
From your crazy mind?
Is that supposed to be funny? O.

Continue reading on narkive:
Loading...