aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/documentation/lux/ffi.js.lux
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stdlib/source/documentation/lux/ffi.js.lux46
1 files changed, 22 insertions, 24 deletions
diff --git a/stdlib/source/documentation/lux/ffi.js.lux b/stdlib/source/documentation/lux/ffi.js.lux
index 980ad9a6e..b3860d6a1 100644
--- a/stdlib/source/documentation/lux/ffi.js.lux
+++ b/stdlib/source/documentation/lux/ffi.js.lux
@@ -31,38 +31,36 @@
($.definition /.import
"Easily import types, methods, functions and constants."
- [(import Uint8Array
- "[1]::[0]")
-
- (import TextEncoder
- "[1]::[0]"
- (new [/.String])
- (encode [/.String] Uint8Array))
-
- (import TextDecoder
- "[1]::[0]"
- (new [/.String])
- (decode [/.String] String))])
+ ($.example (import Uint8Array
+ "[1]::[0]"))
+ ($.example (import TextEncoder
+ "[1]::[0]"
+ (new [/.String])
+ (encode [/.String] Uint8Array)))
+ ($.example (import TextDecoder
+ "[1]::[0]"
+ (new [/.String])
+ (decode [/.String] String))))
($.definition /.type_of
"The type of an object, as text."
- [(= "boolean"
- (type_of true))]
- [(= "number"
- (type_of +123.456))]
- [(= "string"
- (type_of "789"))]
- [(= "function"
- (type_of (function (_ value) value)))])
+ ($.example (= "boolean"
+ (type_of true)))
+ ($.example (= "number"
+ (type_of +123.456)))
+ ($.example (= "string"
+ (type_of "789")))
+ ($.example (= "function"
+ (type_of (function (_ value) value)))))
($.definition /.global
"Allows using definitions from the JavaScript host platform."
- [(global .Frac [Math PI])])
+ ($.example (global .Frac [Math PI])))
($.definition /.function
(format "Allows defining closures/anonymous-functions in the form that JavaScript expects."
\n "This is useful for adapting Lux functions for usage by JavaScript code.")
- [(is /.Function
- (function [left right]
- (do_something (as Foo left) (as Bar right))))])
+ ($.example (is /.Function
+ (function [left right]
+ (do_something (as Foo left) (as Bar right))))))
))