guile-user
[Top][All Lists]
Advanced

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

Re: or values bug?


From: Andy Wingo
Subject: Re: or values bug?
Date: Tue, 06 Dec 2011 19:23:39 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux)

Hey, thanks for looking at this!

On Tue 06 Dec 2011 18:57, address@hidden (Ludovic Courtès) writes:

> Hi Andy,
>
> Andy Wingo <address@hidden> 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 via email to

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