Skip to content

Shadowing #268

Answered by JohnReppy
dukester asked this question in Q&A
Apr 11, 2023 · 4 comments · 15 replies
Discussion options

You must be logged in to vote

Bindings in the REPL can be thought of as being part of a new let whose scope extends to the end of the interactive session. For your example, you have

let val OneMile = 1.609 in
let val OneMile = 1609 in
let val it = OneMile * 55 in
....

There is no way to revoke an existing binding. What you want is something that behaves like local (but the REPL does not provide that).

Replies: 4 comments 15 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
6 replies
@dmacqueen
Comment options

@dukester
Comment options

@dmacqueen
Comment options

@dukester
Comment options

@dmacqueen
Comment options

Answer selected by JohnReppy
Comment options

You must be logged in to vote
4 replies
@dukester
Comment options

@dmacqueen
Comment options

@dmacqueen
Comment options

@dukester
Comment options

Comment options

You must be logged in to vote
5 replies
@dukester
Comment options

@dmacqueen
Comment options

@dmacqueen
Comment options

@dukester
Comment options

@dmacqueen
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants