[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ‘(vterm local)’ is a malformed function
From: |
Yuri Khan |
Subject: |
Re: ‘(vterm local)’ is a malformed function |
Date: |
Fri, 4 Aug 2023 12:26:14 +0700 |
On Fri, 4 Aug 2023 at 02:26, hw <hw@adminart.net> wrote:
> Hm, this warning message seems quite misleading. I'm not sure what it
> could better say instead though.
>
> When I look at the desription of if, it says that it'll "do THEN, else
> do ELSE". To me, that means that it'll will *do* (like evaluate) what
> I say, like (vterm "local") --- not that it would treat THEN and ELSE
> sometimes as a parameter of if and sometimes not (i. e. not when
> "else"). What else is "do" supposed to mean here? What does it "do"
> with 5 in '(if (eq 1 1) 5 6)' other than returning 5 --- or 6 if 1
> wasn't equal to 1?
>
> And if (vterm "local") can not be treated as a parameter of if, maybe
> the warning message could say exactly that.
It cannot say that. ‘if’ does not see (vterm "local") as a THEN form.
It sees the whole
((vterm "local")
(vterm-send-string "cd")
(vterm-send-return))
and that looks like a function call but with a weird thing in place of
the function. So it complains at that.
> And perhaps the
> description of if could point out that "do THEN" means something else
> than "do ELSE". Both are called "expression", and they're not the
> same because one gets evaluted and the other doesn't (What actually
> happens to it?).
The description does point it out, very explicitly and clearly.
if is a special form in ‘C source code’.
(if COND THEN ELSE...)
If COND yields non-nil, do THEN, else do ELSE...
Returns the value of THEN or the value of the last of the ELSE’s.
THEN must be one expression, but ELSE... can be zero or more expressions.
^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^
If COND yields nil, and there are no ELSE’s, the value is nil.