Re: Can't coerce to string
Charles Goodwin <[email protected]>
| Newsgroups | gmane.comp.java.xwt.core |
|---|---|
| Organization | XWT Foundation |
| Message-ID | <[email protected]> |
On Wed, 2004-03-10 at 21:29, Brian Alliet wrote:
> > 1) why isn't the output guarranteed to be unique?
> > 2) is it not possible for the output to be unique?
>
> Java doesn't provide any way to get a unique string from an object. We could
> construct our own ID by assigning each box a number or something, but that
> would be ugly.
>
> > 3) the reason people do this is because it's _very_ easy. You're
> > taking away a powerful tool for people to use.
>
> Not at all. org.xwt.js allows you to use any object as a key in a hashtable
> (even boxes). The only thing this takes away from you is the ability to do
> ibex.log.info("Box is: " + box) The output from this isn't very helpful
> anyway so I don't think this is a problem.
You lost me. So objects do have a unique id, but it's not a string...
and if you then try to print out said object, it throws up the error?
If so, I'm not convinced it is working like that as I'm encountering
errors using boxes/js-objects as keys in a hash table without involving
them in any manner that might otherwise require them to be recognised as
a string.
--
- Charlie
Charles Goodwin <[email protected]>
Online @ http://www.charlietech.com