Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I think this is just how operator overloading works in Groovy: https://groovy-lang.org/operators.html#Operator-Overloading

"Or" is the name of the "|" operator. From the looks of it it's impossible to overload "||" in groovy.

By the way the "|" operator and the "or" method both call "pipeTo" directly so a third way to write it would be:

"ls".execute().pipeTo("grep -i old".execute()).waitForProcessOutput(System.out, System.out)



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: