Clojure

protocol-ize with-open

Details

  • Type: Enhancement Enhancement
  • Status: Open Open
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
  • Patch:
    Code
  • Approval:
    Triaged

Description

Good use (and documentation example) of protocols: make with-open aware of a Closable protocol for APIs that use a different close convention. See http://groups.google.com/group/clojure/browse_thread/thread/86c87e1fc4b1347c

Activity

Hide
Assembla Importer added a comment -
Show
Assembla Importer added a comment - Converted from http://www.assembla.com/spaces/clojure/tickets/308
Hide
Tassilo Horn added a comment -

Added a CloseableResource protocol and extended it on java.io.Closeable (implemented by all Readers, Writers, Streams, Channels, Sockets). Use it in with-open.

All tests pass.

Show
Tassilo Horn added a comment - Added a CloseableResource protocol and extended it on java.io.Closeable (implemented by all Readers, Writers, Streams, Channels, Sockets). Use it in with-open. All tests pass.
Hide
Tassilo Horn added a comment -

Seems to be related to Scopes (http://dev.clojure.org/jira/browse/CLJ-2).

Show
Tassilo Horn added a comment - Seems to be related to Scopes (http://dev.clojure.org/jira/browse/CLJ-2).
Hide
Tassilo Horn added a comment -

Updated patch.

Show
Tassilo Horn added a comment - Updated patch.
Hide
Andy Fingerhut added a comment -

Patch 0001-Added-ClosableResource-protocol-for-with-open.patch dated 08/Mar/12 applies, builds, and tests cleanly on latest master as of Apr 2 2012. Tassilo has signed a CA.

Show
Andy Fingerhut added a comment - Patch 0001-Added-ClosableResource-protocol-for-with-open.patch dated 08/Mar/12 applies, builds, and tests cleanly on latest master as of Apr 2 2012. Tassilo has signed a CA.
Hide
Tassilo Horn added a comment -

Updated patch to apply cleanly against master again.

Show
Tassilo Horn added a comment - Updated patch to apply cleanly against master again.

People

Vote (5)
Watch (4)

Dates

  • Created:
    Updated: