https://kotlinlang.org logo
Title
h

Hullaballoonatic

10/19/2018, 5:25 AM
So I think I answered my own first question. The functionality can be implemented and made into a library, but the syntax cannot be. It'd have to be a PR to the compiler that kotlin team accepted, or something?
e

elizarov

10/19/2018, 5:41 AM
You can have
var x by setOf(1,2,3)
syntax
h

Hullaballoonatic

10/19/2018, 4:13 PM
as in to implement the features, or does that delegation functionality already exist?
set notation definitely wouldn't show up before collection literals show up... if ever!
e

elizarov

10/19/2018, 4:29 PM
As in you can easily implement it in your code so that this syntax works
h

Hullaballoonatic

10/19/2018, 4:30 PM
cool. i'll work on it!
do you think
var x in setOf(1,2,3)
would work too?
i know i can transform
setOf()
into
CO{}, OO{}, CC{}, OC{}
also.. for closed and open respectfully
for use in interval notation, i mean
of course it would look so much nicer as
[x,y)
,
(x,y)
,
[x,y]
,
(x,y]