How about a LENGTH operator?
Posted: Wed Aug 13, 2008 3:25 pm
I found the package of FOREIGN string operators not only very useful but also informative--even though I don't know Java I might just be able to learn enough from them to write a simple FOREIGN operator myself!
I was surprised not to find OPERATOR LENGTH ( C CHAR ) RETURNS INTEGER in that package, but I did spot LAST_INDEX_OF and so was easily able to make my own NATIVE (?) implementation of LENGTH:
OPERATOR LENGTH ( C CHAR ) RETURNS INTEGER ; RETURN LAST_INDEX_OF ( C, '' ) ; END OPERATOR ;
which pleased me no end!
Now tell me that LENGTH is defined in some other package, or there's some other reason why I din't need to do that.
Hugh
I was surprised not to find OPERATOR LENGTH ( C CHAR ) RETURNS INTEGER in that package, but I did spot LAST_INDEX_OF and so was easily able to make my own NATIVE (?) implementation of LENGTH:
OPERATOR LENGTH ( C CHAR ) RETURNS INTEGER ; RETURN LAST_INDEX_OF ( C, '' ) ; END OPERATOR ;
which pleased me no end!
Now tell me that LENGTH is defined in some other package, or there's some other reason why I din't need to do that.
Hugh