Conversation
|
What's a selector? |
OCapN Selector corresponds to Syrup symbol and Scheme symbol. Because we can’t use JavaScript symbols (risk of registry stuffing attacks), MarkM insisted we give this a distinguishing name. It follows that it should have its own passStyle, which should replace symbols entirely in the long run. https://github.com/ocapn/ocapn/blob/main/draft-specifications/Model.md#selector |
| | 'symbol'; | ||
|
|
||
| export type ContainerStyle = 'copyRecord' | 'copyArray' | 'tagged'; | ||
| export type ContainerStyle = 'copyRecord' | 'copyArray' | 'tagged' | 'selector'; |
There was a problem hiding this comment.
I don’t believe selector qualifies as a container. It’s more like a string. But, the reïfication of a selector is an object, so that might be the distinguishing feature for containers. I do not know.
There was a problem hiding this comment.
its a container for a string! yeah ok was mostly just following 'tagged' around the code base
There was a problem hiding this comment.
It's definitely not a container. Our best documentation is at https://endojs.github.io/endo/types/_endo_pass_style.Passable.html , and we could describe Selector as primitive if we're taking a data model perspective, or otherwise a new special case (because, unlike the existing primitives, Object.is will differentiate identical values).
| | 'promise'; | ||
|
|
||
| export type TaggedOrRemotable = 'tagged' | 'remotable'; | ||
| export type TaggedOrRemotable = 'tagged' | 'selector' | 'remotable'; |
There was a problem hiding this comment.
Selector definitely does not belong in this union.
is the concern here only from using here is an example showing a |
|
Seeing this thread, I realize I gave you bad advise. Selector is like Tagged in some ways, but is like Symbol in other ways. I'll make a PR staged on this one as my corrected review suggestions. Hold on.
Would be an interesting experiment, but I don't expect it to be a better solution than what this PR is attempting. |
|
Thanks for the great idea, and sorry for how long it took for me to get it. |
|
closed for #2777 |
No description provided.