{"id":32566817,"url":"https://github.com/nijohando/deferable","last_synced_at":"2026-07-04T04:03:38.595Z","repository":{"id":297510286,"uuid":"82379691","full_name":"nijohando/deferable","owner":"nijohando","description":"Finally block free deferred function utilities","archived":false,"fork":false,"pushed_at":"2018-10-14T23:47:34.000Z","size":23,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-29T05:39:48.042Z","etag":null,"topics":["clojure","clojurescript","deferred-functions"],"latest_commit_sha":null,"homepage":null,"language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"epl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nijohando.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-02-18T10:40:10.000Z","updated_at":"2023-12-15T07:59:20.000Z","dependencies_parsed_at":"2025-06-05T22:10:13.177Z","dependency_job_id":null,"html_url":"https://github.com/nijohando/deferable","commit_stats":null,"previous_names":["nijohando/deferable"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/nijohando/deferable","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nijohando%2Fdeferable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nijohando%2Fdeferable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nijohando%2Fdeferable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nijohando%2Fdeferable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nijohando","download_url":"https://codeload.github.com/nijohando/deferable/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nijohando%2Fdeferable/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35109212,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-04T02:00:05.987Z","response_time":113,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clojure","clojurescript","deferred-functions"],"created_at":"2025-10-29T05:26:28.050Z","updated_at":"2026-07-04T04:03:38.591Z","avatar_url":"https://github.com/nijohando.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Deferable\n\n[![Clojars Project](https://img.shields.io/clojars/v/jp.nijohando/deferable.svg)](https://clojars.org/jp.nijohando/deferable)\n[![CircleCI](https://circleci.com/gh/nijohando/deferable.svg?style=shield)](https://circleci.com/gh/nijohando/deferable)\n\nClojure(Script) deferred function library like golang's `defer`.\n\n## Rationale\n\nMain motivations for writing this library are:\n\n* Providing deferred functions like golang's `defer`\n* Available on both Clojure and ClojureScript\n\n## Installation\n\n#### Ligningen / Boot\n\n```clojure\n[jp.nijohando/deferable \"0.2.1\"]\n```\n\n#### Clojure CLI / deps.edn\n\n```clojure\njp.nijohando/deferable {:mvn/version \"0.2.1\"}\n```\n\n## Usage\n\nClojure\n\n```clojure\n(require '[jp.nijohando.deferable :as d])\n```\n\nClojureScript\n\n```clojure\n(require '[jp.nijohando.deferable :as d :include-macros true])\n```\n\n\n#### Deferred functions\n\n`do*` block works similarly to the clojure `do` and `defer` can be used inside the block.  \n`defer` function is scheduled to be evaluated before the block returns value.\n\n```clojure\n(d/do* \n  (d/defer (println \"2\")) \n  (println \"1\"))\n;;=\u003e \"1\"\n;;=\u003e \"2\"\n;;=\u003e nil\n```\n\nMultiple `defer` forms are evaluated in LIFO order.\n\n```clojure\n(d/do* \n  (d/defer (println \"3\")) \n  (d/defer (println \"2\")) \n  (println \"1\"))\n;;=\u003e \"1\"\n;;=\u003e \"2\"\n;;=\u003e \"3\"\n```\n\n#### Deferred functions in async\n\n\n`do**` block is similar to `do*` but designed for async programming like core.async.  \nDifference with`do*` is that Deferred functions are evaluated when calling `done` function passed to the first argument of the `do**` block.\n\n```clojure\n(require '[clojure.core.async :refer [go]])\n(d/do** done \n  (d/defer (println \"3\")) \n  (go \n    (println \"2\") \n    (done)) \n  (println \"1\"))\n;;=\u003e \"1\"\n;;=\u003e \"2\"\n;;=\u003e \"3\"\n```\n\n## License\n\n© 2017-2018 nijohando  \n\nDistributed under the Eclipse Public License either version 1.0 or (at\nyour option) any later version.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnijohando%2Fdeferable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnijohando%2Fdeferable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnijohando%2Fdeferable/lists"}