1
0
Fork
You've already forked racket
0

error with plai-typed language #7

Open
opened 2012年09月17日 06:04:47 +02:00 by jaor · 8 comments
jaor commented 2012年09月17日 06:04:47 +02:00 (Migrated from gitlab.com)
Copy link

Created by: metajack

If I use the plai-typed from here:
http://www.cs.brown.edu/courses/cs173/2012/plai-typed-2012年09月16日-2.plt
(new version created for the class here: http://www.cs.brown.edu/courses/cs173/2012)

I can't get modules to load in Geiser, even though they load in DrRacket.

For example:

#lang plai-typed
(define-type ExprC
 [numC (n : number)]
 [plusC (l : ExprC)
 (r : ExprC)]
 [multC (l : ExprC)
 (r : ExprC)]
 [ifC (test : ExprC)
 (then-case : ExprC)
 (else-case : ExprC)])

gives me:

?: don't know how to typecheck
 in: #<void>
 errortrace...:
 context...:
 /Users/jack/Library/Racket/5.3/collects/plai-typed/main.rkt:819:0: typecheck-defns
 /Users/jack/Library/Racket/5.3/collects/plai-typed/main.rkt:1843:0
 /Applications/Racket v5.3/collects/racket/private/misc.rkt:87:7

Am I doing something wrong, or is this a small bug?

*Created by: metajack* If I use the plai-typed from here: http://www.cs.brown.edu/courses/cs173/2012/plai-typed-2012年09月16日-2.plt (new version created for the class here: http://www.cs.brown.edu/courses/cs173/2012) I can't get modules to load in Geiser, even though they load in DrRacket. For example: ``` scheme #lang plai-typed (define-type ExprC [numC (n : number)] [plusC (l : ExprC) (r : ExprC)] [multC (l : ExprC) (r : ExprC)] [ifC (test : ExprC) (then-case : ExprC) (else-case : ExprC)]) ``` gives me: ``` ?: don't know how to typecheck in: #<void> errortrace...: context...: /Users/jack/Library/Racket/5.3/collects/plai-typed/main.rkt:819:0: typecheck-defns /Users/jack/Library/Racket/5.3/collects/plai-typed/main.rkt:1843:0 /Applications/Racket v5.3/collects/racket/private/misc.rkt:87:7 ``` Am I doing something wrong, or is this a small bug?
jaor commented 2012年09月17日 12:04:31 +02:00 (Migrated from gitlab.com)
Copy link

?: don't know how to typecheck
in: #
errortrace...:
context...:
/Users/jack/Library/Racket/5.3/collects/plai-typed/main.rkt:819:0: typecheck-defns
/Users/jack/Library/Racket/5.3/collects/plai-typed/main.rkt:1843:0
/Applications/Racket v5.3/collects/racket/private/misc.rkt:87:7

Am I doing something wrong, or is this a small bug?

I see that message too, but it's harmless here: the modules compile and
the rest of functionality seems there.

The message is a failed type inference upon entering the module, but
that's just an error with the typed REPL printer trying to ascertain the
type of ,enter and printing the type annotation for its value.

That is, for me the message above doesn't break any of geiser's
functionality: does it do for you?

> ?: don't know how to typecheck > in: #<void> > errortrace...: > context...: > /Users/jack/Library/Racket/5.3/collects/plai-typed/main.rkt:819:0: typecheck-defns > /Users/jack/Library/Racket/5.3/collects/plai-typed/main.rkt:1843:0 > /Applications/Racket v5.3/collects/racket/private/misc.rkt:87:7 > > Am I doing something wrong, or is this a small bug? I see that message too, but it's harmless here: the modules compile and the rest of functionality seems there. The message is a failed type inference upon entering the module, but that's just an error with the typed REPL printer trying to ascertain the type of ,enter and printing the type annotation for its value. That is, for me the message above doesn't break any of geiser's functionality: does it do for you?
jaor commented 2012年09月17日 14:25:33 +02:00 (Migrated from gitlab.com)
Copy link

Created by: metajack

Indeed, it does work. I also noticed that (require "foo.rkt") works fine as you'd expect.

Is there a way to make ,enter typecheck? :)

*Created by: metajack* Indeed, it does work. I also noticed that (require "foo.rkt") works fine as you'd expect. Is there a way to make ,enter typecheck? :)
jaor commented 2012年09月17日 15:54:29 +02:00 (Migrated from gitlab.com)
Copy link

Is there a way to make ,enter typecheck? :)

i don't know yet :)

> Is there a way to make ,enter typecheck? :) i don't know yet :)
jaor commented 2012年09月23日 23:50:52 +02:00 (Migrated from gitlab.com)
Copy link

Created by: metajack

I'm not sure if this can be done in Geiser, since it just sends ,enter "module.rkt". However, I have found a potential fix for plai-typed:

--- /Users/jack/Library/Racket/5.3/collects/plai-typed/main.rkt 2012年09月23日 15:17:11.000000000 -0600
+++ /Users/jack/tmp/main.rkt 2012年09月23日 15:18:36.000000000 -0600
@@ -1544,6 +1544,8 @@
 (make-num expr)]
 [(string? (syntax-e expr))
 (make-str expr)]
+ [(eq? (void) (syntax-e expr))
+ (void)]
 [else
 (raise-syntax-error #f
 "don't know how to typecheck"

The only way I can think to do it in Geiser is to wrap ,enter in something that will run it untyped, but I'm not enough of a Racket developer to know how to do that offhand.

*Created by: metajack* I'm not sure if this can be done in Geiser, since it just sends `,enter "module.rkt"`. However, I have found a potential fix for plai-typed: ``` diff --- /Users/jack/Library/Racket/5.3/collects/plai-typed/main.rkt 2012年09月23日 15:17:11.000000000 -0600 +++ /Users/jack/tmp/main.rkt 2012年09月23日 15:18:36.000000000 -0600 @@ -1544,6 +1544,8 @@ (make-num expr)] [(string? (syntax-e expr)) (make-str expr)] + [(eq? (void) (syntax-e expr)) + (void)] [else (raise-syntax-error #f "don't know how to typecheck" ``` The only way I can think to do it in Geiser is to wrap ,enter in something that will run it untyped, but I'm not enough of a Racket developer to know how to do that offhand.
jaor commented 2012年09月24日 00:05:39 +02:00 (Migrated from gitlab.com)
Copy link

Hi Jack,

I'm not sure if this can be done in Geiser, since it just sends ,enter
"module.rkt". However, I have found a potential fix for plai-typed:

--- /Users/jack/Library/Racket/5.3/collects/plai-typed/main.rkt 2012年09月23日 15:17:11.000000000 -0600
+++ /Users/jack/tmp/main.rkt 2012年09月23日 15:18:36.000000000 -0600
@@ -1544,6 +1544,8 @@
(make-num expr)]
[(string? (syntax-e expr))
(make-str expr)]

  •  [(eq? (void) (syntax-e expr))
    
  •  (void)]
     [else
     (raise-syntax-error #f
     "don't know how to typecheck"
    

The only way I can think to do it in Geiser is to wrap ,enter in
something that will run it untyped, but I'm not enough of a Racket
developer to know how to do that offhand.

I'll take a look, but i don't know how to do that offhand either... the
code in plai's main.rkt is also, er, not straightforward to follow: it
would seem that adding those two lines there would actually be a fix
for plai-typed (in which case we could report the issue upstream), but
i'm not sure about that.

Hi Jack, > I'm not sure if this can be done in Geiser, since it just sends ,enter > "module.rkt". However, I have found a potential fix for plai-typed: > > --- /Users/jack/Library/Racket/5.3/collects/plai-typed/main.rkt 2012年09月23日 15:17:11.000000000 -0600 > +++ /Users/jack/tmp/main.rkt 2012年09月23日 15:18:36.000000000 -0600 > @@ -1544,6 +1544,8 @@ > (make-num expr)] > [(string? (syntax-e expr)) > (make-str expr)] > - [(eq? (void) (syntax-e expr)) > - (void)] > [else > (raise-syntax-error #f > "don't know how to typecheck" > > The only way I can think to do it in Geiser is to wrap ,enter in > something that will run it untyped, but I'm not enough of a Racket > developer to know how to do that offhand. I'll take a look, but i don't know how to do that offhand either... the code in plai's main.rkt is also, er, not straightforward to follow: it would seem that adding those two lines there would actually be a _fix_ for plai-typed (in which case we could report the issue upstream), but i'm not sure about that.
jaor commented 2012年09月24日 00:07:44 +02:00 (Migrated from gitlab.com)
Copy link

Created by: metajack

I did report it upstream, but thought I'd post it here as well in case anyone found the issue this way.

*Created by: metajack* I did report it upstream, but thought I'd post it here as well in case anyone found the issue this way.
jaor commented 2020年07月20日 07:01:41 +02:00 (Migrated from gitlab.com)
Copy link

changed the description

changed the description
jaor commented 2020年07月20日 07:01:42 +02:00 (Migrated from gitlab.com)
Copy link

moved from jaor/geiser#2

moved from jaor/geiser#2
Sign in to join this conversation.
No Branch/Tag specified
master
0.16
0.14
0.11.2
0.11.1
0.11
0.9
0.10
0.8.1
0.8
0.7
0.6
0.5
0.4
0.3
0.2.2
0.2.1
0.2
0.1.4
0.1.3
0.1.2
0.1.1
0.1
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
geiser/racket#7
Reference in a new issue
geiser/racket
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?