{"id":20425365,"url":"https://github.com/catseye/define-opaque","last_synced_at":"2026-03-08T11:35:18.941Z","repository":{"id":65557502,"uuid":"594011392","full_name":"catseye/define-opaque","owner":"catseye","description":"MIRROR of https://codeberg.org/catseye/define-opaque : R5RS Scheme macro for defining opaque datatypes","archived":false,"fork":false,"pushed_at":"2023-11-09T19:45:38.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-15T15:12:30.521Z","etag":null,"topics":["abstract-data-type","abstract-data-types","define-syntax","fits-on-a-page","information-hiding","opaque-type","r5rs-scheme"],"latest_commit_sha":null,"homepage":"https://catseye.tc/node/define-opaque","language":"Scheme","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/catseye.png","metadata":{"files":{"readme":"README.md","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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-27T11:41:59.000Z","updated_at":"2023-10-31T11:50:12.000Z","dependencies_parsed_at":"2025-01-15T15:19:34.418Z","dependency_job_id":null,"html_url":"https://github.com/catseye/define-opaque","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catseye%2Fdefine-opaque","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catseye%2Fdefine-opaque/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catseye%2Fdefine-opaque/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catseye%2Fdefine-opaque/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/catseye","download_url":"https://codeload.github.com/catseye/define-opaque/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241966977,"owners_count":20050324,"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":["abstract-data-type","abstract-data-types","define-syntax","fits-on-a-page","information-hiding","opaque-type","r5rs-scheme"],"created_at":"2024-11-15T07:13:03.256Z","updated_at":"2026-03-08T11:35:18.922Z","avatar_url":"https://github.com/catseye.png","language":"Scheme","funding_links":[],"categories":[],"sub_categories":[],"readme":"define-opaque\n=============\n\nThis is an attempt to write a macro in R5RS Scheme that\ndefines opaque data structures.  It is based on the third\nexample given in [Information Hiding in Scheme][].\n\nIt is not intended to be suitable for production use.  It\nis, however, intended to properly hide the details of the\ncreated data structure, by preventing access to it by any\nmeans other than via the defined operations.\n\nThe macro is defined in\n**[`src/define-opaque-0.1.scm`](src/define-opaque-0.1.scm)**.\n\nThe idea is that you'd just copy it into your project and\n`(load \"define-opaque.scm\")` where you need it.  For usage,\nsee the demo files also in [the `src` directory](src/).\n\n### Basic Instructions\n\nThe arguments to the `define-opaque` macro are\n\n*   the name of the opaque data structure that will result\n    (this name will be visible globally)\n*   the name of a function which creates a new instance\n    of the data structure\n    (this name will be visible only to the operations)\n*   a list of names for the data items used internally\n    (these names will be visible only to the operations)\n*   a list of operations.  Each operation is a 2-element\n    list, consisting of its name, and a lambda expression\n    giving its implementation.\n\nThe opaque data structure that results is a Scheme\nfunction.  When it is called, the first argument\nmust be the name of an operation; the remainder of the\narguments are passed to\n\nTypically, the opaque data structure that results\nis treated as a \"protoype\", and one defines an operation\ncalled `new` that provides a way to initialize a new\ninstance of the data structure based on some initialization\nparameters.\n\nIf the above description is unclear, the example programs\nin [the `src` directory](src/) may help illuminate the\nusage patterns.\n\n### TODO\n\n- [ ] is more than one private field supported?\n- [ ] support supplying initial values for private fields\n\n[Information Hiding in Scheme]: https://codeberg.org/catseye/The-Dossier/src/branch/master/article/Information-Hiding-in-Scheme/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcatseye%2Fdefine-opaque","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcatseye%2Fdefine-opaque","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcatseye%2Fdefine-opaque/lists"}