[racket-dev] Problem with Values type constructor

From: Antonio Menezes Leitao (antonio.menezes.leitao at ist.utl.pt)
Date: Wed Jul 23 15:20:56 EDT 2014

Hi,

Although the typed racket documentation mentions Values as a type
constructor, it does not work:

Welcome to DrRacket, version 6.1.0.3--2014-07-18(e827817/a) [3m].
Language: typed/racket; memory limit: 1024 MB.
> (define (foo) : (Values Number Number) (values 1 2))
. Type Checker: parse error in type;
 type name `Values' is unbound in: Values
. Type Checker: wrong number of values: expected 1 but got 2 in: (values 1
2)
. Type Checker: Summary: 2 errors encountered in:
  Values
  (values 1 2)

OTOH, the lowercase values seems to work as a type constructor.

> (define (bar) : (values Number Number) (values 1 2))
> bar
- : (-> (values Number Number))
#<procedure:bar>

Moreover, there is some kind of confusion between values and Values:

> (values 1 2)
- : (values Integer Integer) [more precisely: (Values One Positive-Byte)]
1
2

Am I missing something?

Best,
António.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/dev/archive/attachments/20140723/f68372ec/attachment.html>

Posted on the dev mailing list.