TODOs, part 2 ("todenda"?):

[[ NAMESPACE PMC ]]

* The <namespace>.name() method is being renamed to get_name() for
  consistency, and to allow for the possibility of set_name().

* The return value of <namespace>.get_name(), the parameter to
  <compiler>.get_namespace(), and the parameter to the get_namespace opcode
  should all have the same type.  PDD21 currently wavers between an array of
  strings and a key.  Which one will win is still uncertain.

* Namespace object initialization needs to be de-hacked.

  Objects of the default namespace type are initialized with a ... creative
  use of set_pmc_keyed_str:

    void set_pmc_keyed_str(STRING *key, PMC *value) {
        ...
        int val_is_NS = value->vtable->base_type == enum_class_NameSpace;
        ...
        if (val_is_NS) {
            PMC_pmc_val(value) = SELF;  /* set parent */
            PMC_data(value)    = key;   /* and name */
            ...
        }
    }

  If I'm reading this correctly, the way a namespace object named ["a";"b"]
  is initialized after creation is by

   $P0["a";"b"] = parent_namespace_pmc

  Which is creative but really far too hacky to live, because it means that
  the untyped interface is broken (badly!) for namespace values (not to
  mention that it doesn't notice correctly when its parent namespace is of
  a *customized* namespace type).

  So another way to initialize namespace pmcs must be found pronto.  I'm
  pondering it.

-- 
Chip Salzenberg <[EMAIL PROTECTED]>

Reply via email to