emacs-devel
[Top][All Lists]
Advanced

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

Re: Add hints to documentation of car and cdr for (e)lisp newcomers - ta


From: Stefan Kangas
Subject: Re: Add hints to documentation of car and cdr for (e)lisp newcomers - take 2
Date: Thu, 15 Jul 2021 01:49:23 +0200

Lars Ingebrigtsen <larsi@gnus.org> writes:

> The doc strings could say something terse like "The `car' is usually the
> first element in LIST, and the `cdr' is usually the rest of LIST"
> perhaps?

The R6RS does it with examples:

(car pair)    procedure

Returns the contents of the car field of pair.

(car ’(a b c))                  ⇒  a
(car ’((a) b c d))              ⇒  (a)
(car ’(1 . 2))                  ⇒  1
(car ’())                 &assertion exception

https://docs.racket-lang.org/r6rs/r6rs-std/r6rs-Z-H-14.html#node_idx_612



reply via email to

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