[Scheme-reports] 5. Program Structure Andy Wingo (05 Jan 2013 21:19 UTC)
Re: [Scheme-reports] 5. Program Structure Alex Shinn (06 Jan 2013 01:53 UTC)
Re: [Scheme-reports] 5. Program Structure Andy Wingo (07 Jan 2013 11:49 UTC)
Re: [Scheme-reports] 5. Program Structure John Cowan (07 Jan 2013 16:41 UTC)
Re: [Scheme-reports] 5. Program Structure Alex Shinn (29 Jan 2013 13:01 UTC)
Re: [Scheme-reports] 5. Program Structure Andy Wingo (29 Jan 2013 13:35 UTC)

Re: [Scheme-reports] 5. Program Structure John Cowan 07 Jan 2013 16:40 UTC

Andy Wingo scripsit:

> I still think that define-values should be accompanied with
> letrec-values / letrec*-values or not present at all, but given that you
> have an expansion this is not as crucial.

I mostly use define-values at top level to capture the results of a call
to a multiple-valued procedure, in other words like the variable "/"
in Common Lisp.

> (define-values (root rem) (exact-integer-sqrt 34))
> root
5
> rem
9
> (+ (square root) rem)
34

As pointed out by Arcane Sentiment, define-values can only be portably
implemented by using state.

--
John Cowan      http://www.ccil.org/~cowan      cowan@ccil.org
Be yourself.  Especially do not feign a working knowledge of RDF where
no such knowledge exists.  Neither be cynical about RELAX NG; for in
the face of all aridity and disenchantment in the world of markup,
James Clark is as perennial as the grass.  --DeXiderata, Sean McGrath

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