2010/3/24 Konrad Hinsen <konrad.hin...@fastmail.net>: > On 23 Mar 2010, at 21:04, Robert Lally wrote: > >> Is there a technical reason that one should prefer the (.method object) >> syntax over the (. object method) variant or is it purely a style that the >> community has converged on? > > It's purely style. You can easily verify that (.method object) is > transformed to (. object method) by macro expansion: > > user> (macroexpand-1 '(.method object)) > (. object method) > > The two versions are thus completely equivalent.
The original version (. object method) still could have an interest where IDEs could guess the method names to propose based on what they could infer from the object arg. With the (.methodName object) version, the IDE usually can make methode name completions based on everything but the object source code which has not been yet entered by the user, and this is less than ideal :-(. So some IDEs (like ccw) try hard doing completion based on the start of the method name type by the user (and it is currently slow with ccw because it searches for matches in all available classes in the project's classpath), some base their search only on classes that are imported in the current namespace (which is less than ideal given that generally the objects are not referred to directly in the ns and thus do not require an import statement for their class/interface). Some require the user to write an "intermediate" form of source code, e.g. by prefixing the method name with the class name to narrow the search, e.g. type "String.le" to have code completion on "String.length", and when you accept the code completion, it is transformed back into .length in the editor ... -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en To unsubscribe from this group, send email to clojure+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.