htdp icon indicating copy to clipboard operation
htdp copied to clipboard

Placeholders break function calls in interactions window

Open michaelballantyne opened this issue 8 years ago • 7 comments

With these BSL definitions:

(define (f x)
  ...)

(define (g x)
  x)

entering either (g 5) or (f 5) in the interactions pane results in a nasty ambiguous binding error for #%app:

#%app: identifier's binding is ambiguous
  context...:
   #(-967113051640681897 module) #(-967113051640681896 module teach 0)
   #(-967113051640681890 use-site) #(44611 module) #(44612 module #%htdp 0)
   #(44615 macro) #(50001 module) #(50002 module #%htdp 0) #(55328 module)
   #(55329 module #%htdp 0) #(60669 module) #(60670 module #%htdp 0)
   #(66014 module) #(66015 module #%htdp 0) #(69516 macro)
  matching binding...:
   #<module-path-index:((lib "lang/htdp-beginner.ss"))>
   #(44611 module) #(44612 module #%htdp 0) #(50001 module)
   #(50002 module #%htdp 0) #(55328 module) #(55329 module #%htdp 0)
  matching binding...:
   #<module-path-index:((lib "lang/htdp-beginner.ss"))>
   #(44611 module) #(44612 module #%htdp 0) #(50001 module)
   #(50002 module #%htdp 0)
  matching binding...:
   #<module-path-index:(mzscheme)>
   #(-967113051640681897 module) #(-967113051640681896 module teach 0)
  matching binding...:
   #<module-path-index:((lib "lang/htdp-beginner.ss"))>
   #(44611 module) #(44612 module #%htdp 0)
  matching binding...:
   #<module-path-index:((lib "lang/htdp-beginner.ss"))>
   #(44611 module) #(44612 module #%htdp 0) #(50001 module)
   #(50002 module #%htdp 0) #(55328 module) #(55329 module #%htdp 0)
   #(60669 module) #(60670 module #%htdp 0)
  matching binding...:
   #<module-path-index:((lib "lang/htdp-beginner.ss"))>
   #(44611 module) #(44612 module #%htdp 0) #(50001 module)
   #(50002 module #%htdp 0) #(55328 module) #(55329 module #%htdp 0)
   #(60669 module) #(60670 module #%htdp 0) #(66014 module)
   #(66015 module #%htdp 0)
  context at layer 1...:
   #(-967113051640681897 module) #(-967113051640681896 module teach 0)
   #(-967113051640681890 use-site) #(44611 module) #(44612 module #%htdp 0)
   #(44615 macro) #(50001 module) #(50002 module #%htdp 0) #(55328 module)
   #(60669 module) #(66014 module) #(69516 macro)
  matching binding at layer 1...:
   #<module-path-index:((lib "lang/htdp-beginner.ss"))>
   #(44611 module) #(44612 module #%htdp 0) #(50001 module)
   #(50002 module #%htdp 0)
  matching binding at layer 1...:
   #<module-path-index:(mzscheme)>
   #(-967113051640681897 module) #(-967113051640681896 module teach 0)
  matching binding at layer 1...:
   #<module-path-index:((lib "lang/htdp-beginner.ss"))>
   #(44611 module) #(44612 module #%htdp 0)

Tested in 6.10.1 and 6.11.

michaelballantyne avatar Nov 15 '17 17:11 michaelballantyne

This is NOT the case for the built-in teaching languages:

Welcome to DrRacket, version 6.11.0.2--2017-11-01(-/f) [3m]. Language: Intermediate Student with lambda [custom]; memory limit: 256 MB. Teachpacks: universe.rkt, 2htdp/image.rkt, and batch-io.rkt.

(f 5) ...: expected a finished expression, but found a template

And I can’t reconstruct this in #lang:

Welcome to DrRacket, version 6.11.0.2--2017-11-01(-/f) [3m]. Language: htdp/isl+, with debugging; memory limit: 256 MB.

(f 5) . . ...: expected a finished expression, but found a template (g 5) 5

mfelleisen avatar Nov 15 '17 17:11 mfelleisen

I forgot I also had tracing enabled. It seems to only happen with Beginning Student + Tracing; ISL and ASL seem ok.

michaelballantyne avatar Nov 15 '17 17:11 michaelballantyne

I also see this behavior when in BSL + Tracing. Otherwise I get the expected ... - error message.

LeifAndersen avatar Nov 15 '17 17:11 LeifAndersen

Tracing seems broken in other ways too. A student reported this via the bug reporter a few weeks ago.

mfelleisen avatar Nov 15 '17 18:11 mfelleisen

Would it make sense to disable tracing for the menu-based student languages? If these problems don't exist in the #lang versions we can avoid this and #44 until those are ready.

florence avatar Nov 15 '17 18:11 florence

Tracing only exists for the student languages. There's no option for it in #lang mode.

samth avatar Nov 15 '17 18:11 samth

Yes disabling them makes complete sense.

mfelleisen avatar Nov 15 '17 18:11 mfelleisen