code: function RefStruct(numels) {
      this.fields = [];
      this.push_field = function(val) {
          this.fields.push(val);
      }
      this.set_field = function(pos, val) {
          this.fields[pos] = val;
      }
      this.get_field = function(pos) {
          return this.fields[pos];
      }
      this.get_fields = function() {
          return this.fields;
      }
  }
docs: /* RefStruct: Used for struct-type Glk arguments. After creating the
  object, you should call push_field() the appropriate number of times,
  to set the initial field values. Then set_field() can be used to
  change them, and get_fields() retrieves the list of all fields.
  
  (The usage here is loose, since Javascript is forgiving about arrays.
  Really the caller could call set_field() instead of push_field() --
  or skip that step entirely, as long as the Glk function later calls
  set_field() for each field. Which it should.)