[MLton-devel] new basis library

Matthew Fluet Matthew Fluet <fluet@CS.Cornell.EDU>
Thu, 25 Jul 2002 14:09:48 -0400 (EDT)


> I don't think so.  It is important to distinguish between arrays and
> vectors because they have different equality properties.  But I don't
> see any distinction between strings and char vectors.  You could try
> removing string from PRIM_TYCONS and adding "val string = vector char"
> to atoms/type-ops.fun and see what happens.  It looks like it will
> cause a few problems, the most difficult being that constants types
> are no longer describable via a tycon, but nothing too bad.
> 
> This sounds worth trying to me.

O.k.  I'll probably take another serious look at the basis so far over the
weekend, trying to incorporate the CharVector and String ideas and seeing
how the opaque signatures work out.

Your comment about the equality properties reminded me of one other
fact: the spec for Substring.span is supposed to have a constant time
equality test of the underlying string when they are infact the same
string.  That is it requires a pointer equlity before the char-by-char
equality.  This is accomplished now by the fact that poly-equal turns
string equality into calls to the primitive stringEqual, a C-function that
first peforms pointer equality.

Looking at poly-equal.fun, the code for an ''a vector equality does not
perform a pointer equality first, although I suspect that it wouldn't be
wrong to do so.




-------------------------------------------------------
This sf.net email is sponsored by: Jabber - The world's fastest growing 
real-time communications platform! Don't just IM. Build it in! 
http://www.jabber.com/osdn/xim
_______________________________________________
MLton-devel mailing list
MLton-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlton-devel