WIP: Add URN record type #7

Draft
ehmry wants to merge 1 commits from ehmry/syndicate-protocols:urn into main
Contributor

Needs a bundle regeneration.

Needs a bundle regeneration.
ehmry changed title from WIP Add URN record type to WIP: Add URN record type 2023-09-05 07:59:32 +00:00
Owner

I like it!

Would optionals help?

If preserves-schema had better support for optionals, would it be of interest to use something like the following instead?

version 1 .

Authority = {
  username: optional any
  password: optional any
  host: optional any
  port: optional any
}.

; Uniform Resource Identifier https://datatracker.ietf.org/doc/html/rfc3986
; <uri "https" {host: "datatracker.ietf.org"} "/doc/html/rfc3986">
Uri = <uri @scheme string @auth Authority @path any @query optional any @fragment optional any> .

Maybe tighter than any?

Why use any? Could something like this work? (Is it for optionality/maybeness, with #f as "no value"?)

Authority = [ @username string @password string @host string @port int ] .
I like it! ### Would optionals help? If preserves-schema had better support for optionals, would it be of interest to use something like the following instead? ```preserves-schema version 1 . Authority = { username: optional any password: optional any host: optional any port: optional any }. ; Uniform Resource Identifier https://datatracker.ietf.org/doc/html/rfc3986 ; <uri "https" {host: "datatracker.ietf.org"} "/doc/html/rfc3986"> Uri = <uri @scheme string @auth Authority @path any @query optional any @fragment optional any> . ``` ### Maybe tighter than any? Why use any? Could something like this work? (Is it for optionality/maybeness, with `#f` as "no value"?) ```preserves-schema Authority = [ @username string @password string @host string @port int ] . ```
ehmry force-pushed urn from 36295888fa to d51937b75f 2023-10-19 15:48:34 +00:00 Compare
Author
Contributor

Right, the any was for string / #f. Using a fixed length array for Authority rather than a dictionary was to save space on the keys and to most closely match rfc3986, though it makes them awkward to look at. For example <uri "file" [#f, #f, #f, #f] "/tmp/foo.txt" #f #f>.

Right, the `any` was for `string / #f`. Using a fixed length array for Authority rather than a dictionary was to save space on the keys and to most closely match [rfc3986](https://datatracker.ietf.org/doc/html/rfc3986), though it makes them awkward to look at. For example ` <uri "file" [#f, #f, #f, #f] "/tmp/foo.txt" #f #f>`.
This pull request is marked as a work in progress.
This branch is out-of-date with the base branch
You can also view command line instructions.

Step 1:

From your project repository, check out a new branch and test the changes.
git checkout -b ehmry-urn main
git pull urn

Step 2:

Merge the changes and update on Forgejo.
git checkout main
git merge --no-ff ehmry-urn
git push origin main
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: syndicate-lang/syndicate-protocols#7
No description provided.