Re: On function names and such like

> 
> One thing we could do is define a new namespace “gn” with functions
> that work more logically, that treat sequences, arrays, and maps, as
> collections and operate on them uniformly. 
> 

I've certainly been wondering about doing that for a new set of collection-oriented functions that treat arrays and sequences uniformly.

But it breaks down because the data models for arrays and sequences have a fundamental difference.

With arrays, operations designed to select a single value (like get()) are fundamentally different from operations designed to select a set of values (like filter()) because single values are fundamentally different from collections of values. With sequences, that is not the case; the same operation can be used whether the expected result is a sequence or a singleton.

We actually spent about 2 years of the 3.0/3.1 specification process trying to find a solution to this problem and failing to come up with anything better than what we've got. Finding a better solution now is even harder because we've got extra compatiibility constraints. Let's work within the limitations of what we've got.

Mike

Received on Wednesday, 13 December 2023 11:56:20 UTC