Nice TWiki > Doc > NiceVersusJython (r1.3 vs. r1.4) TWiki webs:
Dev | Doc | Main | TWiki | Sandbox
Doc . { Changes | Index | Search | Go }
 <<O>>  Difference Topic NiceVersusJython (r1.4 - 21 Aug 2003 - MichaelChermside)
Changed:
<
<

[Feel free to improve things, I'm no expert, especially on Nice, but I thought this page would be nice to have. MichaelChermside - 19 Aug 2003]

>
>

A near-copy of this page exists on Python's wiki, at http://www.python.org/cgi-bin/moinmoin/PythonVsNice.

Changed:
<
<

  • Nice uses Java's primitive types. Jython does not -- in Jython, EVERYTHING is an object. Jython will automatically convert java primitive types to Jython int, float, or string types (as appropriate).
Nice has autoboxing so whenever you use as primitive as object it's converted to an Object automaticly.
>
>

  • Nice uses Java's primitive types, but provides "autoboxing", so they are converted to object types automatically if used as an object. Jython does not have autoboxing -- primitive types are ALWAYS treated as objects. Conversion to/from primitive types will occur only when interfacing with java code. So pure computational tasks will be notably slower in Jython.
Deleted:
<
<

a[b] and a[b] = c are syntactic sugar for get(a,b) and set(a,b,c) so by implementing get and set for a class you can use the "[ ]" syntax. The addition of list slicing to Nice is being discussed(suggestions welcome).

Added:
>
>

  • Operator Overloading: Jython allows user-defined classes to declare special methods to overload operators and special language syntax (like subscripting). Nice provides a similar ability to overload the "[]" syntax (collection subscripting), but it doesn't support operator overloading.

Topic NiceVersusJython . { View | Diffs | r1.5 | > | r1.4 | > | r1.3 | More }
Revision r1.3 - 20 Aug 2003 - 15:34 GMT - ArjanB
Revision r1.4 - 21 Aug 2003 - 17:52 GMT - MichaelChermside
Copyright © 1999-2003 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback.