14:20 | <ryzokuken> | I was looking through the spec, couldn't find an example of iterating over keys of a Record. |
14:20 | <ryzokuken> | do any of you remember any? |
14:21 | <ryzokuken> | or can I just `For each field _myField_ of _myRecord_, do`? |
14:24 | <bradleymeck> | ryzokuken: i dont think we do that |
14:25 | <ryzokuken> | bradleymeck: I see. Well, if I wanted to do something like that, how would I? |
14:25 | <ryzokuken> | Use an abstract op to get the fields? |
14:26 | <bradleymeck> | i don't believe we state records are like object / they don't have an enumeration method |
14:26 | <ryzokuken> | I mean, as a `List`. |
14:26 | <bradleymeck> | even then, the key isn't a value on its own |
14:26 | <ryzokuken> | Ah, I see. |
14:26 | <bradleymeck> | i believe 402 has a mechanism that extends this a bit? /me digs about |
14:27 | <ryzokuken> | This is a 402 proposal btw |
14:27 | <ryzokuken> | so I'd be more than happy to reference 402. |
14:27 | <bradleymeck> | https://tc39.es/ecma402/#conventions |
14:29 | <ryzokuken> | bradleymeck: do you specifically mean |
14:29 | <ryzokuken> | > As an extension to the Record Specification Type, the notation “[[<name>]]” denotes a field whose name is given by the variable name, which must have a String value. For example, if a variable s has the value "a", then [[<s>]] denotes the field [[a]]. |
14:29 | <ryzokuken> | ? |
14:29 | <bradleymeck> | then you could state `for each field F in R as a String in List order:` |
14:29 | <bradleymeck> | but even 402 doesn't ever enumerate fields |
14:29 | <ryzokuken> | Aaah, perfect. |
14:29 | <bradleymeck> | i'm curious why you would enumerate a field |
14:29 | <ryzokuken> | Yeah, I just grep'd for it, it doesn't. |
14:30 | <bradleymeck> | ah, no https://tc39.es/ecma402/#sec-basicformatmatcher has it |
14:30 | <bradleymeck> | "For each property shown in Table 6, do" |
14:31 | <ryzokuken> | Ah, sounds good. I can just reference a table instead. |
14:31 | <ryzokuken> | Thanks a ton for clarifying this. |