On Tue, Dec 05, 2000 at 11:12:01PM -0500, Bradley M. Kuhn wrote:
> helps people think about the issues.  However, I would like it to be
> possible for a programmer of language Foobar to take the specification of
> the data structures and implement them directly in Foobar without too much
> trouble.  The fewer C-isms in the high-level spec, the easier such a task
> will be.

I agree
 
> As the RFC 125 discussed, I think the interfaces for data structures and
> other APIs to be somewhat object-oriented.  Basically, something like:
> 
>    An SV must answer the following methods:
> 
>       UnicodeString toString()  # returns the scalar value as Unicode string
>       ASCIIString   toString()  # returns the scalar value as an ASCII string
>       int32         toInt()     # returns the scalar value as a 32-bit int.
>    
> 
> or something like that.  

2 things the above reminds me to watch out for

       int32         toInt32()

don't assume anything about integer sizes (or any machine native type sizes
or precisions, or that floating point can (or can't) preserve integers)

      UnicodeString toString()  # returns the scalar value as Unicode string
      ASCIIString   toString()  # returns the scalar value as an ASCII string

C++ implementors will have fun with names that assume one can overload on
return type.


These won't be the only things to be wary of. Presumably a list of such
guidelines are something useful for someone to maintain on the meta-design
list. (Is maintaining such a document an "apprentice" job? (see perl6-meta))

Nicholas Clark

Reply via email to