Skip to content

History / Anonymous function

Revisions

  • #1252 The function pages: a function-valued parameter or result names a signature 'function' on its own is not a type, so since 20.20.0 it is rejected in both the parameter and the result position. Function-signature, Closure and Anonymous-function showed the bare keyword as the normal spelling and a declared signature as the refinement; that is now the other way round, with a note per changed paragraph on what an older configuration has to change on upgrade. Every example on the three pages is one the battery runs: the composition and apply1 examples are fn_test_closure, adder is fn_test_closure2, twice is fn_test_gsig, so the documented spelling is the tested one. Function-signature also gains the reference forms, since a path resolves as a type reference from 20.20.0: the plain name, '../name', '.../name' and '/a/b', all read against the namespace the declaration sits in, which for a parameter is the function itself. It says that a signature declared further down the configuration is legal, and what a reference that resolves to nothing reports; before, a path was accepted and then ignored, which left the parameter an untyped container without a word about it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

    @MaartenHilferink MaartenHilferink committed Sep 6, 2026
  • Document the typed function language (available from GeoDMS 20.9.0) Add 8 wiki pages for the new first-class typed function syntax and type definitions, each marked as available from GeoDMS version 20.9.0 and later: - Function-definition: the `function` construct - typed parameter telescope, the -> result specification, the three body forms, structured unit parameters, the `using` import clause, and `item` meta-reference parameters; contrasted with Template. - Type-alias: `alias = type;` (vs the item form `name : type;`), plain aliases, alias-of-alias / type-by-example, and function-signature aliases. - Function-signature: declared signatures, function-typed parameters, type application (nuf<V, D>), and application-time checking. - Generic-function: type variables and constraints (any / numerics / integers / floats / uints / sints / domains / points / domain_points), multiple variables, domain-variable vs unit-parameter polymorphism, and variants. - Anonymous-function: function literals (lambdas) and the brace rule. - Closure: function-valued results, capture by value, user-defined compose, passing functions, and typed closures. - Variadic-parameters: `...rest`, arity-aware dispatch, operator-name sharing. - Map: the built-in map(F, src) combinator and partial application map(F(k, _), src). Wire the pages into _Sidebar.md under a new Function subsection, and add a see-also from Template.md. All snippets are quoted from the testcases battery; all internal links validated. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

    @MaartenHilferink MaartenHilferink committed Jul 25, 2026