Reduce call-with-values to let for singly-valued producers
authorAndy Wingo <wingo@pobox.com>
Sun, 16 Jun 2013 13:02:34 +0000 (15:02 +0200)
committerAndy Wingo <wingo@pobox.com>
Sun, 16 Jun 2013 13:02:34 +0000 (15:02 +0200)
commite6450062a19bf5d0072d117b69be95c2641c23ab
treead75176969f9474118a04b0c938671b2a29b99af
parentb34b66b346ef7c09878112d7cf6d757bb1906344
Reduce call-with-values to let for singly-valued producers

* module/language/tree-il/peval.scm (singly-valued-expression?): Add
  support for conditionals.  In the future we should add more
  expressions here.
  (peval): Don't inline values into the body of a dynwind, as that could
  cause the consumer to run in the wrong dynamic context.
  If the producer is singly-valued and the consumer just has a rest arg,
  reduce to "let" and cons up a list in the consumer.  This may reduce
  further.

* test-suite/tests/peval.test ("partial evaluation"): Add a test.
module/language/tree-il/peval.scm
test-suite/tests/peval.test