unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Andy Wingo <wingo@pobox.com>
To: ludo@gnu.org (Ludovic Courtès)
Cc: guile-user@gnu.org
Subject: Re: or values bug?
Date: Tue, 06 Dec 2011 19:23:39 +0100	[thread overview]
Message-ID: <87y5upmudw.fsf@pobox.com> (raw)
In-Reply-To: <878vmpk2hf.fsf@gnu.org> ("Ludovic Courtès"'s message of "Tue, 06 Dec 2011 18:57:00 +0100")

Hey, thanks for looking at this!

On Tue 06 Dec 2011 18:57, ludo@gnu.org (Ludovic Courtès) writes:

> Hi Andy,
>
> Andy Wingo <wingo@pobox.com> skribis:
>
>> Rather, something like:
>>
>>    (define (truncate x)
>>      (match x
>>        ((<const>) x)
>>        ;; similar provably singly-valued cases here
>>        (else (make-primcall #f 'values (list x)))))
>
> I suspect it’s often the case that it cannot be proved, for instance
> when a lambda calls a top-level.  In all those cases, we’d end up
> wrapping the expression in (values (list EXP)), which seems like a bad
> idea.

For the purposes of peval, this is probably fine.  Are there any
expressions for which we don't know the number of values that we allow
to propagate?

But if the operand residualizes, it would be nice to avoid turning

  (let ((x (foo))) (+ 1 x))

into

  (let ((x (values (foo)))) (+ 1 x))

as in this case the `values' is completely unnecessary.  Peval could
handle it, or compile-glil.scm could handle it.

Other than those comments, the patch looks nice to me!

Andy
-- 
http://wingolog.org/



  reply	other threads:[~2011-12-06 18:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-05 14:33 or values bug? rixed
2011-12-05 17:40 ` Ludovic Courtès
2011-12-05 20:57   ` Andy Wingo
2011-12-05 21:00     ` Andy Wingo
2011-12-06 17:57       ` Ludovic Courtès
2011-12-06 18:23         ` Andy Wingo [this message]
2011-12-06  6:51 ` rixed

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

  List information: https://www.gnu.org/software/guile/

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

  git send-email \
    --in-reply-to=87y5upmudw.fsf@pobox.com \
    --to=wingo@pobox.com \
    --cc=guile-user@gnu.org \
    --cc=ludo@gnu.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).