diff --git a/lang/spec.html b/lang/spec.html index 8e7fcce6..4124c7be 100644 --- a/lang/spec.html +++ b/lang/spec.html @@ -4104,10 +4104,15 @@

Member access expression

follows:

@@ -4130,10 +4135,12 @@

Member access expression

  • if it is list, and k is < 0 or ≥ the length of c, then the evaluation completes abruptly with a panic; otherwise, the result is the member of c with index k;
  • +
  • if it is table, then if c does not contain a member with key +k, the result is (); otherwise, the result is the member +of c with key k.
  • if it is mapping, then if c is () or c -does not contain a member with key k, then the result is -(); otherwise, the result is the member of c with key -k.
  • +does not contain a member with key k, the result is (); +otherwise, the result is the member of c with key k. @@ -4143,8 +4150,9 @@

    Member access expression

    href="#built-in_subtypes">string:Char, that is the subtype of strings containing strings of length 1. If T is a subtype of xml<M>, then the static type of the member-access-expr is M|E, where E is the type of the -empty xml value. Otherwise, let K be the static type of key-expression and -let M be the member type of K in T; if T contains nil, or T is a subtype of +empty xml value. If T is a subtype of table<R>, then the static type of +member-access-expr is R?. Otherwise, let K be the static type of key-expression +and let M be the member type of K in T; if T contains nil, or T is a subtype of mapping and K is an optional key type for T, then the static type of the member-access-expr is M?, otherwise the static type is M.