all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Yuri Khan <yuri.v.khan@gmail.com>
To: hw <hw@adminart.net>
Cc: help-gnu-emacs@gnu.org
Subject: Re: ‘(vterm local)’ is a malformed function
Date: Fri, 4 Aug 2023 12:26:14 +0700	[thread overview]
Message-ID: <CAP_d_8VTmKKyGONvRDzC2Wpi8B+YY+wWzpkWv11mMx04QbZ2Yw@mail.gmail.com> (raw)
In-Reply-To: <d089e5425bd5690dac9b98750a9d3e61bbb3ea32.camel@adminart.net>

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.



      reply	other threads:[~2023-08-04  5:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-03 15:22 ‘(vterm local)’ is a malformed function hw
2023-08-03 16:45 ` Yuri Khan
2023-08-03 19:25   ` hw
2023-08-04  5:26     ` Yuri Khan [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAP_d_8VTmKKyGONvRDzC2Wpi8B+YY+wWzpkWv11mMx04QbZ2Yw@mail.gmail.com \
    --to=yuri.v.khan@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=hw@adminart.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.