[Grace-core] Generics

Kim Bruce kbbruce47 at gmail.com
Thu Jun 11 15:27:15 PDT 2015


I was surprised to find out today that minigrace will only allow generics
if there are no spaces on either side of the "<".  Thus
     def edge: List <Line> = list.empty<Line>
is illegal, while
     def edge: List<Line> = list.empty<Line>
is legal.  (Similarly with putting a space after "empty".)

I had assumed that in our previous discussion that "<" as less than
required spaces on both sides, NOT that generics required NO SPACES on
either side.  I definitely disagree with that requirements as my current
programming style requires spaces before and after parens in parameter
lists, e.g. line.from (5 @ 7) to (34 @ 55) on (canvas), and it would make
sense to be consistent with type parameters: list.with <String> ("a", "b")

In fact, I'm not sure what rules minigrace uses currently as print(4<5)
executes fine with "<" as the relation symbol.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailhost.cecs.pdx.edu/pipermail/grace-core/attachments/20150611/ab689b57/attachment.html>


More information about the Grace-core mailing list