[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Elisp function that performs numeric computations
From: |
Emanuel Berg |
Subject: |
Re: Elisp function that performs numeric computations |
Date: |
Fri, 21 Jan 2022 12:51:40 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) |
fatiparty--- via Users list for the GNU Emacs text editor wrote:
> (defun test (dcur dmax drpt)
All programming: Name the function something that etc etc.
Lisp: We don't name formal parameters the assembly language or
C style ... give them short, but if possible complete names
that are easy to read and write. When in doubt, give them
a complete name that communicates what its purpose or
intended use.
> "Compute brace depth used for brace colouring."
Doc string should have the formal parameter's names in BOLD in
the order they come in the the function definition ...
> (interactive)
Assign the formal parameters with argument values
(interactive "ndepth: \nntop: \nnrepeat: ")
^ eval me
Use English in the prompt string, if the words feel to long
see if they can be shortened in a natural way (here, e.g. dep,
top, and rep) - the reason one avoids "max" is it also appears
in as the function `max' ...
> (let ( (n dcur) )
> (message "dcur <= dmax | Typeface: %d" n)
> n)
If there is no computation, renaming it ... why do you
do that?
You use it like this:
(let*((side 2)
(square (expt side 2) )) ...
;; use square here
)
--
underground experts united
https://dataswamp.org/~incal
- Re: Elisp function that performs numeric computations, (continued)
- Re: Elisp function that performs numeric computations, tomas, 2022/01/19
- Re: Elisp function that performs numeric computations, Marcin Borkowski, 2022/01/19
- Elisp function that performs numeric computations, fatiparty, 2022/01/19
- Re: Elisp function that performs numeric computations, Sergey Organov, 2022/01/20
- Elisp function that performs numeric computations, fatiparty, 2022/01/21
- Re: Elisp function that performs numeric computations, Emanuel Berg, 2022/01/21
- Re: Elisp function that performs numeric computations, Sergey Organov, 2022/01/21
- Re: Elisp function that performs numeric computations, Emanuel Berg, 2022/01/21
- Re: Elisp function that performs numeric computations, Sergey Organov, 2022/01/21
- Elisp function that performs numeric computations, fatiparty, 2022/01/21
- Re: Elisp function that performs numeric computations,
Emanuel Berg <=
- Elisp function that performs numeric computations, fatiparty, 2022/01/21
- Message not available
- Elisp function that performs numeric computations, fatiparty, 2022/01/20
- Re: Elisp function that performs numeric computations, Manuel Giraud, 2022/01/19
- Re: Elisp function that performs numeric computations, Eduardo Ochs, 2022/01/19
- Re: Elisp function that performs numeric computations, Michael Heerdegen, 2022/01/19