you can use .foo or .-foo to access member variables via interop. However, com.bar.Foo/.foo and com.bar.Foo/.-foo only works for methods. Is there a reason for that? I like the fully qualified version since it let’s me use autocomplete to find member variables.
.foo works for either methods or fields (any member, resolves to method if both)
.-foo is only fields
com.bar.Foo/.foo is a qualified method - the goal here was to make higher order invokable thing, fields are not invokable
com.bar.Foo/.-foo is not valid syntax
I realize that’s how it works. Is there a reason why com.bar.Foo/.-foo shouldn’t be valid syntax?
basically, is it worth making an ask.clojure question?
One of the main reasons I have really liked method values is that it works well with autocomplete
Method values also work well with clojure.java.doc.api for pulling up javadocs in my editor
I said the reason - qualified methods are higher order invokable functions, qualified fields are not invokable things
ok. I was confused because you said fields are not invokable rather than fields should not be invokable. It seems plausible that fields could (or maybe should) be invokable just like keywords.
fields are values
the field value itself MIGHT be invokable, although that’s probably a rare case
you need to supply an object for an instance field to be a value, right?
I guess the overloading between static and instance fields makes this complicated
if that was a thing, yes. but it’s not a thing