From: Arvydas Silanskas <nma.arvydas.silanskas@gmail.com>
To: Panicz Maciej Godek <godek.maciek@gmail.com>
Cc: kawa mailing list <kawa@sourceware.org>
Subject: Re: "void-valued expression where value is needed"
Date: Wed, 21 Sep 2022 00:41:33 +0300 [thread overview]
Message-ID: <CAPh7weBX4WF4L8x_EB5ntEpn20WcoPCsKY8aBU0UQq5gcBTKYw@mail.gmail.com> (raw)
In-Reply-To: <CAMFYt2aCMc90b6Mkb0E70sfmOHoipnYAmUJQQkNXYP_Z2ALyiA@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 920 bytes --]
I think this is a sensible warning. If I see #!void ending up somewhere
inside a value object like a list (`result` in your snippet), that
immediately alarms me that something is wrong. An empty `values` call is a
defined case, it would simply yield an empty `result` list.
2022-09-21, tr, 00:02 Panicz Maciej Godek via Kawa <kawa@sourceware.org>
rašė:
> Suppose that I have some code like
>
> (define (f)::void
> (call-with-values
> (λ () #!void)
> (λ result
> (apply values result))))
>
> When I compile it, Kawa issues the warning:
>
> void-valued expression where value is needed
>
> I wonder whether this warning is desired in such circumstances?
>
> (It surely makes it difficult to write values-agnostic macros)
>
> What is interesting is that the warning disappears if I replace #!void with
> (values) [unless I declare the function's return type as ::void].
>
prev parent reply other threads:[~2022-09-20 21:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-20 21:02 Panicz Maciej Godek
2022-09-20 21:41 ` Arvydas Silanskas [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=CAPh7weBX4WF4L8x_EB5ntEpn20WcoPCsKY8aBU0UQq5gcBTKYw@mail.gmail.com \
--to=nma.arvydas.silanskas@gmail.com \
--cc=godek.maciek@gmail.com \
--cc=kawa@sourceware.org \
/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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).