| time |
nick |
message |
05:28 |
<rektide> |
why is def accept(File file) {file.isDirectory||file.getName() ==~ pattern} incompatible with boolean java.io.FileFilter.accept(java.io.File file)? |
05:40 |
<alkemist> |
because 'def' means 'Object' in Java. |
05:44 |
<rektide> |
boo lets me def foo() as bool, is there any way to do a similar cast, some way to specify a return type? |
05:44 |
<rektide> |
aka help how do i overload a method with a non-Object return type |
05:58 |
<alkemist> |
just use 'boolean' as the return type instead of 'def' |
05:59 |
<alkemist> |
boolean accept(File file) {file.isDirectory||file.getName() ==~ pattern} |
06:01 |
<rektide> |
i was not away def was so literally the same as Object |
06:01 |
<rektide> |
i thought there was implicit typing |
06:01 |
<alkemist> |
def essentially means untyped. |
06:01 |
<alkemist> |
You coming from Ruby? |
06:02 |
<alkemist> |
Read http://groovy.codehaus.org/Scoping+and+the+Semantics+of+%22def%22 |
06:02 |
<Drone> |
That URL gave the following error code: 404 Unknown page Scoping+and+the+Semantics+of+"def |
06:02 |
<alkemist> |
Second half of at least. |
06:02 |
<rektide> |
i'm coming from Boo |