On Mon, Dec 07, 2020 at 04:06:13PM +0100, pietru@caramail.com wrote: [...] > How can one get computed values from a function then? Either you return it (in your case, e.g. by returning a pair) (cons ma mb) or (less preferable) by modifying variables "outside" of the function. You have to take carefully into account what kind of binding the program runs under, or to use "global" (in the sense of program scope: buffer-local variables count as global here) variables, and you have a very good Petri dish for all sort of nasty bugs ;-) Under lexical binding, this, for example, would do: (let ((ma 0) (mb 0)) (defun foo () (setq ma 5) (setq mb 7)) (foo) (message "ma: %d mb: %d" ma mb)) (the function `foo' "sees" the variables `ma', `mb' set up in the enclosing scope). Only recommended for small, tightly knit snippets: the (human) reader should be able to "see" that too. Cheers - t