Wendell
2009-12-17 00:01:28 UTC
I've discovered the bizarre behavior of interactive ML when redefining
objects. It allows you to create a new object with a repeated name,
but objects referencing the name from an earlier stage keep it with
the old value.
I know ML is said to have static assignment, but I expected something
like "Error: Can't define foo because it already exists." The default
behavior just seems insane. I don't see how any significant program
could be maintainable under this system.
So a few questions:
1. How do you modify a running program? I'd like to prototype
algorithms using named variables and observe the effects of changing
the values of the variables.
2. How do you find all current values assigned to a name and where
they are scoped?
3. Do the newer functional languages like F# and Haskell also behave
this way?
objects. It allows you to create a new object with a repeated name,
but objects referencing the name from an earlier stage keep it with
the old value.
I know ML is said to have static assignment, but I expected something
like "Error: Can't define foo because it already exists." The default
behavior just seems insane. I don't see how any significant program
could be maintainable under this system.
So a few questions:
1. How do you modify a running program? I'd like to prototype
algorithms using named variables and observe the effects of changing
the values of the variables.
2. How do you find all current values assigned to a name and where
they are scoped?
3. Do the newer functional languages like F# and Haskell also behave
this way?