[Date Prev] [Date Next] [Thread Prev] [Thread Next] Date Index Thread Index Search archive:
Date:Mon Jun 30 19:05:20 1993 
Subject:Re: uinref (was Re: Not a bug but a feature?) 
From:ianr (Ian Rogers) 
Volume-ID:930630.11 


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.