{"id":15360893,"url":"https://github.com/takagi/cl-coroutine","last_synced_at":"2026-01-07T01:35:28.435Z","repository":{"id":17471863,"uuid":"20246072","full_name":"takagi/cl-coroutine","owner":"takagi","description":"Cl-coroutine is a coroutine library for Common Lisp. It uses cl-cont continuations library in its implementation.","archived":false,"fork":false,"pushed_at":"2016-09-22T14:19:08.000Z","size":7,"stargazers_count":67,"open_issues_count":0,"forks_count":7,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-02-01T22:42:29.161Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Common Lisp","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/takagi.png","metadata":{"files":{"readme":"README.markdown","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-05-28T05:26:00.000Z","updated_at":"2025-01-30T17:42:39.000Z","dependencies_parsed_at":"2022-07-26T17:02:09.472Z","dependency_job_id":null,"html_url":"https://github.com/takagi/cl-coroutine","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/takagi%2Fcl-coroutine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takagi%2Fcl-coroutine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takagi%2Fcl-coroutine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takagi%2Fcl-coroutine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/takagi","download_url":"https://codeload.github.com/takagi/cl-coroutine/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245916941,"owners_count":20693425,"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-01T12:52:09.336Z","updated_at":"2026-01-07T01:35:28.408Z","avatar_url":"https://github.com/takagi.png","language":"Common Lisp","readme":"# Cl-Coroutine\n\nCL-COROUTINE is a coroutine library for Common Lisp. It uses CL-CONT continuations library in its implementation.\n\n## Example\n\nCoroutines can be defined using `defcoroutine` macro.\n\nTo use defined coroutines, first create a coroutine object with calling `make-coroutine` function, then just `funcall` to process it.\n\n`yield` macro control back to the context which called the coroutine and the coroutine will resume processing at this point when it will be called again.\n\n    ;; define a coroutine using DEFCOROUTINE macro\n    (defcoroutine example (whom)\n      (format t \"First greeting to: ~A~%\" whom)\n      (yield 1)\n      (format t \"Second greeting to: ~A~%\" whom)\n      (yield 2)\n      (format t \"Third greeting to: ~A~%\" whom)\n      (coexit 3)\n      (format t \"No greeting to: ~A~%\" whom)\n      (yield 4))\n    =\u003e EXAMPLE\n\n    ;; make a coroutine object\n    (setf coroutine (make-coroutine 'example))\n    =\u003e a coroutine object\n\n    ;; funcall it\n    (funcall coroutine \"Smith\")\n    \u003e\u003e First greeting to: Smith\n    =\u003e 1\n\n    ;; funcall again\n    (funcall coroutine \"Johnson\")\n    \u003e\u003e Second greeting to: Johnson\n    =\u003e 2\n\n    ;; funcall again and coexit\n    (funcall coroutine \"Williams\")\n    \u003e\u003e Third greeting to: Williams\n    =\u003e 3\n\n    ;; funcall after coexit just returns no value\n    (funcall coroutine \"Brown\")\n    =\u003e No value\n\n    ;; you can also use WITH-COROUTINE macro to set up coroutines,\n    ;; which provides calling coroutines without explicit FUNCALL\n    (with-coroutine (example)\n      (example \"Smith\")\n      (example \"Johnson\"))\n    \u003e\u003e First greeting to: Smith\n    \u003e\u003e Second greeting to: Johnson\n    =\u003e 2\n\n\n## Installation\n\nYou can install `cl-coroutine` via Quicklisp:\n\n    (ql:quickload :cl-coroutine)\n\n\n## Restrictions\n\nCL-COROUTINE has some restrictions because of its dependency on CL-CONT library.\n* special forms that CL-CONT library does not support with CALL/CC\n* coroutines with very long definition might need much time to compile\n\n\n## API\n\n### [Macro] defcoroutine\n\n    DEFCOROUTINE coroutine-name arg \u0026body body =\u003e coroutine-name\n\nDefines a new coroutine named `coroutine-name` that has atmost one argument as `arg`. The definition of coroutine is stored in the property list of `coroutine-name` symbol. Defined coroutines will be created using `make-coroutine` function.\n\n### [Macro] yield\n\n    YIELD [result] =\u003e |\n\nYields control back to the context which called the coroutine, passing along any multiple values that were passed to it. The coroutine will resume processing at this point when it will be called again. Any arguments passed to the next calling will be set to the coroutine's corresponding parameters implicitly.\n\n### [Macro] coexit\n\n    COEXIT [result] =\u003e |\n\nReturns control to the context which called the coroutine, passing along any multiple values that were passed to it. The difference from `yield` macro is that the coroutine will never resume processing at this point anymore. If the coroutine will be called again, it will just return no value.\n\n### [Function] make-coroutine\n\n    MAKE-COROUTINE coroutine-name =\u003e coroutine\n\nCreates and returns a coroutine corresponding to `coroutine-name`. The returned coroutine can be called with `funcall` or `apply` functions.\n\n### [Macro] with-coroutine\n\n    WITH-COROUTINE (coroutine-name) \u0026body body =\u003e results\n\n`with-coroutine` uses `make-coroutine` to create a coroutine with name `coroutine-name` and defines a local macro with name `coroutine-name` binding it with the coroutine. `with-coroutine` evaluates the body as an implicit progn with the macro.\n\n\n## Author\n\n* Masayuki Takagi (kamonama@gmail.com)\n\n\n## Copyright\n\nCopyright (c) 2014 Masayuki Takagi (kamonama@gmail.com)\n\n## License\n\nLicensed under the LLGPL License.\n","funding_links":[],"categories":["Python ##","Interfaces to other package managers"],"sub_categories":["Third-party APIs"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftakagi%2Fcl-coroutine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftakagi%2Fcl-coroutine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftakagi%2Fcl-coroutine/lists"}