[plt-scheme] Puzzled by procedure ordering.
In the following example, the procedure "Work" has no problem
in 'seeing the procedure "genproc".
However if I move the procedure in the indicated place,
Drscheme complains with the following error:
reference to an identifier before its definition: work
Any explanation ?
Regards
Maurizio
#lang scheme/gui
(define (work x y)
(let ((fun (genproc 3)))
(display (fun 5))))
(define (genproc n)
(lambda (x) (+ x n)))
(define frame (new frame% [label "test"]))
(define btok (new button% [parent frame] [label "ok"] [callback work]))
;; ---- move work here and get an error.
(send frame show #t)