Re: Improving named-argument support

2018-01-16 Thread MG
I have created a Jira issue about Groovy non-map based named parameter support: https://issues.apache.org/jira/browse/GROOVY-8451 On 16.01.2018 06:54, Paul King wrote: We have a number of open issues around improving named-argument support. I am currently doing a spike around one AST

Re: Improving named-argument support

2018-01-16 Thread Nathan Harvey
Paul, I am very much in favor of this idea, but I do not like the execution. The need for those annotations makes it quite verbose and it seems a bit too complex. I agree with Daniil that having the "required" flag is also unnecessary. @NamedParam seems like it should be assumed. I understand the

Re: Executing dynamic DSL command

2018-01-16 Thread Mohan Radhakrishnan
I mean that this works if the DSL command is hard-coded. I was trying to pass it into the shell. Am I allowed to pass it into the shell ? This evaluation is generic for many such fluent commands. def evaluatexpath( String dsl ){ def binding = new Binding( dxp: new DynamicXPath(),

Executing dynamic DSL command

2018-01-16 Thread Mohan Radhakrishnan
Hi, I am reading the book 'Groovy in Action' and this code is based on that. My base script stores 'DynamicXPath' like this. abstract class AxesBaseScript extends Script { public DynamicXPath bootStrap(String initialPath ){ this.binding.dxp.bootStrap initialPath } } And

Re: Improving named-argument support

2018-01-16 Thread Daniil Ovchinnikov
> @NamedVariant > def foo(a, @NamedParam String b, c, @NamedParam(required=true) d) { > println "$a $b $c $d" > } > > which produces a method like this: > > def foo(Map _it, a, c) { > assert _it.containsKey('d') > this(a, _it.b, c, _it.d) > } Do you mean there will be additional method