سؤال

I have two refs in SML:

val a = ref 5; val b = ref 6;

Currently a = b evaluates to false. Is it possible to somehow assign variable b so that a = b evaluates to true? Thanks

هل كانت مفيدة؟

المحلول

No. It's not, they are pointers to different object.

Technically you could do

val a = ref 5;
val b = a;

That would work.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top