{"id":15675411,"url":"https://github.com/ktakashi/r6rs-msgpack","last_synced_at":"2026-01-08T21:05:24.060Z","repository":{"id":6801760,"uuid":"8049484","full_name":"ktakashi/r6rs-msgpack","owner":"ktakashi","description":"MessagePack for R6RS Scheme / msgpack.org[Scheme]","archived":false,"fork":false,"pushed_at":"2013-10-17T19:32:51.000Z","size":156,"stargazers_count":13,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-05T08:16:40.708Z","etag":null,"topics":["messagepack","msgpack","r6rs","r6rs-scheme","scheme"],"latest_commit_sha":null,"homepage":"","language":"Scheme","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ktakashi.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}},"created_at":"2013-02-06T10:51:19.000Z","updated_at":"2020-08-05T21:09:14.000Z","dependencies_parsed_at":"2022-09-15T09:22:11.266Z","dependency_job_id":null,"html_url":"https://github.com/ktakashi/r6rs-msgpack","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/ktakashi%2Fr6rs-msgpack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ktakashi%2Fr6rs-msgpack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ktakashi%2Fr6rs-msgpack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ktakashi%2Fr6rs-msgpack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ktakashi","download_url":"https://codeload.github.com/ktakashi/r6rs-msgpack/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246281312,"owners_count":20752213,"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":["messagepack","msgpack","r6rs","r6rs-scheme","scheme"],"created_at":"2024-10-03T15:59:58.137Z","updated_at":"2026-01-08T21:05:23.991Z","avatar_url":"https://github.com/ktakashi.png","language":"Scheme","readme":"MessagePack for R6RS Scheme\n========\n\nThis is an implementation of [MessagePack](http://msgpack.org/) for \nR6RS Scheme.\n\n\nAPI references\n--------\n\n_Function_ (pack! bv message)   \n_Function_ (pack! bv message offset)   \n\nPack *message* to message pack format bytevector and put it into the\n*bv* destructively. Given *bv* must have enough length to hold the message.\n\nOptional argument *offset* indicates where to start with, default is 0.  \n\n_Function_ (pack message)   \n\nThe same as **pack!** but this one creates a new bytevector.\n\n_Function_ (pack-size message)\n\nCalculate the converted message size.\n\n_Function_ (unpack bv)   \n_Function_ (unpack bv offset)  \n\nUnpack the given message format bytevector to Scheme object.\n\nOptional argument *offset* indicates where to start with, default is 0.  \n\n_Function_ (get-unpack in)\n\nUnpack the given binary input port to Scheme object.\n\nConversion rules\n--------\n\nAs you already know, Scheme doesn't have static types so the conversion of\nScheme objects to message pack data might cause unexpected results. To avoid\nit, I will describe how conversion works.\n\n### Scheme to message pack\n\n#### Integer conversion\n\nThe library automatically decides proper size. More specifically, if it\ncan fit to message pack's fixnum then library uses it, so are uint8-64.\nIf the number is too big, then an error is raised. Users must know it tries\nto use uint as much as possible. If the given number was negative then\nsint will be used.\n\n#### Floating point conversion\n\nUnfortunately R6RS doesn't have difference between float and double. So\nwhen flonum is given then it always converts to double number.\n\n#### Collection conversion\n\nMessage pack has collections which are map and array. And these are associated\nwith alist (association list) and vector respectively. When you want to convert\nalist to message pack data, then you need to make sure the _cdr_ part will be\nthe data and if you put _((\"key\" \"value))__ then it will be converted to nested\nmap.\n\nThe collection size calculation is done automatically. It tries to use the\nsmallest size.\n\n### Message pack to Scheme\n\nThe other way around is easy, it can simply restore the byte data to Scheme\nobject. Following describes the conversion rules;\n\nPositive fixnum -\u003e integer   \nNegative fixnum -\u003e integer   \nuint8, uint16, uint32, uint64 -\u003e integer   \nsint8, sint16, sint32, sint64 -\u003e integer   \nMap -\u003e alist   \nArray -\u003e vector   \nfixstr, str8, str16, str32 -\u003e string\nbit8, bit16, bit32 -\u003e bytevector\n\nTested Scheme implementations\n--------\n\n[Sagittarius Scheme](http://code.google.com/p/sagittarius-scheme/)\n\n[Mosh Scheme](http://code.google.com/p/mosh-scheme/)\n\n[Ypsilon](http://code.google.com/p/ypsilon/)\n\nYour contributions are always welcome.\n\nTODO\n--------\n\n* More testing\n* Extended type handling","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fktakashi%2Fr6rs-msgpack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fktakashi%2Fr6rs-msgpack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fktakashi%2Fr6rs-msgpack/lists"}