{"id":17273544,"url":"https://github.com/markmandel/while-let","last_synced_at":"2025-04-14T08:32:44.593Z","repository":{"id":13043714,"uuid":"15723634","full_name":"markmandel/while-let","owner":"markmandel","description":"Repeatedly executes body while test expression is true, evaluating the body with binding-form bound to the value of test.","archived":false,"fork":false,"pushed_at":"2021-05-22T14:29:29.000Z","size":173,"stargazers_count":20,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-10T06:32:34.107Z","etag":null,"topics":[],"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/markmandel.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}},"created_at":"2014-01-08T02:48:07.000Z","updated_at":"2023-04-25T04:56:14.000Z","dependencies_parsed_at":"2022-09-26T21:31:13.039Z","dependency_job_id":null,"html_url":"https://github.com/markmandel/while-let","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markmandel%2Fwhile-let","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markmandel%2Fwhile-let/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markmandel%2Fwhile-let/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markmandel%2Fwhile-let/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/markmandel","download_url":"https://codeload.github.com/markmandel/while-let/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248845998,"owners_count":21170876,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-10-15T08:51:34.252Z","updated_at":"2025-04-14T08:32:44.536Z","avatar_url":"https://github.com/markmandel.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# while-let\n\nRepeatedly executes body while test expression is true, evaluating the body with binding-form bound to the value of test.\n\nI've found this particularly useful with [core.async](https://github.com/clojure/core.async), where you want to loop\nuntil a channel is closed (and it returns nil).\n\n## Installation\n\nIn your project.clj add:\n\n![Clojars Version](https://clojars.org/while-let/latest-version.svg)\n\n## Usage\n\n```\n(while-let bindings \u0026 body)\n```\n\n### Simple example\n\nPop each item off the front of a vector and print it out.\n\n```clojure\n(let [data (atom [1 2 3 4 5])]\n          (while-let [item (first @data)]\n                     (println \"item: \" item)\n                     (swap! data rest)))\n```\n\n### Core.async example:\n\nTake from a channel until it gets closed (a closed channel will return `nil`), or the channel returns `false`\n\n```clojure\n(go (while-let [data (\u003c! (channel))]\n               (println data)))\n```\n\n## License\n\nCopyright © 2014 Mark Mandel\n\nDistributed under the Eclipse Public License either version 1.0 or (at\nyour option) any later version.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkmandel%2Fwhile-let","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarkmandel%2Fwhile-let","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkmandel%2Fwhile-let/lists"}