3 ms·
Some features are plain missing (or must be implemented in a convoluted manner): - Discriminated unions - Immutable data types (records) - Free functions (or
by substation13 4y ago
Some features are plain missing (or must be implemented in a convoluted manner):
- Discriminated unions
- Immutable data types (records)
- Free functions (or modules of free functions)
- Software transactional memory (STM), atoms
- Ad-hoc polymorphism (traits)
- Custom operators (used sparingly for building DSLs)
- List comprehensions
Instead we get anti-features like automatic properties, implementation inheritance, events, object initializers, etc...
- tester756 4y ago>(records) there are >- List comprehensions Enumerable.Range? >- Custom operators (used sparingly for building DSLs) Could you please show what kind of DSL you'd want to write?
- substation13 4y ago>(records) Agreed, although this a recent addition in Java and a step away from old school OOP >- List comprehensions Enumerable.Range is not equivalent to list comprehensions. For example, in F# you can build a list using a comprehension containing more or less any code you like. It's incredibly powerful for things like building HTML. >- Custom operators (used sparingly for building DSLs) These are used in many places, but to give one example https://www.cs.tufts.edu/~nr/cs257/archive/simon-peyton-jones/contracts.pdf https://www.cs.tufts.edu/~nr/cs257/archive/simon-peyton-jone...