[Grace-core] [A Graceful Blog] Comment: "From Lancaster to Portland"

Andrew P. Black black at cs.pdx.edu
Mon Sep 26 11:07:38 PDT 2011


On 24 Sep 2011, at 21:53, James Noble wrote:

>> One way to think about branding is that each branded object, in addition to having its real methods, has an additional nullary method called #<gensym>#...
> 
> Yep - this would work, as would a simple convention about naming methods.
> 
> The catch with a magic name is - how would you write it when you wanted to match against it?
> If you can write it elsewhere, it's "just a convention"; if not, then presumably you need access
> to a pattern (or type) that will match the branded object / class instances --- which comes 
> down to making each class a nominal type, or at least deriving such a type from the class...


I would include "brand someName" in the type signature (along with method add()and(), etc.)   For the purpose of type checking , an brand operates just like a parameterless method.    The only difference is that the method's name is really #someName#, and you can't request a method with a name like that, because the corresponding message request is a syntax error.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailhost.cecs.pdx.edu/mailman/private/grace-core/attachments/20110926/73eb57ee/attachment.html>


More information about the Grace-core mailing list