Don't want to turn this into an endless off topic thread, but:
1. Kotlin is not of the Algol/Pascal/... language tree but a C syntax
language
2. C syntax is the dominant syntax used (C/C++/Java/C#) for a reason
(with Python being the odd man out)
3. The foo : Foo syntax kind of works, as long as there is no
assignment on declaration, because then it becomes foo : Foo =
initialFooVal, which to me is just ugly, since it looks like we are
assigning initialFooVal to type Foo
4. The example was taken from a Kotlin blog, and is the Kotlin syntax
for assignment on declaration when giving an explicit type*
Kind regards,
mg
*As long as you are always using type inference (or in a weakly typed
language such as JavaScript), there is of course no explicit type, and
the syntax becomes clear & concise, the same as in Groovy (def foo =
initialFooVal).
On 09/01/2020 00:46, Angelo Schneider wrote:
Necause languages like Pascal and Modula II or Ada use:
var_name : TType; // this is a declaration of a variable named
„var_name“ and of type TType.
However in your example I assume either the var, or the „: Foo“ is
redundant. Because var is used in Kotline for type interference, if
I’m not mistaken.
Best Regards
privat: -------------------- www.oomentor.de
<http://www.oomentor.de> --------------------------
Angelo Schneider OOAD/UML angelo.schnei...@oomentor.de
<mailto:angelo.schnei...@oomentor.de>
Putlitzstr. 24 Patterns/FrameWorks
76137 Karlsruhe C++/JAVA Mob: +49 172 9873893
Am 09.01.2020 um 04:37 schrieb MG <mg...@arscreat.com
<mailto:mg...@arscreat.com>>:
These results look great, Daniel G-)
With regards to nomenclature: What is your definition of megamorphic
as compared to polymorphic ? The web does not seem to be in complete
agreement on these terms - I assume you are referring to the number
of call site cache entries needed (monomorphic: 1, polymorphic: > 1,
megamorphic: > cache size) ?
Cheers,
mg
PS: Came across some Kotlin code during my web search. Mind still
shudders at seeing the syntax
var result: Foo= calcFooResult()
used in a statically typed language - bloated, hard to read, why are
we seemingly assigning a value to a type...
On 08/01/2020 17:26, Daniel.Sun wrote:
FYI.
https://github.com/apache/groovy/pull/1135#issuecomment-571961230
-----
Apache Groovy committer & PMC member
Blog: http://blog.sunlan.me
Twitter: @daniel_sun
--
Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html