{"id":26140111,"url":"https://github.com/crowdagger/crow-utils","last_synced_at":"2026-03-10T13:35:14.400Z","repository":{"id":272084814,"uuid":"915473105","full_name":"crowdagger/crow-utils","owner":"crowdagger","description":"Misc scheme utilites","archived":false,"fork":false,"pushed_at":"2025-02-17T13:45:50.000Z","size":39,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-24T10:10:59.101Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Scheme","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/crowdagger.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},"funding":{"github":"lise_henry"}},"created_at":"2025-01-11T23:37:47.000Z","updated_at":"2025-02-17T13:45:53.000Z","dependencies_parsed_at":"2025-01-12T01:35:32.495Z","dependency_job_id":null,"html_url":"https://github.com/crowdagger/crow-utils","commit_stats":null,"previous_names":["crowdagger/crow-utils"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/crowdagger/crow-utils","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crowdagger%2Fcrow-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crowdagger%2Fcrow-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crowdagger%2Fcrow-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crowdagger%2Fcrow-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crowdagger","download_url":"https://codeload.github.com/crowdagger/crow-utils/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crowdagger%2Fcrow-utils/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30334721,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T12:41:07.687Z","status":"ssl_error","status_checked_at":"2026-03-10T12:41:06.728Z","response_time":106,"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":[],"created_at":"2025-03-11T02:45:13.719Z","updated_at":"2026-03-10T13:35:14.380Z","avatar_url":"https://github.com/crowdagger.png","language":"Scheme","funding_links":["https://github.com/sponsors/lise_henry"],"categories":[],"sub_categories":[],"readme":"# crow-utils\n\nMisc scheme utilites that I deemed vaguely useful for Scheme code I write.\n\nI try to use R7RS style but it's mostly tested on Guile. \n\n## vec\n\nGrowable vector.\n\nThe interface is a bit not schemey, more object-like. \n\n```scheme \n;; Create an empty vector with two elements allocated\n;; (by default (make-vec) allocates 32)\n(define v (make-vec 2))\n\n;; add elements to v\n(v 'push! 1)\n(v 'push! 2)\n\n;; access element n\n(v 'get 0) ; =\u003e 1\n;; short form\n(v 1) ; =\u003e 2\n\n;; modify element n\n(v 'set! 0 42)\n\n;; If v grows beside allocation, its content will be copied\n;; behind the scenes\n(v 'push! 3)\n\n(v 'length) ; =\u003e 3\n(v 'allocated) ; =\u003e 4 (allocation doubles each time it is needed)\n\n;; You can also shrink v\n(v 'pop!) ; =\u003e 3 (last value)\n(v 'length) ; =\u003e 2\n\n;; List conversion\n(v '-\u003elist) ; =\u003e '(0 1)\n```\n\n## checked\n\n```scheme\n(import (crow-utils checked))\n```\n\nProvides some tools to check argument types and return types of functions.\n\n### defn\n\n```scheme \n(defn (double x)\n  (number? -\u003e number?)\n  #:doc \"Doubles a number\"\n  (* 2 x))\n```\n\nHere, the function will check its argument when it is called, and also checks its return value before sending it.\n\nTherefore, \n\n```scheme\n(double 42)\n```\n\nwill send an error. and so will \n\n```scheme\n(defn (buggy-double x)\n  (number? -\u003e number?)\n  #:doc \"Doubles a number\"\n  (display (* 2 x)))\n```\n\nSyntax: `(defn (name args ...) (predicates ... [ -\u003e return_predicate ]) [ #:doc doc ] body ...)`\n\nSince some test are automatically added at the beginning of the body,\nit messes up with the possibility of adding a docstring at the\nbeginning of the function ; the optional #:doc parameter allows to fix\nthat.\n\n\n### SRFI 253\n\nAfter I started implementing `defn`, I stumbled upon\n[SRFI-253](https://srfi.schemers.org/srfi-253/) by Artyom Bologov\nwhich tackles the same problem.\n\nTherefore, This library also provides the equivalent `define-checked'\n:\n\n```scheme\n(define-checked (add [x number?] [y number?])\n  (+ x y))\n```\n\nIt is also possible to provide the #:doc keyword to add a docstring.\n\nHere, the return type isn't checked, but in many cases it might indeed\nbe redundant.\n\nThis library also provides `lambda-checked` and `values-checked`, but\nnot the full scope of this SRFI. \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrowdagger%2Fcrow-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrowdagger%2Fcrow-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrowdagger%2Fcrow-utils/lists"}