[Grace-core] Fwd: Query on built-in objects

James Noble kjx at ecs.vuw.ac.nz
Mon Jun 18 23:46:46 PDT 2012


> but leave the implicit conversions to the string interpolations.

right. I"m happy with one exception to every "rule" 
(although I'm happier with none)
In this case the "no implicit conversions" rule is breached,
I guess, because we don't have to write " {foo.asString} "

I guess there is also "print" which could be considered as doing an implicit conversion?
Although this also goes to the "protocol of all objects" - if every object has an asString
or toString method, then I guess print could be defined as being in the type
{ asString -> String }.  

At a tangent, I think it's good that we don't have to teach String/Sequence concatenation
on day one:   after all "{a}{b}" will do a + b when both are strings - and (especially printing)
code looks much more straightforward with interpolations.

At a further tangent:
 - perhaps print should just take a string, not a {asString -> string} and rely on the implicit conversion in the String constructor/literal.
 - but for that to work, you'd want static checking on messages to "self" even if no others

James


More information about the Grace-core mailing list