Reference type for SML

北城余情 提交于 2019-12-12 04:39:57

问题


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


回答1:


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

Technically you could do

val a = ref 5;
val b = a;

That would work.



来源:https://stackoverflow.com/questions/22235507/reference-type-for-sml

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!