3 ms·
About \, yes it's the possible clash with a real quote. More an inconvenience to the reader that a source of bugs, but also that. About ranges, Ruby has both .
by pmontra 10y ago
About \, yes it's the possible clash with a real quote. More an inconvenience to the reader that a source of bugs, but also that.
About ranges, Ruby has both .. and ... and after 12 years I don't remember which is what. Maybe an inclusive one is enough and 1..(n-1)
About syntax in general, it should be easy for developers no matter how hard it is for the compiler/interpreter to parse it. I don't like to have to type useless characters. Hence the () around if conditions and this extension thing. What else can it be? I'm defining a method of a class, no need for a special block. But I don't understand your "has to be repeated for every addition" so maybe I'm missing something important here.
- jdsampayo 10y ago"When you see that third dot, imagine opening the accordion slightly. Just enough to let one note from its chamber. The note is that end value. We’ll let the sky eat it." - http://poignant.guide/book/chapter-3.html#section2 http://poignant.guide/book/chapter-3.html#section2
- masklinn 10y ago> About \, yes it's the possible clash with a real quote. Clash with a real quote? As in you paste random text from wherever and it turns out evaluated? You've got the exact same issue in Kotlin. > About ranges, Ruby has both .. and ... and after 12 years I don't remember which is what. Maybe an inclusive one is enough and 1..(n-1) That's why I like that Swift uses "a..<b" for exclusive, you clearly see the top-bound being excluded from the range. It's readable and smart design. > Maybe an inclusive one is enough and 1..(n-1) I have never missed inclusive ranges in languages with only exclusive ranges (e.g. Python), the opposite would not be true. > About syntax in general, it should be easy for developers no matter how hard it is for the compiler/interpreter to parse it That way lie Perl and C++ and undecidable syntaxes, I'm very much opposed to that. > I don't like to have to type useless characters. I don't see what's useless about saying what you're asking for. You define a struct your use a struct block, you define a protocol you use a a protocol block, you define an extension you use an extension block. It's readable and regular. > But I don't understand your "has to be repeated for every addition" so maybe I'm missing something important here. If you're adding more than one item in Kotlin you have to repeat the receiver e.g. val Double.km = (thing) val Double.miles = (thing) val Double… in Swift you just wrap it all in an extension block: extension Double { val km = (thing) val miles = (thing) val ... }