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

Re: [Scheme-reports] "unspecified values"



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@x   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@x
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports