@@ -4,7 +4,7 @@ Jsonnet to Java
4
4
This little code example shows how a Jsonnet config using object-oriented features can be
5
5
transliterated (in a structure-preserving manner) to use the object-oriented features of Java. Not
6
6
all Jsonnet programs can be converted to Java because Jsonnet has mixins and virtual inner classes.
7
- The semantics are also different, as Jsonnet is lazy and Java is eager. Likewise, Java programs
7
+ Execution order is also different, as Jsonnet is lazy and Java is eager. Likewise, Java programs
8
8
cannot all be converted to Jsonnet because they have mutable state and I/O.
9
9
10
10
However said all this, there is a significant overlap between the two languages. This example fits
@@ -34,9 +34,9 @@ Structure of Java code
34
34
35
35
The translation is as as follows:
36
36
37
- * Everything is typed as Object, as Jsonnet is dynamically typed.
37
+ * Everything is typed as Object, as Jsonnet is dynamically typed. Everything is public, as is implicit in Jsonnet.
38
38
* Jsonnet arrays are Object[ ] , and primitives are Boolean / Double / String.
39
- * Jsonnet objects because singleton instances of Java classes that extend JsonnetObject.
39
+ * Jsonnet objects are singleton instances of named Java classes that extend JsonnetObject.
40
40
* Jsonnet fields become Java methods with no parameters (fields are virtual in Jsonnet).
41
41
* Jsonnet hidden field status is represented with a method nonHiddenFields which returns a set of
42
42
field names. Other fields are considered hidden.
0 commit comments