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

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

Re: Understanding the "let" construct and the setting of variables


From: Emanuel Berg
Subject: Re: Understanding the "let" construct and the setting of variables
Date: Fri, 18 Dec 2020 21:33:48 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Joost Kremers wrote:

> I'm not sure what exactly you're asking, (I'm wondering if
> your message is complete or was accidentally sent before you
> finished it), but to understand the problem with `setq`,
> evaluate your function above in the `*scratch*` buffer.
> (Copy the function into the `*scratch*` buffer, put the
> cursor right after it and press `C-x C-e`; note that you
> need to add another closing parenthesis on the last line).
> That will define your function and make it available
> to Emacs.
>
> Then open a Lisp interaction buffer with `M-x ielm RET`.
> You'll get a buffer called `*ielm*` with a prompt where you
> can type Elisp expressions that get executed right away.
> Type `tim` (without parentheses) and hit RET. You should get
> a void variable error:
>
>     *** Eval error *** Symbol’s value as variable is void:
> tim"

You (the OP) can also just keep it in the elisp-mode buffer
where it was written, eval it (as you say) and then just
invoke it interactively (with M-x) or from Lisp, to test it
that way. One way to do it from Lisp is again to stay in the
same file, just add a commented out line after the function

;; (some-function test-var-1 test-var-2)

and the eval that.

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal




reply via email to

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