Object

lib/Object.gob

No module comment.

class Object a

A type whose values are objects: built with a position that can be assigned, so two of them built alike can be told apart by assigning through one. identical tells them apart without assigning.

Instances are derived by the compiler, which writes identical, and a program may not write one. They are exactly the types whose every value has stable identity: an array, an atomic cell, a record with a var field, and a one-field wrapper over one of those. (A type whose every constructor had a var field or none would qualify too, but var is allowed only in a type with one constructor.) A value of any other type may be copied or rebuilt from its fields wherever the compiler likes, so identity on it would answer differently from one build to the next.

fun identical : [Object a] fun(a, a) -> Bool

Returns whether the two arguments are the same object. Two objects equal under == need not be identical; an object is identical to itself.