<< Back to previous view

[CLJ-452] Miscellaneous improvements to Clojure runtime usability from Java Created: 06/Oct/10  Updated: 07/Oct/11  Resolved: 07/Oct/11

Status: Closed
Project: Clojure
Component/s: None
Affects Version/s: None
Fix Version/s: Release 1.4

Type: Enhancement Priority: Major
Reporter: Chas Emerick Assignee: Chas Emerick
Resolution: Declined Votes: 0
Labels: None


Using Clojure from Java is very pleasant overall, but there are some rough edges, many of which could be smoothed over with very simple enhancements. I would suggest:

  • there should be an RT.var or Var.find that takes a single string
  • an IFn wrapper should be available that catches and rethrows Exceptions as RuntimeExceptions
  • a simple class (clojure.lang.Clojure perhaps?) that provides a well-documented and stable API for common operations: requiring namespaces, loading files, finding vars, evaluating strings, etc. This also would have a side benefit of allowing breaking changes to the implementation details without breaking interop code.

There are others of this sort that I've come across; will update the above as I remember them.

Comment by Assembla Importer [ 26/Oct/10 10:30 PM ]

Converted from http://www.assembla.com/spaces/clojure/tickets/452

Comment by Assembla Importer [ 26/Oct/10 10:30 PM ]

cemerick said: Here's an implementation of that IFn wrapper that rethrows Exceptions as RuntimeExceptions: SafeFn.java

This makes sense to me, but perhaps not everyone. Thoughts?

Comment by Chas Emerick [ 21/Mar/11 9:03 AM ]

See http://dev.clojure.org/display/design/Improvements+to+interop+from+Java for a discussion of these changes.

Comment by Stuart Halloway [ 07/Oct/11 12:22 PM ]

While the title of this ticket is broad, it looks like the actual discussion is about rethrowing RuntimeException. Clojure 1.3 and later solve this problem a different way, by not declaring Exception on the relevant interface points.

Please add tickets for the other items discussed on the wiki as appropriate.

Generated at Fri Oct 20 00:25:41 CDT 2017 using JIRA 4.4#649-r158309.