{"id":17214756,"url":"https://github.com/dedbox/racket-template","last_synced_at":"2026-01-05T19:09:19.253Z","repository":{"id":62424437,"uuid":"226591566","full_name":"dedbox/racket-template","owner":"dedbox","description":"A Racket Meta-Program Generator","archived":false,"fork":false,"pushed_at":"2020-03-26T17:32:18.000Z","size":168,"stargazers_count":17,"open_issues_count":1,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-02T00:34:06.212Z","etag":null,"topics":["macros","meta-programming","program-generator","racket","template-metaprogramming"],"latest_commit_sha":null,"homepage":"https://pkgs.racket-lang.org/package/template","language":"Racket","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dedbox.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"dedbox","patreon":"dedbox","ko_fi":"dedbox","liberapay":"dedbox"}},"created_at":"2019-12-07T23:57:14.000Z","updated_at":"2023-08-07T17:10:21.000Z","dependencies_parsed_at":"2022-11-01T18:01:40.419Z","dependency_job_id":null,"html_url":"https://github.com/dedbox/racket-template","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/dedbox%2Fracket-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dedbox%2Fracket-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dedbox%2Fracket-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dedbox%2Fracket-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dedbox","download_url":"https://codeload.github.com/dedbox/racket-template/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245467231,"owners_count":20620210,"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":["macros","meta-programming","program-generator","racket","template-metaprogramming"],"created_at":"2024-10-15T03:05:31.340Z","updated_at":"2026-01-05T19:09:14.197Z","avatar_url":"https://github.com/dedbox.png","language":"Racket","readme":"# Template Macros\n\n[![Racket Package](https://img.shields.io/badge/raco%20pkg-template-red.svg)](https://pkgd.racket-lang.org/pkgn/package/template)\n[![Documentation](https://img.shields.io/badge/read-docs-blue.svg)](http://docs.racket-lang.org/template/)\n[![Build Status](https://travis-ci.org/dedbox/racket-template.svg?branch=master)](https://travis-ci.org/dedbox/racket-template)\n[![Coverage Status](https://coveralls.io/repos/github/dedbox/racket-template/badge.svg?branch=master)](https://coveralls.io/github/dedbox/racket-template?branch=master)\n\n## Dead Simple Code Generation for Racket\n\nTemplate macros combine the flexibility of [template\nmeta-programming](https://en.wikipedia.org/wiki/Template_metaprogramming) with\nthe safety of Racket's hygienic macro sub-system.\n\nTemplate variables are resolved *before* expansion by selectively rewriting\nthe input text. The extra flexibility makes escaping to the expanding\nenvironment less necessary *and* more convenient.\n\n``` racket\n#lang racket/base\n\n(require racket/match template (for-syntax racket/base))\n\n(define-for-syntax the-fibs\n  (make-immutable-hash\n   (for/fold ([fibs '([1 . 1] [0 . 0])])\n             ([k (in-range 2 10)])\n     `([,k . ,(+ (cdar fibs) (cdadr fibs))] ,@fibs))))\n\n(begin-template '#,(map cdr (sort (hash-\u003elist the-fibs) \u003c #:key car)))\n; '(0 1 1 2 3 5 8 13 21 34)\n\n(begin-template\n  (define fib (match-lambda (for/template ([K (in-range 10)])\n                              [K #,(hash-ref the-fibs K)]))))\n\n(fib 8)\n; 21\n\n(fib 10)\n; match-lambda: no matching clause for 10\n```\n\n## Installation and Use\n\nTemplate macros are distributed in the\n[template](https://pkgs.racket-lang.org/package/template) package on the\nofficial Racket package repository. It can be installed from DrRacket's\npackage manager, or with `raco pkg` from the comand line.\n\n``` shell\nraco pkg install template\n```\n\nTo start using template macros, import the `template` collection.\n\n``` racket\n(require template)\n```\n\nSee the [official documentation](https://docs.racket-lang.org/template/) for a\ndetailed overview of template macros, along with a catalog of template\nconstructors, combiners, and definers.\n\n## Contributing\n\nPull requests of any size are welcome. For help creating one, or to propose\nmajor changes, please open an\n[issue](https://github.com/dedbox/racket-template/issues/new) first to discuss\nwhat you would like to change.\n","funding_links":["https://github.com/sponsors/dedbox","https://patreon.com/dedbox","https://ko-fi.com/dedbox","https://liberapay.com/dedbox"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdedbox%2Fracket-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdedbox%2Fracket-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdedbox%2Fracket-template/lists"}