Skip to content

Commit 8025a01

Browse files
committed
Update README.md
1 parent 332c748 commit 8025a01

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

doc/language/java_comparison/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Jsonnet to Java
44
This little code example shows how a Jsonnet config using object-oriented features can be
55
transliterated (in a structure-preserving manner) to use the object-oriented features of Java. Not
66
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
88
cannot all be converted to Jsonnet because they have mutable state and I/O.
99

1010
However said all this, there is a significant overlap between the two languages. This example fits
@@ -34,9 +34,9 @@ Structure of Java code
3434

3535
The translation is as as follows:
3636

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.
3838
* 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.
4040
* Jsonnet fields become Java methods with no parameters (fields are virtual in Jsonnet).
4141
* Jsonnet hidden field status is represented with a method nonHiddenFields which returns a set of
4242
field names. Other fields are considered hidden.

0 commit comments

Comments
 (0)