Generally, using `toString` for serialization is not going to turn out
well for you--especially with Java/Scala collections, since it causes
truncation when the collection is above a certain (small) size. Instead,
use something like Java's `ObjectOutputStream`, Scala's `mkString`, or
simply iterate over the list and the build the proper string, yourself.
On 7/30/2014 9:56 AM, Corey Brady wrote:
hi all
i'm working with logo lists through the embedding API, and I am getting a
strange behavior with toString ( or, well, an unfavorable behavior at least)
my context involves passing a list from one embedded instance of NetLogo to
another. I get a list from one instance, assemble a NetLogo method call using
that list (converted as a string) as an argument, and I use commandLater() to
execute it in the other instance.
the conversion to string is needed simply because commandLater takes a string.
for long lists, the string coming through is truncated with ". . . ." at the
end
obviously this causes trouble when it's passed to the receiving NetLogo
instance :)
i happen to be working with NetLogo 4.1.3, but that can change if it helps
is this a known bug/limitation of LogoList?
would you recommend a workaround that hand-converts lists to strings, or an
approach that gets around commandLater()'s need for strings and somehow digs
deeper into the receiving-netlogo's workspace for a way to call the netlogo
procedure directly and using a LogoList argument? (I'm not familiar with this
second path)
thanks
-corey
--
You received this message because you are subscribed to the Google Groups
"netlogo-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.