From 09e2747bf8c6dcdc1d7318f2490f0de37d77b39f Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sun, 5 Sep 2021 21:03:05 -0400 Subject: Added a chapter on cross-platform Lux. --- .../book/the_lux_programming_language/chapter_13.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'documentation/book/the_lux_programming_language/chapter_13.md') diff --git a/documentation/book/the_lux_programming_language/chapter_13.md b/documentation/book/the_lux_programming_language/chapter_13.md index afd08f5fd..1faba95ee 100644 --- a/documentation/book/the_lux_programming_language/chapter_13.md +++ b/documentation/book/the_lux_programming_language/chapter_13.md @@ -28,7 +28,7 @@ Let's explore them. It's all done with the help of the `import:` macro: -``` +```clojure ... Allows importing JVM classes, and using them as types. ... Their methods, fields and enum options can also be imported. (import: java/lang/Object @@ -96,7 +96,7 @@ As you have noticed, it works by creating functions (and constant values) for al Normally, you'd use the `class:` macro: -``` +```clojure ... Allows defining JVM classes in Lux code. ... For example: (class: #final (TestClass A) [Runnable] @@ -131,7 +131,7 @@ Normally, you'd use the `class:` macro: And, for anonymous classes, you'd use `object`: -``` +```clojure ... Allows defining anonymous classes. ... The 1st tuple corresponds to class-level type-variables. ... The 2nd tuple corresponds to parent interfaces. @@ -149,14 +149,14 @@ And, for anonymous classes, you'd use `object`: * Accessing class objects. -``` +```clojure ... Loads the class as a java.lang.Class object. (class_for java/lang/String) ``` * Test instances. -``` +```clojure ... Checks whether an object is an instance of a particular class. ... Caveat emptor: Can't check for polymorphism, so avoid using parameterized classes. (case (check java/lang/String "YOLO") @@ -166,7 +166,7 @@ And, for anonymous classes, you'd use `object`: * Synchronizing threads. -``` +```clojure ... Evaluates body, while holding a lock on a given object. (synchronized object-to-be-locked (exec @@ -177,7 +177,7 @@ And, for anonymous classes, you'd use `object`: Calling multiple methods consecutively -``` +```clojure ... Call a variety of methods on an object. Then, return the object. (do_to object (ClassName::method1 arg0 arg1 arg2) -- cgit v1.2.3