Skip to content

stringref default value: empty instead of null? #14

Closed
@carlopi

Description

@carlopi

Current overview says stringref is nullable, while not saying anything about default value for stringview.

Reading #13 I got thinking whether saying that stringref & stringview are both default constructible to a string of length 0 and a reference to some default constructed stringref respectively.

The basic insight is that, for my understanding, there are no ways to tell null stringref and 0-length stringref apart.

If this is workable, this simplifies both the spec, use of stringview as locals, and also the interaction with JS, since removes the null special case plus the need for a default value:

  1. The set of JS representations of stringref values is the set of JS strings, plus JS null.
  2. There is no default value for a stringref. If a stringref argument is not supplied, that's an error.

That can just become:

  1. The set of JS representations of stringref values is the set of JS strings.
  2. Default value for a stringref is "".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions