class_docstr: List-like object to hold immutable latent state.
  
  This must either be given a name when constructed::
  
      latent = named.List("root")
  
  or must be immediately stored in a ``named.Object``::
  
      latent = named.Object("root")
      latent.xs = named.List()  # Must be bound to a Object before use.
  
  .. warning:: This data structure is write-once: data may be added but may
      not be mutated or removed. Trying to mutate this data structure may
      result in silent errors.
docstr: Append one new named.Object.
  
  :returns: a new latent object at the end
  :rtype: named.Object
docstr_tok: ["Append","one","new","named.Object",".",":","returns",":","a","new","latent","object","at","the","end",":","rtype",":","named.Object"]
code: def add(self):
      """
      Append one new named.Object.
  
      :returns: a new latent object at the end
      :rtype: named.Object
      """
      if self._name is None:
          raise RuntimeError(
              "Cannot .add() to a named.List before storing it in a named.Object"
          )
      i = len(self)
      value = Object("{}[{}]".format(self._name, i))
      super(Object, value).__setattr__(
          "_set_value", lambda value, i=i: self.__setitem__(i, value)
      )
      self.append(value)
      return value
  
imports: import functools
  import pyro
label_desc: Use image node_id 4 for calling the List obj's underlying member method code with example usage: obj.add() and returns: value