[racket] typed racket, eval and enter!

From: Jose A. Ortega Ruiz (jao at gnu.org)
Date: Fri Jan 3 19:36:44 EST 2014

Hi,

While trying to provide good support to typed racket in Geiser (an Emacs
interface to Racket and Guile) i've run into a problem similar to the
following one.

Using plain racket 5.3.6 (in a terminal, no Emacs or Geiser involved
here), and the following file:

------ test.rkt --------
#lang typed/racket

(define: j : Number 10)
(define: k : Number 20)
------ eof test.rkt -----

here's a very short racket session illustrating the problem:

    [/home/jao/tmp]$ racket
    Welcome to Racket v5.3.6.
    > (compile-enforce-module-constants #f)
    > (require "test.rkt")
    > (eval '(define: jk : Number (+ j k)) (module->namespace '(file "test.rkt")))
    > (eval 'jk (module->namespace '(file "test.rkt")))
    20
    > (enter! "test.rkt")
    > j
    - : Number
    10
    > k
    - : Number
    10
    > jk
    stdin::214: Type Checker: untyped identifier jk
      in: jk
    > 

As you can see, one can eval forms in a typed namespace without problem,
but entering the namespace and asking for a value defined via eval
produces an error.

Am i doing or expecting something wrong?

Thanks in advance,
jao
-- 
If a listener nods his head when you're explaining your program, wake
him up.
  - Alan Perlis, Epigrams in Programing

Posted on the users mailing list.