laurent.orseau
2021-1-1 09:35:29

Often it’s possible to place the sets of n args on individual lines, in which case it’s easy to read. Otherwise it becomes annoying to parse visually.



kellysmith12.21
2021-1-2 05:03:58

I have a potential alternative to functions with unusual signatures, like hash. There could be a simple macro, group (feel free to pick a better name) that works like (group expr ...+) ; => (let-values ([(temp ...) (values expr ...)]) (lambda () (values temp ...))) Then, a simple wrapper around call-with-values could be used to extract values from the group. There could be a new for form for iterating over lists of groups.

Instead of a rest argument of m modulo n arguments, the rest argument can just have groups of n values.

A call-site example, instead of: (hash key1 val1 key2 val2) use: (new-hash (group key1 val1) (group key2 val2))


kellysmith12.21
2021-1-2 05:05:39

This would also eliminate the need for complex recursive contracts for rest arguments, a simple (listof (group/c ctc ...)) would suffice.