{"id":20125021,"url":"https://github.com/jpcima/narrowed-types","last_synced_at":"2026-02-04T07:32:23.040Z","repository":{"id":106388200,"uuid":"87774343","full_name":"jpcima/narrowed-types","owner":"jpcima","description":"Type definitions narrowed with predicates","archived":false,"fork":false,"pushed_at":"2017-04-10T09:27:18.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-02T20:44:09.795Z","etag":null,"topics":["common-lisp","types"],"latest_commit_sha":null,"homepage":null,"language":"Common Lisp","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jpcima.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-04-10T06:25:40.000Z","updated_at":"2017-05-04T18:58:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"78dd8a05-e874-4ab7-a610-0a9a80120270","html_url":"https://github.com/jpcima/narrowed-types","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jpcima/narrowed-types","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpcima%2Fnarrowed-types","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpcima%2Fnarrowed-types/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpcima%2Fnarrowed-types/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpcima%2Fnarrowed-types/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jpcima","download_url":"https://codeload.github.com/jpcima/narrowed-types/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpcima%2Fnarrowed-types/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265218676,"owners_count":23729522,"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":["common-lisp","types"],"created_at":"2024-11-13T19:54:15.889Z","updated_at":"2026-02-04T07:32:23.009Z","avatar_url":"https://github.com/jpcima.png","language":"Common Lisp","funding_links":[],"categories":[],"sub_categories":[],"readme":"# narrowed-types\nType definitions narrowed with predicates\n\n# Description\n\nThis Common Lisp package provides a single macro which helps you define type specifiers for subsets, on the basis on an existing supertype and a condition expressed on the value.\n\nDEFMACRO **deftype-narrowed** ((*var* *type* *super-type*) \u0026body *body*)\n\n    DEFTYPE-NARROWED defines a type with name TYPE as well as a matching predicate TYPE-p.\n    The instances of the resulting type are the subset of instances of SUPER-TYPE which satisfy\n    a condition on VAR expressed by the BODY of the statement.\n\n# Example\n\nThis simple example defines a type for the odd integers.\n\n    (deftype-narrowed (x odd-integer integer)\n      (oddp x))\n\nNote: In the body of the example, the argument *x* to *oddp* is guaranteed to be an instance of the supertype *integer*.\n\nThe type *odd-integer* is usable in any context where a type specifier is expected.\nThis includes standard forms such as *typep*, *check-type*, *typecase*, *the*, *defstruct*, *defclass*.\nYou may not use it however to specialize a generic method.\n\n    (typecase x\n      (odd-integer :odd)\n      (integer :even)\n      (t :other))\n\nFor some more usage examples, see tests.\n\n# References\n\n[CLHS 4.2.3: Type Specifiers](http://www.lispworks.com/documentation/HyperSpec/Body/04_bc.htm)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjpcima%2Fnarrowed-types","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjpcima%2Fnarrowed-types","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjpcima%2Fnarrowed-types/lists"}