help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Elisp function that performs numeric computations


From: Eduardo Ochs
Subject: Re: Elisp function that performs numeric computations
Date: Wed, 19 Jan 2022 14:31:12 -0300

On Wed, 19 Jan 2022 at 06:18, fatiparty--- via Users list for the GNU Emacs
text editor <help-gnu-emacs@gnu.org> wrote:

> I have done as follows.  But one problem is: How do I use the output in
> another elisp function?
>
>
Hi Fatiparty,

the easiest way to test small elisp snippets is to run them by typing
C-e C-x C-e on the last line of the snippet... the C-e will move to
the end of the line, and the C-x C-e will then execute the "sexp
before point" and show the result in the echo area. This is explained
here:

  (info "(emacs)Lisp Eval")
  http://www.gnu.org/software/emacs/manual/html_node/emacs/Lisp-Eval.html

Try this on these sexps:

         (* 2 3)
                 (* 4 5)
      (+ (* 2 3) (* 4 5))
  (progn (* 2 3) (* 4 5) (* 6 7))
  (prog1 (* 2 3) (* 4 5) (* 6 7))
  (prog2 (* 2 3) (* 4 5) (* 6 7))

If you like this way of running sexps then you should take a look at
this tutorial, that is all written in this style - "run each of these
sexps with `C-e C-x C-e' and try to understand what they do"...

  http://angg.twu.net/eev-intros/find-elisp-intro.html

Note that the introduction of that tutorial says:

  Different people prefer different kinds of tutorials.
  Many people love the eintr, but I don't: (find-node "(eintr)Top")
  This tutorial here is what I would have liked to have had access to
  when I started learning Emacs Lisp.

Cheers,
  Eduardo Ochs
  http://angg.twu.net/#eev


reply via email to

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