cosmin / IClojure

A better Interactive REPL for Clojure
http://www.iclojure.com
Eclipse Public License 1.0
115 stars 11 forks source link

Auto-wrapping in parentheses #19

Closed vi closed 11 years ago

vi commented 12 years ago

Currently the non-first form seems to be just ignored by IClojure:

user[4]: 4 whatever
user[4]= 4

It can be useful to simplify function calls by allowing to omit parentheses (on top level) in such cases, so, for example, Math/sin 4 will be interpreted as (Math/sin 4). Tab completion can optionally auto-insert parentheses as well, like + 4 <tab> -> (+ 4 <cursor>).

Some other for-convenience rules can apply, like "qwe" .sta<tab> -> (. "qwe" startsWith<cursor>) or (.startsWith<cursor> "qwe").

cosmin commented 11 years ago

Omitting parens is certainly possible although I would like to stay away from that at the moment. Using tabs to auto-insert parens is an interesting idea, although if I start going down that road I'm interested in implementing paredit like manipulation.