emacs-devel
[Top][All Lists]
Advanced

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

Re: [elpa] main 2ec80977e1: * elpa-packages (dired-preview): New package


From: Mattias Engdegård
Subject: Re: [elpa] main 2ec80977e1: * elpa-packages (dired-preview): New package
Date: Fri, 14 Jul 2023 10:13:32 +0200

13 juli 2023 kl. 23.36 skrev Stefan Monnier <monnier@iro.umontreal.ca>:

> - `mapc` also works on other sequences such as vectors and strings.

Right. This also makes it less type-safe than `dolist` in practice: if fed a 
string by accident, `mapc` will happy iterate over a sequence of numbers 
instead of signalling a wrong-type-argument error.

`mapc` is also less safe, in a different sense, if recursed through since it 
could overflow the C stack if the `max-eval-lisp-depth` safety catch is off.

Using `dolist` typically results in slightly shorter code to write, which more 
importantly means less code to read. Most people also prefer seeing the list 
argument on top instead of buried after the loop body.




reply via email to

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