This is racket v5.2.

#lang racket

(define/contract (x input)
  (y . -> . any/c)
  3)

;; (define (x input)
;;   (y)
;;   3)

(define (y)
  #t)

When I run this, I get

racket ./hmm.rkt
reference to an identifier before its definition: y in module: ...

However, if I comment out the first definition of x, and uncomment the
second, I don't get an error.

What is the difference?  Is this a bug?  It'd be nice if I could use a
defined-later-in-the-file function in my contract; otherwise I have to
carefully order the functions in the file, which makes it harder to
read the file.
____________________
  Racket Users list:
  http://lists.racket-lang.org/users

Reply via email to