[Grace-core] A little bit of the String library

Michael Homer mwh at ecs.vuw.ac.nz
Tue May 24 21:10:51 PDT 2011


On Wed, May 25, 2011 at 1:09 PM, Kim Bruce <kim at cs.pomona.edu> wrote:
> On May 21, 2011, at 8:48 AM, Andrew P. Black wrote:
>
>> Folks,
>>
>> While on a train, with a few hours to kill (and electricity!) I started writing a little bit of Grace code — a start at the String library — because I need more example code to test the parser.  My code is attached.
>> || for String concatenation?
>>
>> I wanted to use // for integer division.  But we have already taken it to mean "comment".    Switch to "--" for comments?
>
> Both fine for me, but we should try to lock these minor syntax points up fairly rapidly.

The specification currently uses ++ for concatenation, which seems
clearer to me unless there's a pressing desire to use that operator
for something else.

As used there it also appears to be a coercing concatenation ("Pi = "
++ pi), rather than String ++ String. I have implemented it so far
with automatic coercion by asString from any object.
-Michael


More information about the Grace-core mailing list