[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

type-of



Is it absolutely impossible to define TYPE-OF more specific than 
the current CLtL ?
I have been seen many problems derived from the underspecification of TYPE-OF.
As one of the users of PCL since Feb. on several different CommonLisp 
implementation, I felt PCL might get more portability if TYPE-OF can be more defined.

I had sent a mail to several key persons about the possiblity of new definition of TYPE-OF,
but thier answers were pesimistic to do so.
The main reason of them is 
'it is impossible or very hard to determine "the most-specific type"
among lots of CL implementations.'

I know there are many implementation designs and we cannot standardize it.
But, on the langauage specification level not on the hardware level,
we can define "the most specific type" of object according to 2.15 of CLtL.
Or 2.15 of CLtL should be updated to copy with TYPE-OF.

I had wrote a hierarchy chart based on 2.15.
which is attached on the japanese edition of CLtL.

Here is a brief sketch of it.

T>{pathname,stream,hash-table,readtable,package,random-state,
   sequence,symbol,array,character,number}
   
   sequence>{list,vector}
     list>{cons,null}
   symbol>{null}
   array>{vector,simple-array}
     vector>{string,bit-vector}
     simple-array>{simple-string,simple-bit-array,simple-vector}
     string>{simple-string}
     bit-vector>{simple-bit-vector}
   charcter>{string-char}
     string-char>{standard-char}
   number>{rational,float,complex}
     rational>{integer,ratio}
     integer>{fixnum,bignum}
     float>{short-float,single-float,double-float,long-float}

   where 'a>b' means 'a is the direct super of b, or b is just connected
   to a as a direct subtype'

   I tried to define 'terminal types'
   terminal-types={pathname,stream,hash-table,readtable,package,
     random-state,cons,null,simple-string,
     simple-bit-vector,simple-vector,standard-char,fixnum,bignum,
     ratio,short-float,single-float,double-float,long-float,complex}
   terminal-types are types which do not appear on the left of the above '>'.
   (keyword type was not appeared in 2.15, so keyword is not included here.)

   Roughly, I imagine the value of TYPE-OF should be,
     the symbol (not the list) of the most specific type among
     terminal-types or higher types which are listed above or nil.
     (do not permit the lower hardware dependent types)
     'nil' is for undefined object, say unreadable objects.

 I am writing an educational CommonLoops interpreter (the first version was
represented at the conf. of JSSST and IPSJ).
in it, I have a strong desire to get the firm definition of TYPE-OF.

 I also have a suggestion from friends that
     'there is a CLASS-OF in PCL'.
but CLASS-OF also need the detailed definition
on the built-in-classes.
  If CLASS-OF is the right things to discuss,
I have no problem to shift the discussion  to CLASS-OF.


     Masayuki Ida

     PS: there is no Ethernet-like link between US and Japan.
     (though there is a firm link between us)
     So, my response will be not timely. Sorry.