fix a non-buggy set!-before-initialization in syntax-browser

What appears to be happening is that the fields path and next-push
are state variables on this class that are initialized and then used
only during the dynamic-extent of syntax-object->datum/record-paths
and of the pretty-printing code.

So, before the check was in place, they were initialized and used
before the 'path' field was initialized, but by the time the path
field was initialized, the value was junk (not going to be used again)
but it still raised an error
This commit is contained in:
Robby Findler 2014-04-18 06:54:19 -05:00
parent 9d9a1cd054
commit 34abe306e3

View File

@ -69,6 +69,8 @@ needed to really make this work:
(define/override (write stream)
(send stream put (string->bytes/utf-8 (format "~s" (marshall-syntax main-stx)))))
(define path '())
(define next-push 0)
(define-values (datum paths-ht) (syntax-object->datum/record-paths main-stx))
(define output-text (new text:hide-caret/selection%))
@ -88,8 +90,6 @@ needed to really make this work:
0
(send text last-position)))
(define path '())
(define next-push 0)
(define/private (push!)
(set! path (cons next-push path))
(set! next-push 0))