unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#32284: special form documentation
@ 2018-07-26 22:44 Nicholas Drozd
  2018-07-27  0:04 ` Brett Gilio
  0 siblings, 1 reply; 3+ messages in thread
From: Nicholas Drozd @ 2018-07-26 22:44 UTC (permalink / raw)
  To: 32284

[-- Attachment #1: Type: text/plain, Size: 899 bytes --]

The Elisp manual section on Special Forms (10.2.7) lists around two dozen
special forms, but two of them aren't special forms.

* `lambda', it turns out, is not a special form, but a macro that wraps
itself in a call to the special form `function'. (The documentation for
`lambda' refers to it as "self-quoting"; this might be better changed to
"self-evaluating".)

* `track-mouse' isn't a special form, but a macro wrapper around the
primitive function `internal--track-mouse', which isn't a special form
either. (Section 29.15 on Mouse Tracking also inaccruately refers to
`track-mouse' as a special form.)

On the other hand, the special form `inline' is not listed in the Special
Forms section.

A list of all special forms can be gotten with

(let (special-forms)
  (mapatoms
   (lambda (sym)
     (when (special-form-p sym)
       (push sym special-forms))))
  (sort special-forms #'string<))

[-- Attachment #2: Type: text/html, Size: 1195 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#32284: special form documentation
  2018-07-26 22:44 bug#32284: special form documentation Nicholas Drozd
@ 2018-07-27  0:04 ` Brett Gilio
  2018-07-28  7:26   ` Eli Zaretskii
  0 siblings, 1 reply; 3+ messages in thread
From: Brett Gilio @ 2018-07-27  0:04 UTC (permalink / raw)
  To: Nicholas Drozd; +Cc: 32284


Nicholas Drozd writes:

> The Elisp manual section on Special Forms (10.2.7) lists around 
> two dozen
> special forms, but two of them aren't special forms.
>
> * `lambda', it turns out, is not a special form, but a macro 
> that wraps
> itself in a call to the special form `function'. (The 
> documentation for
> `lambda' refers to it as "self-quoting"; this might be better 
> changed to
> "self-evaluating".)
>
> * `track-mouse' isn't a special form, but a macro wrapper around 
> the
> primitive function `internal--track-mouse', which isn't a 
> special form
> either. (Section 29.15 on Mouse Tracking also inaccruately 
> refers to
> `track-mouse' as a special form.)
>
> On the other hand, the special form `inline' is not listed in 
> the Special
> Forms section.
>
> A list of all special forms can be gotten with
>
> (let (special-forms)
>   (mapatoms
>    (lambda (sym)
>      (when (special-form-p sym)
>        (push sym special-forms))))
>   (sort special-forms #'string<))

Hi Nicholas,

Thank you for the note. As far as I can see you are correct about 
the
method of implementation being macros. But that does not exclude 
them
from being special forms, as from my knowledge a special form is 
simply
an expression that does not follow the formal rules for the
implementation of a function.

Most lisps define their special forms from a small subset of 
primitives
such as lambda and macros, of which these apply.

Anybody else have any input?


-- 
Brett M. Gilio
Free Software Foundation, Member
https://parabola.nu | https://emacs.org





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#32284: special form documentation
  2018-07-27  0:04 ` Brett Gilio
@ 2018-07-28  7:26   ` Eli Zaretskii
  0 siblings, 0 replies; 3+ messages in thread
From: Eli Zaretskii @ 2018-07-28  7:26 UTC (permalink / raw)
  To: Brett Gilio; +Cc: 32284-done, nicholasdrozd

> From: Brett Gilio <brettg@posteo.net>
> Date: Thu, 26 Jul 2018 19:04:32 -0500
> Cc: 32284@debbugs.gnu.org
> 
> Anybody else have any input?

I do: the point about track-mouse is correct: it used to be a special
form (implemented in C), but nowadays is a macro.  So I removed it
from the list of special forms.

I didn't do anything about 'lambda', because its user-facing behavior
is that of a special form, and the fact that it is a thin wrapper
around 'function' is an implementation detail that doesn't necessarily
matter in this context.

With that, I'm closing this bug report.

Thanks.





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-07-28  7:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-26 22:44 bug#32284: special form documentation Nicholas Drozd
2018-07-27  0:04 ` Brett Gilio
2018-07-28  7:26   ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).