From bc47a24124c688a8ac7dfe385912ef08eb3b23f5 Mon Sep 17 00:00:00 2001 From: "Mark S. Miller" Date: Fri, 19 Jan 2024 15:25:54 -0800 Subject: [PATCH] docs(marshal): Update to latest agreed ocapn terminology (#1988) --- packages/marshal/docs/smallcaps-cheatsheet.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/marshal/docs/smallcaps-cheatsheet.md b/packages/marshal/docs/smallcaps-cheatsheet.md index dbe614b5a8..97e66428ca 100644 --- a/packages/marshal/docs/smallcaps-cheatsheet.md +++ b/packages/marshal/docs/smallcaps-cheatsheet.md @@ -4,19 +4,19 @@ An example-based summary of the Smallcaps encoding | Passable value | OCapn name | JS example | JSON encoding | | ----------------|---------------|---------------------|----------------------| -| bigint | SignedInteger | `7n`
`-7n` | `"+7"`
`"-7"` | +| bigint | Integer | `7n`
`-7n` | `"+7"`
`"-7"` | | manifest constant | Undefined

Float64


| `undefined`
`Infinity`
`-Infinity`
`NaN`
`-0` | `"#undefined"`
`"#Infinity"`
`"#-Infinity"`
`"#NaN"`
`"#-0"` // unimplemented | | passable symbol | Symbol | `Symbol.for('foo')`
`Symbol.asyncIterator` | `"%foo"`
`"%@@asyncIterator"` | -| remotable | Capability | `Far('foo', {})` | `"$0.foo"` | -| promise | Capability | `Promise.resolve()` | `"&1"` | +| remotable | Remotable | `Far('foo', {})` | `"$0.foo"` | +| promise | Promise | `Promise.resolve()` | `"&1"` | | special string | String | `'#foo'` | `"!#foo"` | | other string | String | `'foo'` | `"foo"` | | other JSON scalar | Null
Boolean

Float64 | `null`
`true`
`false`
`7.1` | `null`
`true`
`false`
`7.1` | -| copyArray | Sequence | `[a,b]` | `[,]` | +| copyArray | List | `[a,b]` | `[,]` | | copyRecord | Struct | `{x:a,y:b}` | `{:,:}` | | error | Error | `TypeError(msg)` | `{"#error":,"name":"TypeError"}` | | tagged | Tagged | `makeTagged(t,p)` | `{"#tag":,"payload":

}` | -| ? | ByteString | ? | ? | +| ? | ByteArray | ? | ? | * The `-0` encoding is defined as above, but not yet implemented in JS. * In JS, only registered and well-known symbols are passable. @@ -27,6 +27,8 @@ An example-based summary of the Smallcaps encoding * Structs [can only have string-named properties](https://github.com/endojs/endo/blob/master/packages/pass-style/doc/copyRecord-guarantees.md). * Errors can also carry an optional `errorId` string property. * We expect to expand the optional error properties over time. -* The ByteString encoding is not yet designed or implemented. +* The ByteArray encoding is not yet designed or implemented. Every JSON encoding with no special strings anywhere decodes to itself. + +See OCapN [Abstract Syntax](https://github.com/ocapn/ocapn/wiki/Abstract-Syntax).