groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From MG <mg...@arscreat.com>
Subject Re: [VOTE] Polish the generics type syntax for closure
Date Sun, 17 Feb 2019 20:02:21 GMT
Just assumed you were thinking of languages that are widely used... ;-)
(Algol type languages are generally not particularily syntax-compatible 
with C-style languages in my book).

My suggestion was aimed at not introducing a new syntax variety to 
Groovy, while at the same time being more concise and being able to 
grasp the return type first.

Cheers,
mg

PS: I first encountered the generics syntax used by Java when it was 
introduced in C++, and it never felt alien to me. What syntax would you 
have used to add type parameters to types, given that parameter 
sequences are seperated with colons and all other types of brackets were 
already taken ?-)



On 17/02/2019 18:56, Jochen Theodorou wrote:
> On 16.02.19 19:57, MG wrote:
>> Hi Daniel,
> [...]
>> I assume Jochen's suggestion is coming from JavaScript/Kotlin, where 
>> the type of a function (method) is given after the colon.
>
> there are many more than just those.
>
>> I think its readability is inferior to the C/C++/Java/... approach, 
>> and is only therefore suitable for often-not-typed languages such as 
>> JavaScript.
>
> actually from several Pascal style languages like Modula2 or Ada. I 
> think the C(++)/Java works well with a function name in between, but 
> with just types and without the name it works better for me in the 
> colon style.
>
>> Apart from it feeling alien to me in the Java/Groovy world, I fear 
>> next thing someone would suggest we introduce it into Groovy, which 
>> makes sense, "since we already use it in the Closure argument syntax"...
>
> to be frank everything about generics is alien. It is just that people 
> got used to it
>
> bye Jochen
>
>


Mime
View raw message