3 ms·
> The meaning of a program is its behavior, period. If reality doesn't agree with your views, it's your fault, not reality's. That's not the usual meaning of,
by lmm 9y ago
> The meaning of a program is its behavior, period. If reality doesn't agree with your views, it's your fault, not reality's.
That's not the usual meaning of, well, meaning.
> Standard ML doesn't give you any way to get the memory address of a particular value, so values that are semantically identical are actually indistinguishable in practice.
Just tried it to be sure:
fun address i = Unsafe.cast(ref i) : Int32.int ;;
val a = 4 :: nil ;;
val b = 4 :: nil ;;
address (a) ;;
address (b) ;;
address (a) ;;
And yep, a and b are semantically identical values but distinguishable in practice:
val address = fn : 'a -> Int32.int
val a = [4] : int list
val b = [4] : int list
val it = ~175003712 : Int32.int
val it = ~174998232 : Int32.int
val it = ~175003712 : Int32.int
- catnaroek 9y agoSML/NJ is not an implementation of Standard ML. It's known to be non-conformant in several ways: http://mlton.org/SMLNJDeviations http://mlton.org/SMLNJDeviations