[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ELisp - Making a list from a function returning a number
From: |
Emanuel Berg |
Subject: |
Re: ELisp - Making a list from a function returning a number |
Date: |
Fri, 18 Dec 2020 15:43:28 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
steve-humphreys wrote:
> This is my new function
>
> (defun timgrid ()
>
> (let* ( (tstr 800)
> (tend 1300)
> (tpd 34)
> (i 0)
> (tim tstr)
> tim tfr )
> ;; ----- body of let -----
> (dotimes (i 4)
> (message "tim tpd: %d %d" tim tpd)
> (setq tfr (timfutur tim tpd))
> (message "tim: %d" tim)
> ;;(setq tlist (append 'tlist (list tim)))
> (setq tim tfr)) ))
Please,
1. use more understandable language. this is Lisp, not
assembly language...
2. remove blank lines and commented out lines
3. don't use comments that do not add any information (e.g.,
"body of let" - but that is already plain and true, by
definition)
4. use the normal indentation space for Elisp, in `elisp-mode'
two spaces
5. again, don't use `setq' in function bodies when there is no
need, you already have the vars in let*, do all computation
there (add more vars if necessary, for clarity, even)
I'm not saying this to be disrespectful, instead trust me that
it will bring your game up A LOT and also people will be more
likely to communicate with you - more, but also better since
you help not only yourself but also anyone reading and
possibly using your code...
--
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal
- ELisp - Making a list from a function returning a number, steve-humphreys, 2020/12/17
- Re: ELisp - Making a list from a function returning a number, steve-humphreys, 2020/12/17
- Re: ELisp - Making a list from a function returning a number, steve-humphreys, 2020/12/17
- Re: ELisp - Making a list from a function returning a number,
Emanuel Berg <=
- Re: ELisp - Making a list from a function returning a number, Jean Louis, 2020/12/18
- Re: ELisp - Making a list from a function returning a number, Emanuel Berg, 2020/12/20
- Re: ELisp - Making a list from a function returning a number, Jean Louis, 2020/12/20
- Re: ELisp - Making a list from a function returning a number, Christopher Dimech, 2020/12/20
- Re: ELisp - Making a list from a function returning a number, Emanuel Berg, 2020/12/20