[Grace-core] Fwd: Some notes on pattern matching on the wiki
Ewan Tempero
e.tempero at cs.auckland.ac.nz
Tue Jul 5 00:24:25 PDT 2011
(I've only had half an eye on the discussion so apologies if I've missed
the point somewhere.)
I went through a phase in my early days of Java programming when I used
"this" for all self calls (and access to fields) only to find it totally
was wrong in the context of nested classes.
So what is the graceful view of nested classes anyway?
But I do like the idea of an explicit self. I speculate that it would
make places where the self call results in code in a descendent class to
be invoked (aka template methods). If the responses I got to a question
on this in the exam I marked last week is anything to go by, students
need some sort of help getting their heads around this. An explicit
receiver might help (and you know I don't like implicit things).
--ewan
On 05/07/11 19:11, James Noble wrote:
>>>> Two things => two syntaxes. Makes for easy teaching and learning.
>>>
>>> Or makes for the argument that we are unnecessarily separating things that are the same.
>>
>> If they were the same ... but they are not.
>
> that's the trick: it depends on the conceptual model.
> Newspeak& Self say "everything is a message send" and have a self-consistent
> (albeit occasionally tortured) conceptual model to justify that.
>
> I'm not quite sure why, but minigrace/js (which I've been banging on the last couple of days)
> requires an explicit self. And the code doesn't look *too* horrible!
>
> James
More information about the Grace-core
mailing list