{"id":17289707,"url":"https://github.com/olk/closures","last_synced_at":"2026-05-08T08:10:53.499Z","repository":{"id":150515134,"uuid":"162682630","full_name":"olk/closures","owner":"olk","description":"closures in R, Python and C++","archived":false,"fork":false,"pushed_at":"2021-03-01T07:17:49.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-26T18:17:27.913Z","etag":null,"topics":["closures","cpp","python","r"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/olk.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}},"created_at":"2018-12-21T07:40:41.000Z","updated_at":"2022-03-07T09:43:27.000Z","dependencies_parsed_at":"2023-06-26T00:08:20.283Z","dependency_job_id":null,"html_url":"https://github.com/olk/closures","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/olk/closures","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olk%2Fclosures","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olk%2Fclosures/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olk%2Fclosures/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olk%2Fclosures/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/olk","download_url":"https://codeload.github.com/olk/closures/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olk%2Fclosures/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32772147,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T02:36:36.067Z","status":"ssl_error","status_checked_at":"2026-05-08T02:36:07.210Z","response_time":54,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["closures","cpp","python","r"],"created_at":"2024-10-15T10:35:34.350Z","updated_at":"2026-05-08T08:10:53.467Z","avatar_url":"https://github.com/olk.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# closures\n\nA closure is a named or anonymous function that captures non-global variables\nthat are defined outside of the function body.\n\nC++:\n```cpp\nauto make_fn(int x = 0) {\n    return [x]() mutable {\n        x += 1;\n        return x;\n    };\n}\n```\n\nPython:\n```python\ndef make_fn(x=0):\n\n    def closure():\n        nonlocal x\n        x += 1\n        return x\n\n    return closure\n```\n\nR:\n```r\nmake_fn \u003c- function(x=0) {\n    closure \u003c- function() {\n        x \u003c\u003c- x+1\n        x\n    }\n    return(closure)\n}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folk%2Fclosures","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Folk%2Fclosures","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folk%2Fclosures/lists"}