MG,
> On 31. 5. 2020, at 6:37 PM, MG <[email protected]> wrote:
> Inhowfar would that differ from the existing map based argument support, like
> @NamedVariant etc
> (http://docs.groovy-lang.org/2.5.0/html/gapi/groovy/transform/NamedVariant.html)
>
> <http://docs.groovy-lang.org/2.5.0/html/gapi/groovy/transform/NamedVariant.html>,
> respectively what is your intention here ?
Ha, I must be completely blind and dumb, too — I did check, but somehow, I
completely overlooked that ASTT!
Thanks, will test the thing, probably it's precisely what I wanted to do.
All the best,
OC
> On 31/05/2020 12:45, OCsite wrote:
>> Hi there,
>>
>> for both convenience and considerably improved source readability and
>> robustness, I am considering an ASTT which would convert positional
>> arguments to named ones, i.e., something like
>>
>> @Named foo(bar,int bax=666,List baz) {
>> ... whatever ...
>> }
>>
>> turned to something like
>>
>> foo(Map __map=null) {
>> def bar=__map?.bar
>> int bax=__map?.bax==null?666:__map?.bax
>> List baz=__map?.baz
>> ... whatever ...
>> }
>>
>> In farther future with my own typechecking script it might even allow to
>> typecheck named arguments, though that might prove a bit at the difficult
>> side — but technically possible.
>>
>> Has anybody tried something like that before? If so, bumped into some hidden
>> pitfalls perhaps?
>>
>> Thanks,
>> OC
>>
>