Coder Social home page Coder Social logo

Comments (4)

piotr-yuxuan avatar piotr-yuxuan commented on May 23, 2024

I think it does qualify as a bug, but it's quite telling that nobody reported it ^_^ Another explanation is nobody actually tried to use ::fn.

from closeable-map.

piotr-yuxuan avatar piotr-yuxuan commented on May 23, 2024

Actually ::closeable-map/fn is more for custom close function, for example with reporting and so on. In such case indeed a custom function may be added in the metadata of the containing map. However, closeable-map may be taught to close any object instances by extending the ::closeable-map/close! method.

(import '(clojure.lang Atom))
(defmethod c/close! Atom [x] (reset! x nil))

(import '(clojure.core.async.impl.protocols Channel))
(defmethod c/close! Channel [x] (async/close! x))

This should be added as examples.

from closeable-map.

piotr-yuxuan avatar piotr-yuxuan commented on May 23, 2024

As long as Java objects are concerned, user can make use of the star pattern, that is to say a closeable* within a closeable-map*. In effect this does register this Java object in the metadata of the container.

from closeable-map.

piotr-yuxuan avatar piotr-yuxuan commented on May 23, 2024

I'm reluctant to change close-with. Very happy to hear a different opinion about it.

from closeable-map.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.