-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Feature Request
Description of Problem:
There are gaps in the support for expressions when operating on types.
-
Closures in Aggregations (CDM/DRR Gap): Operations like
sort,max, andminfrequently use closure blocks (e.g.,sort [ item -> unit -> currency ]) in CDM and DRR (digital-regulatory-reporting). The generator currently ignores these blocks and produces standard Pythonsorted()/max()calls.// Exposes gap in SortOperation/MaxOperation func SortItems: inputs: items Item (0..*) output: sortedItems Item (0..*) set sortedItems: items sort [ item -> price -> amount ] // Generator ignores the [ ... ] block -
Implicit Closure Parameters: Rosetta allows
extract [ item -> attr ]orreduce [ a + b ]without naming parameters. The current generator expects parameters to be explicitly declared in theInlineFunctionand fails with an error if they are missing.// Exposes gap in MapOperation/ReduceOperation func ImplicitClosure: inputs: items int (0..*) output: result int (0..1) set result: items extract [ item * 2 ] // Fails: expects explicit 'item' parameter declaration reduce [ a + b ] // Fails: expects explicit 'a, b' parameters -
General
one-ofExpressions: In CDM,one-ofis used as a stand-alone expression in functions and shortcuts. The generator only implements this behavior within type conditions.// Exposes gap in OneOfOperation (Expression) func CheckOneOf: inputs: msg Message (1..1) output: isValid boolean (1..1) set isValid: msg -> fieldA or msg -> fieldB one-of // Fails: Unsupported general expression
Potential Solutions:
There needs to be changes to the expression generation.