groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Sun <realblue...@hotmail.com>
Subject Re: [GEP] Concatenative Method Calls
Date Sun, 25 Feb 2018 23:53:06 GMT
Hi Jochen,

     To be honest, I have no complex examples in my mind. Maybe it will be
good for DSL(We can think `|>` as a big arrow drawn by | and >):

```
clothes  |>  clean  |>  dry  |>  notify
```

     I ran the code you provided, error occurred as you expected,  but we
wish it could run well. We have to refine the implementation...

groovy> class X {  
groovy>   private bar(){1}  
groovy>   def b = this.&bar  
groovy> }  
groovy> println new X().b()  
groovy> class Y extends X {}  
groovy> println new Y().b()  
 
1
Exception thrown

groovy.lang.MissingMethodException: No signature of method: Y.bar() is
applicable for argument types: () values: []
Possible solutions: tap(groovy.lang.Closure), wait(), any(), wait(long),
any(groovy.lang.Closure), is(java.lang.Object)


Cheers,
Daniel.Sun



--
Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html

Mime
View raw message