[Grace-core] Class syntax and type parameters

Andrew P. Black black at cs.pdx.edu
Fri Nov 14 16:12:16 PST 2014


On 14 Nov 2014, at 15:54, Marco Servetto <marco.servetto at gmail.com> wrote:

> On 15 November 2014 06:36, Andrew P. Black <black at cs.pdx.edu> wrote:
>> But I really don’t want to use a different notation for parameterizing methods.
> 
> Ok, I  may start getting boring and repetitive, but why we need
> parametrized methods? can I have a single example of a parametrized
> method that we want our beginner students to be able to

—  use:  list<Number>.empty

> —design themsel[ves] ?

I don’t see beginners designing methods with type parameters.   But I do see them using them, assuming that their instructor teaches types.

The difficulty (and th motivation for a special notation) , is that we would like a single collections module, which can be used both by typeless and typed students.
So not only do we have to allow something like list<Number>.empty, we also have to allow list.empty.

Currently, that’s what the angle-braket syntax allows.  list.empty means list<Unknown>.empty.

	Andrew



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailhost.cecs.pdx.edu/pipermail/grace-core/attachments/20141114/aa4ddd9f/attachment.html>


More information about the Grace-core mailing list