cl-cookbook icon indicating copy to clipboard operation
cl-cookbook copied to clipboard

Minor fixes for iteration, style guide, front page, etc

Open cgay opened this issue 1 year ago • 3 comments

applies to #540

cgay avatar Jun 13 '24 20:06 cgay

that's grand, thanks.

We have to talk about code snippets starting with * , I really don't like them: beginners wonder what this is, more tedious to copy-paste, ugly, less explicit than CL-USER> . I would not have any prompt (so the styleguide isn't clear on this, but it doesn't mention prompt strings^^).

oh, I see you also uncommented the results, which makes sense when using * .

so instead of

(map 'vector (lambda (it) (+ it 10)) '(1 2 3))
;; #(11 12 13)

we now have

* (map 'vector (lambda (it) (+ it 10)) '(1 2 3))
#(11 12 13)

this is undoing edits I made for this.

(for long results we can use a => without ;; afterwards)

vindarel avatar Jun 13 '24 22:06 vindarel

ok, that makes sense. Just to make sure I understand correctly, you're saying you would prefer

(some lisp form)
;; result value 1
;; result value 2

?

Or we could go with this, perhaps a little clearer?

(some lisp form)
;; => result value 1
;; => result value 2

cgay avatar Jun 13 '24 22:06 cgay

option 1) is used throughout the Cookbook, option 2) is good, we can go with it.

With long results, we can do

(some lisp form)
;; =>
;; 1
;; 2
;; 3

but also

(some lisp form)
;; =>
(some
   result
   form/s)

(this allows to see syntax highlighting for the result when appropriate)

and also a separate code block for the result.

vindarel avatar Jun 14 '24 09:06 vindarel

oh, thanks for merging that. Sorry to have let it slide for so long.

cgay avatar Oct 28 '24 23:10 cgay