Closed Emmay closed 8 years ago
Reduced test case that also fails:
(define-struct w (x))
(define-struct w2 (x2))
Puzzled: I'm unable to replicate. Placing these in lines either the definition or the interaction window of spyret.herokuapp.com works OK.
How odd. I'm getting this consistently on current Chrome, Safari and Firefox, both on OSX.
Even-more-reduced test case:
(define-struct w (x))
42
Fixed in ds26gte/code.pyret.org@2311e58.
Previously, first-level sub-blocks (created by define-struct
, say) were being spliced out only if they were the only sub-block in the program, so they worked fine for the REPL (interactions window). The current fix generalizes the splicing, so works for the definitions window too with its possibly multiple top-level expressions.
Confirmed fixed.
This is an old BS:2 program that runs in Wescheme, but returns well-formedness errors in Spyret. You need to delete the (require...) line at the top, but otherwise I'm not clear what the Spyret errors are. http://www.wescheme.org/view?publicId=VkWBc8DRew
The "Cannot define a data expression except at the top level of a file" error still appears if the define-struct lines are copied to the very top of the file.