News for hackers. Stuff that matters.
Re:Try Clojure by widdershins on Wednesday May 22, 2024 @03:00PM (#40444784)
Using the same notation for function calls and math operators has many benefits that may not be immediately obvious, and which may (depending on preference) outweigh the unfamiliarity. For example:

No operator precedence rules to remember.

Use math operators in higher order functions:

    (reduce [1 2 3] +)
    (compose + \*)
Simpler parser in the language.

Use kebab-case variable names.

Use most symbols in variable names.

The last two are because of reduced ambiguity in the language. The benefits for readability can be huge. For example, I love question marks for predicates in Scheme.

    (vector? x)
    (filter [1 2 3 4 5] odd?)
I'm sure there are more benefits that I haven't thought of.
Re:Try Clojure by ReleaseCandidat on Wednesday May 22, 2024 @03:23PM (#40445122)
> Use math operators in higher order functions:

To be fair, there just needs to be syntax for passing infix functions as a "normal" function, like parens in Haskell

  (reduce [1 2 3] +)
  foldl' (+) 0 [1, 2, 3]

And to allow `?` in names, it "just" shall not be used elsewhere.