Pnuts | Description / corresponding Java code | Conditions |
---|---|---|
target :: x ( ... ) | Call the function x in the package target |
There is a package called "target" |
Static method call
target.x(...); |
target is a java.lang.Class object. | |
target :: x | Reference to the variable x in the package target |
There is a package called "target". |
Reference to a static variable
target.x; |
target is a java.lang.Class object. | |
target . x ( ... ) | Call the instance method x of target object |
target is not a java.lang.Class object. |
Call the instance method of the Class object
target.class.x(...); |
target is a java.lang.Class object. | |
target ( ... ) |
Call the function target |
target is a pnuts.lang.PnutsFunction object. |
Create an instance |
target is a java.lang.Class object. | |
foreach i (x) expression |
while (x.hasNext()){ Object i = x.next(); expression } |
x is a java.util.Iterator object. |
while (x.hasMoreElements()){ Object i = x.nextElement(); expression } |
x is a java.util.Enumerator object. | |
target < object target == object |
target.compareTo(object) < 0 target.compareTo(object) == 0 |
target is a java.lang.Comparable object or a java.lang.String object. |
[1,2] |
new Object[]{ new Integer(1), new Integer(2) } |
|
(int[])[1,2] |
new int[]{1, 2} |
|
target [x] target [x] = value |
Dereference of an array, or Assignment of an element.
target[x]; target[x] = value; |
target is an array. |
indexed.get(x) indexed.set(x, value) |
target is a pnuts.lang.Indexed object. | |
n1 + n2 n1 - n2 n1 * n2 n1 / n2 |
n1.add(n2) n1.subtract(n2) n1.multiply(n2) n1.divide(n2) |
Either n1 or n2 a pnuts.lang.Numeric object. |
obj.name obj.name = value obj.name(args) |
obj.get("name") obj.set("name", value) obj.invoke("name", new Object[]{args}) |
obj is a pnuts.lang.Property object or a pnuts.lang.AbstractData object. |
<decimal><unit> e.g. 1.2cm |
factory.make(<decimal>, <unit>) |
A factory object associated with <unit> is registered. Pnuts.registerQuantityFactory(<unit>, QuantityFactory) |