racket / racket/htdp

Placeholders break function calls in interactions window

Open
#47 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Racket
Stars
112
Forks
73
Avg merge
9h 41m
Merged PRs (30d)
1

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the (g 5) and (f 5) examples in the interactions pane with the definitions shown, then trace how placeholder definitions and interaction expressions are handled. Done means both calls evaluate without the ambiguous #%app binding error in the affected language levels.

Written by the indexing model from the issue text.

Assessment

Domain
developer-experience
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.