[plt-scheme] keyword return values

From: Shriram Krishnamurthi (sk at cs.brown.edu)
Date: Wed May 6 16:43:22 EDT 2009

I made precisely this suggestion to Matthias a week ago!  I'd love to have
this.

On May 6, 2009 3:31 PM, "Doug Orleans" <dougorleans at gmail.com> wrote:

Scheme has a nice symmetry between arguments and return values.
Procedures like make-do-sequence take advantage of this: instead of
taking six arguments, it takes a thunk that returns six values, so
that it can generate the six values fresh every time an iterator is
created.  I'm always forgetting the order of the values, though; if
they were arguments, then make-do-sequence could use keyword arguments
so you wouldn't have to remember the order.  But return values can't
include keywords:

> (call-with-values (lambda () (values #:y 3 1)) (lambda (x #:y (y 2)) (list
x y)))
procedure application: expected a procedure that accepts keyword
arguments, given #<procedure:values>; arguments were: 1 #:y 3

Would it be feasible to allow this?  I think that would restore the
symmetry between arguments and return values.

--dougorleans at gmail.com
_________________________________________________
 For list-related administrative tasks:
 http://list.cs.brown.edu/mailman/listinfo/plt-scheme
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20090506/9e511a40/attachment.html>

Posted on the users mailing list.