On Thu, 28 Oct 1999, Thomas McKay wrote:

Here is a quick code example:

% set o [java::new Object]
java0x1
% $o toString
java.lang.Object@80d05fd
% rename $o rect20
% rect20 toString
java.lang.Object@80d05fd

The catch is that you need to delete this renamed object like so.
% rename rect20 {}
% unset o

Yes, it is kind of a hack and it is not really a feature I would
want anyone to depend on, but it works. Just make sure you do
not drop the InternalRep of the variable o because then the object
will be garbage collected (but not the command in this case).

later
mo

> Well, I was hoping to be able to supply a prefix to use in place of the
> "java0x".  My average user would understand it more if they saw "rect20" or
> "polygon34".  I'll poke around a bit and see how hard this would be to add.

Just keep in mind that namespaces are not Itcl. They are just a way
to have "more global" spaces with a prefix on variable and proc names.

later
mo

> I'll try out the namespace commands.  I'm not an experienced traditional-Tcl
> user so it's doubtful I'd notice subtle things not working.
> 
> > -----Original Message-----
> > From: Moses DeJong [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, October 27, 1999 9:43 PM
> > To: [EMAIL PROTECTED]
> > Cc: Jacl
> > Subject: [Tcl Java] Re: [Tcl Java] more 1.2.4 questions
> >
> >
> > On Wed, 27 Oct 1999, Thomas McKay wrote:
> >
> > Well, you can rename reflect objects now (like java0x1)
> > but it is a little tricky because you can not use the
> > variable in a way that changes the InternalRep and
> > then use it like a Java object again. This is
> > actually the same as using a typed null reference, you just
> > need to make sure you don't convert it's InternalRep
> > to something other than a ReflectObject.
> >
> > > I believe there is a way now to associate a name with ReflectObjects
> > > although I've long since forgotten what it is.  Anyone help?
> >
> > I hope so, it passes all the regression tests directly related to
> > namespaces so I think it is 100% working. If you find a case where
> > something works in Tcl but not Jacl I would like to know about it.
> >
> > later
> > Mo DeJong
> >
> > > Second, does namespace work completely?
> > >
> > > Thanks!
> > >
> > > ---
> > > Thomas McKay
> > >
> > > Project Leader
> > > Microcosm Technologies, Inc.
> > > mailto:[EMAIL PROTECTED]
> > >
> > > ----------------------------------------------------------------
> > > The TclJava mailing list is sponsored by Scriptics Corporation.
> > > To subscribe:    send mail to [EMAIL PROTECTED]
> > >                  with the word SUBSCRIBE as the subject.
> > > To unsubscribe:  send mail to [EMAIL PROTECTED]
> > >                  with the word UNSUBSCRIBE as the subject.
> > > To send to the list, send email to '[EMAIL PROTECTED]'.
> > >
> >
> > ----------------------------------------------------------------
> > The TclJava mailing list is sponsored by Scriptics Corporation.
> > To subscribe:    send mail to [EMAIL PROTECTED]
> >                  with the word SUBSCRIBE as the subject.
> > To unsubscribe:  send mail to [EMAIL PROTECTED]
> >                  with the word UNSUBSCRIBE as the subject.
> > To send to the list, send email to '[EMAIL PROTECTED]'.
> >
> 

----------------------------------------------------------------
The TclJava mailing list is sponsored by Scriptics Corporation.
To subscribe:    send mail to [EMAIL PROTECTED]  
                 with the word SUBSCRIBE as the subject.
To unsubscribe:  send mail to [EMAIL PROTECTED] 
                 with the word UNSUBSCRIBE as the subject.
To send to the list, send email to '[EMAIL PROTECTED]'. 

Reply via email to