Jon Meyer writes:
> An idea that has bounded around for a while is to introduce a special kind of
> ref to the system which can have an 'unassigned' contents, and which is
> treated specially by `=', i.e. if its contents are unassigned then `=' returns
> true and as a side effect sets the contents to the item that it is equal to.
> If it has an assigned contents then `=' returns true only if the contents
> are = to the item.
This could be done through the class_= procedure of the uniref. but =
only ever uses the class_= of the *top* argument of the stack. So
vars funny = newuniref();
3 = funny =>
would work, but
vars funny = newuniref();
funny = 3 =>
wouldn't. The only way around this would be for = to check the second
stack item as well, before choosing which class_= to use. This would be
quite an efficiency hit I think.
Ian.
|