<br><br><div><span class="gmail_quote">On 9/19/07, <b class="gmail_sendername">Göran Krampe</b> <<a href="mailto:goran@krampe.se">goran@krampe.se</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi!<br><br>> On 9/19/07, <a href="mailto:goran@krampe.se">goran@krampe.se</a> <<a href="mailto:goran@krampe.se">goran@krampe.se</a>> wrote:<br>>> "Michael van der Gulik" <<a href="mailto:mikevdg@gmail.com">
mikevdg@gmail.com</a>> wrote:<br>>> > What do you mean by several packages defining names in the same<br>>> namespace?<br>>> > Are you talking about method overrides? Then like I said before, I<br>
>> can't<br>>> > work out how to do this without creating a security issue (I'm<br>>> planning<br>>> on<br>>> > Packages containing completely untrusted code which can be securely
<br>>> execute=<br>>> > d locally).<br>>><br>>> I am not talking about method overrides, no. I am simply talking about<br>>> package P1 defining a class X in N1 and package P2 defining class Y in
<br>>> N1. Nothing magical. :)<br>><br>><br>> My implementation handles this fine. In this case, you'd have P1<br>> containing<br>> N1::X (using Krampe notation) and P2 containing N1::Y. The import list of
<br>> your code using X and Y would include P1 and P2 (import lists contain only<br>> other Namespaces, and Packages are Namespaces).<br><br>If I understand you correctly (there are lots of assumptions here that I<br>
am not totally getting) - you are saying:<br><br>- Package IS a Namespace.<br>- Two packages CAN define names in the same namespace.<br><br>I may be daft but I don't get it. So P1 "contains" N1 and so does P2? And
<br>a package IS a Namespace? So N1 can appear in multiple places in your<br>hierarchy, is that what you mean?<br></blockquote></div><br>Well... kind of. I'll explain it in code:<br><br>Package is a subclass of Namespace; Namespace is a subclass of Dictionary.
<br><br>p1 := Package new.<br>n1 := Namespace new name: #Namespace1.<br>p1 at: #Namespace1 put: n1. " should be p1 addNamespace: n1. "<br>n1 at: #X put: X.<br><br>p2 := Package new.<br>n2 := Namespace new name: #Namespace1.
<br>p1 at: #Namespace1 put: n2.<br>n2 at: #Y put: Y.<br><br>Now, if you add both p1 and p2 to your local import list, you can refer to Namespace1.X and Namespace1.Y.<br><br>Does this answer your question?<br><br>Regards,<br>
Gulik.<br>