3 ms·
Unlike in Scala, you can chain your custom methods in D. For example, seqOfChars.map!(a => a.toLower).filterIfNotDigitChar.sort.uniq; is simply not possible in
by tastyminerals2 6y ago
Unlike in Scala, you can chain your custom methods in D.
For example, seqOfChars.map!(a => a.toLower).filterIfNotDigitChar.sort.uniq; is simply not possible in Scala.
Here is a great presentation about fp in D: http://beza1e1.tuxen.de/stuff/FunctionalD.pdf http://beza1e1.tuxen.de/stuff/FunctionalD.pdf
- rbonvall 6y agoIt is possible in Scala: https://scastie.scala-lang.org/k7bHR6EWS7qXvaC8gIj3VA https://scastie.scala-lang.org/k7bHR6EWS7qXvaC8gIj3VA (Unless you mean something different).
- tastyminerals2 6y agoTrue. I forgot about implicits (because I try not to use them :). Unfortunately it looks more like a kludge tbo. Sort and uniq get also hidden in a class which can be tucked away from your eyes and this is never good.
- qznc 6y agoThanks for calling my presentation "great". I don't design my slides to work without me talking though. The official tour has a short page about FP as well: https://tour.dlang.org/tour/en/gems/functional-programming https://tour.dlang.org/tour/en/gems/functional-programming Anyways, since Walter is probably reading this: Any new insights around this quote five years later? > I know a lot of the programming community is sold on exclusive constraints (C++ concepts, Rust traits) rather than inclusive ones (D constraints). What I don't see is a lot of experience actually using them long term. They may not turn out so well. –Walter Bright