No, as it stands, your current primitive syntax will not work. The Java code that you've given here will compile (since it matches the signature of `def reporterSyntax(right: Array[Int], ret: Int, dfault: Int)` ), but that primitive will not do what you're expecting it to do. Instead, since `Syntax.LinksetType()` is actually a constant that evaluates to '64', you've told NetLogo that your primitive takes 64 arguments by default!
Instead, you probably just want to be using the simplest `reporterSyntax` version—the one that has the signature `def reporterSyntax(right: Array[Int], ret: Int)`. As you can see there, the `ret` value that the method accepts—the return type of the primitive—is a single integer, which it means that the primitive must have a single return type, and this holds true for all NetLogo primitives.
So, if you always want your primitive to return both a turtleset and a linkset, the way to do that would actually be to make your `ret` type into `Syntax.ListType()`, and to return a `LogoList` that contains just two elements: the turtleset and the linkset. If you want your primitive to evaluate to either a turtleset _or_ a linkset, it would be best just to create two separate primitives.
Regards,
Jason Bertsche
Software Developer (NetLogo)
Annenberg Hall, Room 223
________________________________________
From: netlog...@googlegroups.com [netlog...@googlegroups.com] on behalf of Simone Gabbriellini [simone.ga...@gmail.com]
Sent: Thursday, April 26, 2012 9:03 AM
To: netlog...@googlegroups.com
Subject: [netlogo-devel] defaultreporter