[Scheme-reports] "unspecified values" Andy Wingo (19 May 2011 15:49 UTC)
Re: [Scheme-reports] "unspecified values" Alaric Snell-Pym (19 May 2011 16:11 UTC)
Re: [Scheme-reports] "unspecified values" Andy Wingo (19 May 2011 17:11 UTC)
Re: [Scheme-reports] "unspecified values" Alex Shinn (21 May 2011 05:04 UTC)
Re: [Scheme-reports] "unspecified values" Andy Wingo (21 May 2011 08:52 UTC)
Re: [Scheme-reports] "unspecified values" Jim Rees (21 May 2011 13:58 UTC)
Re: [Scheme-reports] "unspecified values" Andy Wingo (21 May 2011 15:10 UTC)
Re: [Scheme-reports] "unspecified values" John Cowan (21 May 2011 18:24 UTC)
Re: [Scheme-reports] "unspecified values" Andy Wingo (22 May 2011 13:28 UTC)
Re: [Scheme-reports] "unspecified values" Andre van Tonder (21 May 2011 15:19 UTC)
Re: [Scheme-reports] "unspecified values" Alex Shinn (21 May 2011 18:19 UTC)
Re: [Scheme-reports] "unspecified values" Alaric Snell-Pym (23 May 2011 11:34 UTC)
Re: [Scheme-reports] "unspecified values" John Cowan (23 May 2011 15:57 UTC)
Re: [Scheme-reports] "unspecified values" Alaric Snell-Pym (23 May 2011 11:20 UTC)

Re: [Scheme-reports] "unspecified values" John Cowan 23 May 2011 15:57 UTC

Alaric Snell-Pym scripsit:

> Perhaps what should happen, to encourage people to Do It Right The First
> Time, is to have some syntax to capture the values of an expression as
> some opaque object, and another to return those values.

That would be:

(define-syntax values-of
  (syntax-rules ()
    ((values-of x) (call-with-values (lambda () x) list))))

(define (unwrap-values v) (apply values v))

Add opacity at your pleasure.

--
John Cowan  cowan@ccil.org   http://www.ccil.org/~cowan
Dievas dave dantis; Dievas duos duonos          --Lithuanian proverb
Deus dedit dentes; deus dabit panem             --Latin version thereof
Deity donated dentition;
  deity'll donate doughnuts                     --English version by Muke Tever
God gave gums; God'll give granary              --Version by Mat McVeagh

_______________________________________________
Scheme-reports mailing list
Scheme-reports@scheme-reports.org
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports