[racket-dev] parse errors in types, poly-dots cause me headaches

2014-11-18 Thread Matthias Felleisen

It's quite possible that this is Eli's bug again, but boy this causes 
headaches: 

 Type Checker: parse error in type;
  type variable must be used with ...
   variable: Y in: Y

And it points precisely to where Y is followed by ... 


#lang typed/racket 

(module+ test (require rackunit))

;; [Listof X] [X [Listof X] Y ... - Y ...] Y ... - Y ...
(: foldl* (All (X Y ...) (-* [Listof X] [-* X Y ... (Values Y ...)] Y ... 
(Values Y ...
(define (foldl* l f e1 . es)
  (define e+ (cons e1 es))
  (cond
[(empty? l) (apply values e+)]
[else (call-with-values 
   (lambda () (apply f (first l) e+))
   (lambda e*
 (unless (cons? e*) ;; should I check that (= (length e*) (length 
e+))
   (error 'fold* f produced too few values: ~e e*))
 (apply foldl* (rest l) f e*)))]))

(module+ test
  (define distances '(50 40 70 30 30))
  
  (check-equal? 
   (call-with-values 
(lambda ()
  (foldl* distances
  (lambda (fst distance distance*)
(values (+ fst distance) (cons (+ fst distance) distance*)))
  0
  '()))
(lambda (_ x)
  (reverse x)))
   '(50 90 160 190 220)))


_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] [plt] Push #29518: master branch updated

2014-11-18 Thread Robby Findler
You ran raco setup with no arguments to completion?

On Tuesday, November 18, 2014, j...@racket-lang.org wrote:

 jay has updated `master' from 26fe66b141 to 804599fe98.
   http://git.racket-lang.org/plt/26fe66b141..804599fe98

 =[ One Commit ]=
 Directory summary:
  100.0% pkgs/data-pkgs/data-lib/

 ~~

 804599f Jay McCarthy j...@racket-lang.org javascript:; 2014-11-18 10:44
 :
 | Adding dep that raco setup doesn't show on my machine
 :
   M pkgs/data-pkgs/data-lib/info.rkt | 2 +-

 =[ Overall Diff ]===

 pkgs/data-pkgs/data-lib/info.rkt
 
 --- OLD/pkgs/data-pkgs/data-lib/info.rkt
 +++ NEW/pkgs/data-pkgs/data-lib/info.rkt
 @@ -1,6 +1,6 @@
  #lang info
  (define collection 'multi)
 -(define deps '(base))
 +(define deps '(base math-lib))
  (define build-deps '(rackunit-lib))

  (define pkg-desc implementation (no documentation) part of \data\)

_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] parse errors in types, poly-dots cause me headaches

2014-11-18 Thread Sam Tobin-Hochstadt
On Tue, Nov 18, 2014 at 10:45 AM, Matthias Felleisen
matth...@ccs.neu.edu wrote:

 It's quite possible that this is Eli's bug again, but boy this causes 
 headaches:

 Type Checker: parse error in type;
  type variable must be used with ...
   variable: Y in: Y

 And it points precisely to where Y is followed by ...

The problem here is that you're using -* without using the syntax of
-*.  Fortunately, this program doesn't need -* at all.

Unfortunately, I don't know how to make this function type check yet,
but I'll keep playing with it.

Sam
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] parse errors in types, poly-dots cause me headaches

2014-11-18 Thread Matthias Felleisen

On Nov 18, 2014, at 11:34 AM, Sam Tobin-Hochstadt sa...@cs.indiana.edu wrote:

 On Tue, Nov 18, 2014 at 10:45 AM, Matthias Felleisen
 matth...@ccs.neu.edu wrote:
 
 It's quite possible that this is Eli's bug again, but boy this causes 
 headaches:
 
 Type Checker: parse error in type;
 type variable must be used with ...
  variable: Y in: Y
 
 And it points precisely to where Y is followed by ...
 
 The problem here is that you're using -* without using the syntax of
 -*.  Fortunately, this program doesn't need -* at all.
 
 Unfortunately, I don't know how to make this function type check yet,
 but I'll keep playing with it.


Are you blaming the victim here? Please run what I send out and experience how 
the type checker barfs on you. This is a bug report. 
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] parse errors in types, poly-dots cause me headaches

2014-11-18 Thread Matthias Felleisen

Attached is the screen shot of the error report. 





On Nov 18, 2014, at 11:54 AM, Matthias Felleisen matth...@ccs.neu.edu wrote:

 
 On Nov 18, 2014, at 11:34 AM, Sam Tobin-Hochstadt sa...@cs.indiana.edu 
 wrote:
 
 On Tue, Nov 18, 2014 at 10:45 AM, Matthias Felleisen
 matth...@ccs.neu.edu wrote:
 
 It's quite possible that this is Eli's bug again, but boy this causes 
 headaches:
 
 Type Checker: parse error in type;
 type variable must be used with ...
 variable: Y in: Y
 
 And it points precisely to where Y is followed by ...
 
 The problem here is that you're using -* without using the syntax of
 -*.  Fortunately, this program doesn't need -* at all.
 
 Unfortunately, I don't know how to make this function type check yet,
 but I'll keep playing with it.
 
 
 Are you blaming the victim here? Please run what I send out and experience 
 how the type checker barfs on you. This is a bug report. 
 _
  Racket Developers list:
  http://lists.racket-lang.org/dev

_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] parse errors in types, poly-dots cause me headaches

2014-11-18 Thread Sam Tobin-Hochstadt
No, I ran it, it barfed, and then I figured out what went wrong. Then
I sent you an email with a fix. Unfortunately, that fix isn't enough
to make the program type check. Partly, there's an internal error, but
that's a missing case that will take work to support properly.

We can do better with the error message as well, by special casing ...
in -*, I think.

I don't, however, get the unbound identifier error that is in your
screenshot. I just got the error message from your original post. Can
you send the exact program that produced the error in the screenshot?

Sam

On Tue, Nov 18, 2014 at 11:54 AM, Matthias Felleisen
matth...@ccs.neu.edu wrote:

 On Nov 18, 2014, at 11:34 AM, Sam Tobin-Hochstadt sa...@cs.indiana.edu 
 wrote:

 On Tue, Nov 18, 2014 at 10:45 AM, Matthias Felleisen
 matth...@ccs.neu.edu wrote:

 It's quite possible that this is Eli's bug again, but boy this causes 
 headaches:

 Type Checker: parse error in type;
 type variable must be used with ...
  variable: Y in: Y

 And it points precisely to where Y is followed by ...

 The problem here is that you're using -* without using the syntax of
 -*.  Fortunately, this program doesn't need -* at all.

 Unfortunately, I don't know how to make this function type check yet,
 but I'll keep playing with it.


 Are you blaming the victim here? Please run what I send out and experience 
 how the type checker barfs on you. This is a bug report.
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] parse errors in types, poly-dots cause me headaches

2014-11-18 Thread Matthias Felleisen

What I sent is the exact program that produced the attached error in today's 
drracket [updated around 10am]. 




On Nov 18, 2014, at 11:58 AM, Sam Tobin-Hochstadt sa...@cs.indiana.edu wrote:

 No, I ran it, it barfed, and then I figured out what went wrong. Then
 I sent you an email with a fix. Unfortunately, that fix isn't enough
 to make the program type check. Partly, there's an internal error, but
 that's a missing case that will take work to support properly.
 
 We can do better with the error message as well, by special casing ...
 in -*, I think.
 
 I don't, however, get the unbound identifier error that is in your
 screenshot. I just got the error message from your original post. Can
 you send the exact program that produced the error in the screenshot?
 
 Sam
 
 On Tue, Nov 18, 2014 at 11:54 AM, Matthias Felleisen
 matth...@ccs.neu.edu wrote:
 
 On Nov 18, 2014, at 11:34 AM, Sam Tobin-Hochstadt sa...@cs.indiana.edu 
 wrote:
 
 On Tue, Nov 18, 2014 at 10:45 AM, Matthias Felleisen
 matth...@ccs.neu.edu wrote:
 
 It's quite possible that this is Eli's bug again, but boy this causes 
 headaches:
 
 Type Checker: parse error in type;
 type variable must be used with ...
 variable: Y in: Y
 
 And it points precisely to where Y is followed by ...
 
 The problem here is that you're using -* without using the syntax of
 -*.  Fortunately, this program doesn't need -* at all.
 
 Unfortunately, I don't know how to make this function type check yet,
 but I'll keep playing with it.
 
 
 Are you blaming the victim here? Please run what I send out and experience 
 how the type checker barfs on you. This is a bug report.


_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] parse errors in types, poly-dots cause me headaches

2014-11-18 Thread Sam Tobin-Hochstadt
With that program, I get this error message:

unsaved editor:7:48: Type Checker: parse error in type; type
variable must be used with ... variable: Y in: Y

Which you also got. What changed it from the parse error to the
unbound identifier error?

Sam

On Tue, Nov 18, 2014 at 12:05 PM, Matthias Felleisen
matth...@ccs.neu.edu wrote:

 What I sent is the exact program that produced the attached error in today's 
 drracket [updated around 10am].




 On Nov 18, 2014, at 11:58 AM, Sam Tobin-Hochstadt sa...@cs.indiana.edu 
 wrote:

 No, I ran it, it barfed, and then I figured out what went wrong. Then
 I sent you an email with a fix. Unfortunately, that fix isn't enough
 to make the program type check. Partly, there's an internal error, but
 that's a missing case that will take work to support properly.

 We can do better with the error message as well, by special casing ...
 in -*, I think.

 I don't, however, get the unbound identifier error that is in your
 screenshot. I just got the error message from your original post. Can
 you send the exact program that produced the error in the screenshot?

 Sam

 On Tue, Nov 18, 2014 at 11:54 AM, Matthias Felleisen
 matth...@ccs.neu.edu wrote:

 On Nov 18, 2014, at 11:34 AM, Sam Tobin-Hochstadt sa...@cs.indiana.edu 
 wrote:

 On Tue, Nov 18, 2014 at 10:45 AM, Matthias Felleisen
 matth...@ccs.neu.edu wrote:

 It's quite possible that this is Eli's bug again, but boy this causes 
 headaches:

 Type Checker: parse error in type;
 type variable must be used with ...
 variable: Y in: Y

 And it points precisely to where Y is followed by ...

 The problem here is that you're using -* without using the syntax of
 -*.  Fortunately, this program doesn't need -* at all.

 Unfortunately, I don't know how to make this function type check yet,
 but I'll keep playing with it.


 Are you blaming the victim here? Please run what I send out and experience 
 how the type checker barfs on you. This is a bug report.

_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] parse errors in types, poly-dots cause me headaches

2014-11-18 Thread Matthias Felleisen

I am sending you the status line from 

   DrRacket, version 6.1.1.5--2014-11-18(c4684c12/d) [3m].




On Nov 18, 2014, at 12:10 PM, Sam Tobin-Hochstadt sa...@cs.indiana.edu wrote:

 With that program, I get this error message:
 
unsaved editor:7:48: Type Checker: parse error in type; type
 variable must be used with ... variable: Y in: Y
 
 Which you also got. What changed it from the parse error to the
 unbound identifier error?
 
 Sam
 
 On Tue, Nov 18, 2014 at 12:05 PM, Matthias Felleisen
 matth...@ccs.neu.edu wrote:
 
 What I sent is the exact program that produced the attached error in today's 
 drracket [updated around 10am].
 
 
 
 
 On Nov 18, 2014, at 11:58 AM, Sam Tobin-Hochstadt sa...@cs.indiana.edu 
 wrote:
 
 No, I ran it, it barfed, and then I figured out what went wrong. Then
 I sent you an email with a fix. Unfortunately, that fix isn't enough
 to make the program type check. Partly, there's an internal error, but
 that's a missing case that will take work to support properly.
 
 We can do better with the error message as well, by special casing ...
 in -*, I think.
 
 I don't, however, get the unbound identifier error that is in your
 screenshot. I just got the error message from your original post. Can
 you send the exact program that produced the error in the screenshot?
 
 Sam
 
 On Tue, Nov 18, 2014 at 11:54 AM, Matthias Felleisen
 matth...@ccs.neu.edu wrote:
 
 On Nov 18, 2014, at 11:34 AM, Sam Tobin-Hochstadt sa...@cs.indiana.edu 
 wrote:
 
 On Tue, Nov 18, 2014 at 10:45 AM, Matthias Felleisen
 matth...@ccs.neu.edu wrote:
 
 It's quite possible that this is Eli's bug again, but boy this causes 
 headaches:
 
 Type Checker: parse error in type;
 type variable must be used with ...
 variable: Y in: Y
 
 And it points precisely to where Y is followed by ...
 
 The problem here is that you're using -* without using the syntax of
 -*.  Fortunately, this program doesn't need -* at all.
 
 Unfortunately, I don't know how to make this function type check yet,
 but I'll keep playing with it.
 
 
 Are you blaming the victim here? Please run what I send out and experience 
 how the type checker barfs on you. This is a bug report.
 


_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] [plt] Push #29418: master branch updated

2014-11-18 Thread Jay McCarthy
This change broke racklog:

http://drdr.racket-lang.org/29418/pkgs/racklog/tests/bible.rkt
(and others)

Jay

On Wed, Oct 22, 2014 at 4:32 PM,  mfl...@racket-lang.org wrote:
 mflatt has updated `master' from 9c30da7682 to 1f764a3dba.
   http://git.racket-lang.org/plt/9c30da7682..1f764a3dba

 =[ One Commit ]=
 Directory summary:
   11.1% pkgs/racket-pkgs/racket-test/tests/racket/
   88.8% racket/src/racket/src/

 ~~

 1f764a3 Matthew Flatt mfl...@racket-lang.org 2014-10-22 09:43
 :
 | fix internal meta-continuation comparison for continuation sharing
 |
 | The check that the current meta-continuation matches the captured one
 | would always fail (I think), since the current meta-continuation is
 | pruned on capture. Keep a weak link to the original meta-continuation
 | to enable detection of capturing a continuation that matches or
 | extends one that was previously captured.
 |
 | Enabling sharing exposed a problem with the code that saves
 | continuation marks for partial sharing, since that implementation
 | became out of sync with the main implementation (so merge the
 | implementations).
 :
   M racket/src/racket/src/fun.c   | 111 
 +--
   M racket/src/racket/src/mzmarksrc.c |   1 +
   M racket/src/racket/src/mzmark_type.inc |   2 +
   M racket/src/racket/src/schpriv.h   |   1 +
   M racket/src/racket/src/setjmpup.c  |  20 +++-
   M .../racket-test/tests/racket/prompt.rktl  |  26 +

 =[ Overall Diff ]===

 pkgs/racket-pkgs/racket-test/tests/racket/prompt.rktl
 ~
 --- OLD/pkgs/racket-pkgs/racket-test/tests/racket/prompt.rktl
 +++ NEW/pkgs/racket-pkgs/racket-test/tests/racket/prompt.rktl
 @@ -421,5 +421,31 @@
(test 1 values v))

  ;;
 +;; Check continuation sharing
 +
 +(let ()
 +  (define (f x prev)
 +(call/cc
 + (lambda (k)
 +   (test (and (even? x)
 +  (x .  . 10))
 + eq?
 + k
 + prev)
 +   (cond
 +[(zero? x) 'done]
 +[(even? x) (or (f (sub1 x) k) #t)]
 +[else (f (sub1 x) k)]
 +
 +  (void (f 10 #f))
 +  (void
 +   (let ([v (call-with-composable-continuation
 + (lambda (k)
 +   k))])
 + (if (procedure? v)
 + (v 'ok)
 + (f 10 #f)
 +
 +;;

  (report-errs)

 racket/src/racket/src/fun.c
 ~~~
 --- OLD/racket/src/racket/src/fun.c
 +++ NEW/racket/src/racket/src/fun.c
 @@ -5138,9 +5138,9 @@ call_cc (int argc, Scheme_Object *argv[])
  static Scheme_Cont *grab_continuation(Scheme_Thread *p, int for_prompt, int 
 composable,
Scheme_Object *prompt_tag, 
 Scheme_Object *pt,
Scheme_Cont *sub_cont, Scheme_Prompt 
 *prompt,
 -  Scheme_Meta_Continuation *prompt_cont,
 -  Scheme_Prompt *effective_barrier_prompt
 -  )
 +  Scheme_Meta_Continuation *prompt_cont,
 +  Scheme_Prompt 
 *effective_barrier_prompt,
 +  int cm_only)
  {
Scheme_Cont *cont;
Scheme_Cont_Jmp *buf_ptr;
 @@ -5148,7 +5148,7 @@ static Scheme_Cont *grab_continuation(Scheme_Thread *p, 
 int for_prompt, int comp
cont = MALLOC_ONE_TAGGED(Scheme_Cont);
cont-so.type = scheme_cont_type;

 -  if (!for_prompt  !composable) {
 +  if (!for_prompt  !composable  !cm_only) {
  /* Set cont_key mark before capturing marks: */
  scheme_set_cont_mark(cont_key, (Scheme_Object *)cont);
}
 @@ -5160,21 +5160,23 @@ static Scheme_Cont *grab_continuation(Scheme_Thread 
 *p, int for_prompt, int comp
SET_REQUIRED_TAG(buf_ptr-type = scheme_rt_cont_jmp);
cont-buf_ptr = buf_ptr;

 -  scheme_init_jmpup_buf(cont-buf_ptr-buf);
 -  cont-prompt_tag = prompt_tag;
 -  if (for_prompt)
 -cont-dw = NULL;
 -  else if (prompt) {
 -Scheme_Dynamic_Wind *dw;
 -if (p-dw) {
 -  dw = clone_dyn_wind(p-dw, pt, -1, -1, NULL, 0, composable);
 -  cont-dw = dw;
 -  cont-next_meta = p-next_meta;
 -} else
 +  if (!cm_only) {
 +scheme_init_jmpup_buf(cont-buf_ptr-buf);
 +cont-prompt_tag = prompt_tag;
 +if (for_prompt)
cont-dw = NULL;
 -  } else {
 -cont-dw = p-dw;
 -cont-next_meta = p-next_meta;
 +else if (prompt) {
 +  Scheme_Dynamic_Wind *dw;
 +  if (p-dw) {
 +dw = clone_dyn_wind(p-dw, pt, -1, -1, NULL, 0, composable);
 +cont-dw = dw;
 +cont-next_meta = p-next_meta;
 +  } else
 +cont-dw = NULL;
 +} else {
 +  cont-dw = p-dw;
 +  cont-next_meta = 

Re: [racket-dev] parse errors in types, poly-dots cause me headaches

2014-11-18 Thread Alexander D. Knauth
In terms of bugs, it’s probably related to this problem with call-with-values 
and poly-dots:
#lang typed/racket
(: f : (All (a ...) [(- (values Any ... a)) - Void]))
(define (f g)
  (call-with-values g void))
;=
. . ../../Applications/Racket 
v6.1.1/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-app/tc-app-values.rkt:22:4:
 match: no matching clause for (tc-results '() (cons Any 'a))

On Nov 18, 2014, at 11:54 AM, Matthias Felleisen matth...@ccs.neu.edu wrote:

 
 On Nov 18, 2014, at 11:34 AM, Sam Tobin-Hochstadt sa...@cs.indiana.edu 
 wrote:
 
 On Tue, Nov 18, 2014 at 10:45 AM, Matthias Felleisen
 matth...@ccs.neu.edu wrote:
 
 It's quite possible that this is Eli's bug again, but boy this causes 
 headaches:
 
 Type Checker: parse error in type;
 type variable must be used with ...
 variable: Y in: Y
 
 And it points precisely to where Y is followed by ...
 
 The problem here is that you're using -* without using the syntax of
 -*.  Fortunately, this program doesn't need -* at all.
 
 Unfortunately, I don't know how to make this function type check yet,
 but I'll keep playing with it.
 
 
 Are you blaming the victim here? Please run what I send out and experience 
 how the type checker barfs on you. This is a bug report. 
 _
  Racket Developers list:
  http://lists.racket-lang.org/dev


_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] parse errors in types, poly-dots cause me headaches

2014-11-18 Thread Sam Tobin-Hochstadt
Yes, fix (for the internal error) coming soon.

Sam

On Tue, Nov 18, 2014 at 5:24 PM, Alexander D. Knauth
alexan...@knauth.org wrote:
 In terms of bugs, it’s probably related to this problem with call-with-values 
 and poly-dots:
 #lang typed/racket
 (: f : (All (a ...) [(- (values Any ... a)) - Void]))
 (define (f g)
   (call-with-values g void))
 ;=
 . . ../../Applications/Racket 
 v6.1.1/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-app/tc-app-values.rkt:22:4:
  match: no matching clause for (tc-results '() (cons Any 'a))

 On Nov 18, 2014, at 11:54 AM, Matthias Felleisen matth...@ccs.neu.edu wrote:


 On Nov 18, 2014, at 11:34 AM, Sam Tobin-Hochstadt sa...@cs.indiana.edu 
 wrote:

 On Tue, Nov 18, 2014 at 10:45 AM, Matthias Felleisen
 matth...@ccs.neu.edu wrote:

 It's quite possible that this is Eli's bug again, but boy this causes 
 headaches:

 Type Checker: parse error in type;
 type variable must be used with ...
 variable: Y in: Y

 And it points precisely to where Y is followed by ...

 The problem here is that you're using -* without using the syntax of
 -*.  Fortunately, this program doesn't need -* at all.

 Unfortunately, I don't know how to make this function type check yet,
 but I'll keep playing with it.


 Are you blaming the victim here? Please run what I send out and experience 
 how the type checker barfs on you. This is a bug report.
 _
  Racket Developers list:
  http://lists.racket-lang.org/dev


_
  Racket Developers list:
  http://lists.racket-lang.org/dev