blob: b93e3cda4b896d3e4822eccc5c44a3d7a9eca77a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
Could OO-only mode limit functional programming?
OO-mode = that all functions must belong to a class.
Java had a similar problem when they added filters etc.,
and had to add :: syntax to allow methods to be referenced etc.
But maybe it is good to have a context parameter (the object!)
in every case? It's something that people often think is missing
in functional API's in C (e.g. bsearch, qsort, and custom function
with a similar design).
For example, how to filter lists?
List newlist = oldlist.filter (el -> not el.is_old)
This could operate in batches (via batched parameters in the language)
in order to get decent performance.
|