[M3devel] small objects

Mika Nystrom mika at async.caltech.edu
Fri Apr 10 02:04:23 CEST 2009


Sorry to splice together two emails from you, but I feel I've already
used up my m3devel quota this week:

"Rodney M. Bates" writes:
>> Are you sure?  I want a type---some type---that can hold "any
>> reference, even a tagged one", and I would rewrite most library
>> code that today takes REFANY to take that instead.  Why not?  Why
>> would I want to limit it to REFANY when it performs no operations
>> that couldn't legally be performed on TAGGED REFANY.
>>
>
>I believe my "safe" proposal would make this very simple, if I am
>thinking of the kind of library code you are.
>  
>I envision a container data structure that takes in things and returns
>them without performing operations on them other than moving them around
>and storing them, e.g. the ever belabored stack.   The values going in
>and out are declared REFANY, and the client passes in values of
>some proper subtype of REFANY, which get assigned to the REFANY
>parameters.   When it gets them back, it narrows them to this type.   
>
>In this pattern, just changing the declared type of the container values
>from REFANY to TAGGED REFANY would do it.  The library code's storage
...
>> you'd like to store these in a REFANY and dynamically test for the 
>> appropriate tagged type:
>
>No, I do not want to store these in a variable of type REFANY or any 
>other existing type. 
>In fact, I want to forbid it.

I think you are thinking of exactly the same kind of library code.
TextRefTbl.T, RefList.T, etc.

After the introduction of TAGGED REFANY, what use is there for
REFANY?  What piece of code can you think of where the cost of the
1-LSB check of TAGGED REFANY outweighs the convenience of being
able to process objects of type TAGGED T (for all ref types T) as
well as objects of type T?

    Mika



More information about the M3devel mailing list