Clojure

Public Java API

Details

  • Type: Enhancement Enhancement
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: Release 1.6
  • Component/s: None
  • Labels:
    None
  • Patch:
    Code and Test
  • Approval:
    Ok

Description

Problem: Java consumers need an API into Clojure that does not drag in a ton of concrete implementation detail.

Solution: Very small API class that allows looking up Vars (returning IFn), and reading data (as edn). Uses Clojure logic where possible, e.g. Var.intern.

Current patch: CLJ-1188-via-var-intern.patch

Also considered:

  • wrapper class (inconvenient for users, wrappers anathema in Clojure)
  • common superinterface for IFn and Deref (unnecessary, might bloat vtable)

See also http://dev.clojure.org/display/design/Improvements+to+interop+from+Java

  1. CLJ-1188.patch
    30/Mar/13 8:40 AM
    7 kB
    Stuart Halloway
  2. CLJ-1188-via-var-intern.patch
    12/Apr/13 11:51 AM
    7 kB
    Stuart Halloway
  3. CLJ-1188-wrapper-free.patch
    03/Apr/13 6:53 AM
    6 kB
    Stuart Halloway

Activity

Stuart Halloway made changes -
Field Original Value New Value
Patch Code [ 10001 ]
Attachment CLJ-1188.patch [ 11932 ]
Stuart Halloway made changes -
Attachment CLJ-1188-wrapper-free.patch [ 11939 ]
Stuart Halloway made changes -
Patch Code [ 10001 ] Code and Test [ 10002 ]
Approval Vetted [ 10003 ] Screened [ 10004 ]
Description See e.g. http://dev.clojure.org/display/design/Improvements+to+interop+from+Java Problem: Java consumers need an API into Clojure that does not drag in a ton of concrete implementation detail.

Solution: Very small API class that allows looking up Vars (returning IFn), and reading data (as edn). Uses Clojure logic where possible, e.g. Var.intern.

Current patch: CLJ-1188-via-var-intern.patch

Also considered:

* wrapper class (inconvenient for users, wrappers anathema in Clojure)
* common superinterface for IFn and Deref (unnecessary, might bloat vtable)

See also http://dev.clojure.org/display/design/Improvements+to+interop+from+Java
Attachment CLJ-1188-via-var-intern.patch [ 11954 ]
Rich Hickey made changes -
Approval Screened [ 10004 ] Ok [ 10007 ]
Stuart Halloway made changes -
Resolution Completed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: