thomasnield
06/16/2017, 3:22 AMspeshuric
06/16/2017, 4:18 AMnapperley
06/16/2017, 4:46 AMvoddan
06/16/2017, 5:30 AMlovis
06/16/2017, 7:48 AMjanvladimirmostert
06/16/2017, 10:46 AMliteral
keyword in the same way we have an operator
keyword, then users can define their own implementations for []
and {}
, but then still keep it out of the language.
Just like with operators, only define a fixed list of literals that will be supported, but don’t actually bring it into the language, if you want to use []
litereals, you need to write your own implementation for it or use third-party libs for it.janvladimirmostert
06/16/2017, 10:47 AMliteral fun String.squareBrackets(varargs String val)
voddan
06/16/2017, 11:19 AMpoohbar
06/16/2017, 12:36 PMthomasnield
06/16/2017, 1:09 PMthomasnield
06/16/2017, 1:10 PMperryprog
06/16/2017, 2:23 PMliteral
keyword so you can define your own version, you also could use Array/List liberals in table based testing for example. I also thought that it was an odd nuisance of Kotlin t hat there wasn’t any special syntax for collection literals.janvladimirmostert
06/16/2017, 2:26 PMliteral
keyword solves the problem nicely, it allows devs to use collection literals without the Kotlin devs having to worry which implementation to choose for the literal.perryprog
06/16/2017, 2:27 PMjanvladimirmostert
06/16/2017, 2:28 PMjanvladimirmostert
06/16/2017, 2:29 PMhtml : {
header: {
title: "TESTING"
},
body: {
}
}
perryprog
06/16/2017, 2:29 PMdmnk_89
06/16/2017, 2:55 PMhtml {
header {
title("TESTING")
}
body {
}
}
it can be like this in kotlin at current statejanvladimirmostert
06/16/2017, 2:57 PMperryprog
06/16/2017, 2:58 PMjanvladimirmostert
06/16/2017, 2:58 PM