diff options
author | Eduardo Julian | 2021-09-19 03:07:56 -0400 |
---|---|---|
committer | Eduardo Julian | 2021-09-19 03:07:56 -0400 |
commit | 0bc2c541ab27e44b760618d15a248a794ab2f98e (patch) | |
tree | b040ba5c8558d4b112acc1edc97839e3db4e40dd /stdlib/source/documentation | |
parent | ad729814254ec3fef8c75b59472bc8108ec7c4c7 (diff) |
Added STDLIB documentation for the different target platforms.
Diffstat (limited to 'stdlib/source/documentation')
-rw-r--r-- | stdlib/source/documentation/lux.lux | 101 | ||||
-rw-r--r-- | stdlib/source/documentation/lux/ffi.lua.lux | 38 | ||||
-rw-r--r-- | stdlib/source/documentation/lux/ffi.py.lux | 59 | ||||
-rw-r--r-- | stdlib/source/documentation/lux/ffi.rb.lux | 1 | ||||
-rw-r--r-- | stdlib/source/documentation/lux/world/console.lux | 50 | ||||
-rw-r--r-- | stdlib/source/documentation/lux/world/file.lux | 77 | ||||
-rw-r--r-- | stdlib/source/documentation/lux/world/file/watch.lux | 69 | ||||
-rw-r--r-- | stdlib/source/documentation/lux/world/net/http/client.lux | 63 | ||||
-rw-r--r-- | stdlib/source/documentation/lux/world/shell.lux | 58 |
9 files changed, 310 insertions, 206 deletions
diff --git a/stdlib/source/documentation/lux.lux b/stdlib/source/documentation/lux.lux index 91480ba4c..8fcfe64d9 100644 --- a/stdlib/source/documentation/lux.lux +++ b/stdlib/source/documentation/lux.lux @@ -1,46 +1,43 @@ (.using - [library - [lux - [program {"+" program:}] - ["$" documentation {"+" documentation:}] - ["[0]" debug] - [control - ["[0]" io] - ["<>" parser - ["<[0]>" code]]] - [data - ["[0]" text {"+" \n} - ["%" format {"+" format}]] - [collection - ["[0]" list] - ["[0]" set]]] - [macro - ["[0]" template]]]] - [\\library - ["[0]" /]] - ["[0]" / "_" - ["[1][0]" abstract] - ["[1][0]" control] - ["[1][0]" data] - ["[1][0]" debug] - ["[1][0]" documentation] - ["[1][0]" extension] - ["[1][0]" ffi] - ["[1][0]" locale] - ["[1][0]" macro] - ["[1][0]" math] - ["[1][0]" meta] - ["[1][0]" program] - ["[1][0]" static] - ["[1][0]" target] - ["[1][0]" test] - ["[1][0]" time] - ["[1][0]" tool] ... TODO: Documentation for this - ["[1][0]" type] - ["[1][0]" world] - ... ["[1][0]" target "_" - ... <target>] - ]) + [library + [lux + [program {"+" program:}] + ["$" documentation {"+" documentation:}] + ["[0]" debug] + [control + ["[0]" io] + ["<>" parser + ["<[0]>" code]]] + [data + ["[0]" text {"+" \n} + ["%" format {"+" format}]] + [collection + ["[0]" list] + ["[0]" set]]] + [macro + ["[0]" template]]]] + [\\library + ["[0]" /]] + ["[0]" / "_" + ["[1][0]" abstract] + ["[1][0]" control] + ["[1][0]" data] + ["[1][0]" debug] + ["[1][0]" documentation] + ["[1][0]" extension] + ["[1][0]" ffi] + ["[1][0]" locale] + ["[1][0]" macro] + ["[1][0]" math] + ["[1][0]" meta] + ["[1][0]" program] + ["[1][0]" static] + ["[1][0]" target] + ["[1][0]" test] + ["[1][0]" time] + ["[1][0]" tool] ... TODO: Documentation for this + ["[1][0]" type] + ["[1][0]" world]]) (documentation: /.prelude_module (format "The name of the prelude module" @@ -597,16 +594,16 @@ (documentation: /.using "Module-definition macro." [(.using - [lux "*" - [control - ["M" monad "*"]] - [data - maybe - ["[0]" name ("[1]#[0]" codec)]] - [macro - code]] - [// - [type ("[0]" equivalence)]])]) + [lux "*" + [control + ["M" monad "*"]] + [data + maybe + ["[0]" name ("[1]#[0]" codec)]] + [macro + code]] + [// + [type ("[0]" equivalence)]])]) (documentation: /.# "Allows accessing the value of a implementation's member." diff --git a/stdlib/source/documentation/lux/ffi.lua.lux b/stdlib/source/documentation/lux/ffi.lua.lux new file mode 100644 index 000000000..79d6f03ac --- /dev/null +++ b/stdlib/source/documentation/lux/ffi.lua.lux @@ -0,0 +1,38 @@ +(.using + [library + [lux {"-" int char type :as} + ["$" documentation {"+" documentation:}] + [data + ["[0]" text {"+" \n} + ["%" format {"+" format}]]] + [macro + ["[0]" template]]]] + [\\library + ["[0]" /]]) + +(documentation: /.import: + "Easily import types, methods, functions and constants." + [(import: (os/getenv [..String] "io" "?" ..String))]) + +(documentation: /.closure + (format "Allows defining closures/anonymous-functions in the form that Lua expects." + \n "This is useful for adapting Lux functions for usage by Lua code.") + [(: ..Function + (closure [left right] + (do_something (:as Foo left) (:as Bar right))))]) + +(.def: .public documentation + (.List $.Module) + ($.module /._ + "" + [..import: + ..closure + ($.default (/.Object brand)) + ($.default /.Nil) + ($.default /.Function) + ($.default /.Table) + ($.default /.Boolean) + ($.default /.Integer) + ($.default /.Float) + ($.default /.String)] + [])) diff --git a/stdlib/source/documentation/lux/ffi.py.lux b/stdlib/source/documentation/lux/ffi.py.lux new file mode 100644 index 000000000..6b24c1926 --- /dev/null +++ b/stdlib/source/documentation/lux/ffi.py.lux @@ -0,0 +1,59 @@ +(.using + [library + [lux {"-" int char type :as} + ["$" documentation {"+" documentation:}] + [data + ["[0]" text {"+" \n} + ["%" format {"+" format}]]] + [macro + ["[0]" template]]]] + [\\library + ["[0]" /]]) + +(documentation: /.import: + "Easily import types, methods, functions and constants." + [(import: os + ["[1]::[0]" + ("static" F_OK Integer) + ("static" R_OK Integer) + ("static" W_OK Integer) + ("static" X_OK Integer) + + ("static" mkdir [String] "io" "try" "?" Any) + ("static" access [String Integer] "io" "try" Boolean) + ("static" remove [String] "io" "try" "?" Any) + ("static" rmdir [String] "io" "try" "?" Any) + ("static" rename [String String] "io" "try" "?" Any) + ("static" listdir [String] "io" "try" (Array String))]) + + (import: os/path + ["[1]::[0]" + ("static" isfile [String] "io" "try" Boolean) + ("static" isdir [String] "io" "try" Boolean) + ("static" sep String) + ("static" getsize [String] "io" "try" Integer) + ("static" getmtime [String] "io" "try" Float)])]) + +(documentation: /.lambda + (format "Allows defining closures/anonymous-functions in the form that Python expects." + \n "This is useful for adapting Lux functions for usage by Python code.") + [(: ..Function + (lambda [left right] + (do_something (:as Foo left) + (:as Bar right))))]) + +(.def: .public documentation + (.List $.Module) + ($.module /._ + "" + [..import: + ..lambda + ($.default (/.Object brand)) + ($.default /.None) + ($.default /.Dict) + ($.default /.Function) + ($.default /.Boolean) + ($.default /.Integer) + ($.default /.Float) + ($.default /.String)] + [])) diff --git a/stdlib/source/documentation/lux/ffi.rb.lux b/stdlib/source/documentation/lux/ffi.rb.lux index 8f9a93724..33b4ef148 100644 --- a/stdlib/source/documentation/lux/ffi.rb.lux +++ b/stdlib/source/documentation/lux/ffi.rb.lux @@ -39,7 +39,6 @@ ($.default (/.Object brand)) ($.default /.Nil) ($.default /.Function) - ($.default /.Function) ($.default /.Integer) ($.default /.Float) ($.default /.String)] diff --git a/stdlib/source/documentation/lux/world/console.lux b/stdlib/source/documentation/lux/world/console.lux index 97ee7bacf..c091e6d36 100644 --- a/stdlib/source/documentation/lux/world/console.lux +++ b/stdlib/source/documentation/lux/world/console.lux @@ -1,17 +1,18 @@ (.using - [library - [lux "*" - ["$" documentation {"+" documentation:}] - [control - ["<>" parser - ["<[0]>" code]]] - [data - ["[0]" text {"+" \n} - ["%" format {"+" format}]]] - [macro - ["[0]" template]]]] - [\\library - ["[0]" /]]) + [library + [lux "*" + ["$" documentation {"+" documentation:}] + ["@" target] + [control + ["<>" parser + ["<[0]>" code]]] + [data + ["[0]" text {"+" \n} + ["%" format {"+" format}]]] + [macro + ["[0]" template]]]] + [\\library + ["[0]" /]]) (documentation: (/.Console !) "An interface to console/terminal I/O.") @@ -30,14 +31,15 @@ (.def: .public documentation (.List $.Module) - ($.module /._ - "" - [..Console - ..write_line - ..Mock - ..mock - ($.default /.async) - ($.default /.cannot_open) - ($.default /.cannot_close) - ($.default /.default)] - [])) + (`` (`` ($.module /._ + "" + [..Console + ..write_line + ..Mock + ..mock + ($.default /.async) + (~~ (for [@.jvm (~~ (as_is ($.default /.cannot_open) + ($.default /.cannot_close) + ($.default /.default)))] + (~~ (as_is))))] + [])))) diff --git a/stdlib/source/documentation/lux/world/file.lux b/stdlib/source/documentation/lux/world/file.lux index 866ecf959..e2f203abe 100644 --- a/stdlib/source/documentation/lux/world/file.lux +++ b/stdlib/source/documentation/lux/world/file.lux @@ -1,19 +1,20 @@ (.using - [library - [lux "*" - ["$" documentation {"+" documentation:}] - [control - ["<>" parser - ["<[0]>" code]]] - [data - ["[0]" text {"+" \n} - ["%" format {"+" format}]]] - [macro - ["[0]" template]]]] - [\\library - ["[0]" /]] - ["[0]" / "_" - ["[1][0]" watch]]) + [library + [lux "*" + ["$" documentation {"+" documentation:}] + ["@" target] + [control + ["<>" parser + ["<[0]>" code]]] + [data + ["[0]" text {"+" \n} + ["%" format {"+" format}]]] + [macro + ["[0]" template]]]] + [\\library + ["[0]" /]] + ["[0]" / "_" + ["[1][0]" watch]]) (documentation: /.Path "A path to a file or a directory in a file-system.") @@ -53,24 +54,28 @@ (.def: .public documentation (.List $.Module) - ($.module /._ - "" - [..Path - ..System - ..parent - ..name - ..rooted - ..exists? - ..mock - ..make_directories - ..make_file - ($.default /.async) - ($.default /.cannot_make_file) - ($.default /.cannot_find_file) - ($.default /.cannot_delete) - ($.default /.cannot_make_directory) - ($.default /.cannot_find_directory) - ($.default /.cannot_read_all_data) - ($.default /.cannot_modify_file) - ($.default /.default)] - [/watch.documentation])) + (`` (`` ($.module /._ + "" + [..Path + ..System + ..parent + ..name + ..rooted + ..exists? + ..mock + ..make_directories + ..make_file + ($.default /.async) + ($.default /.cannot_make_file) + ($.default /.cannot_find_file) + ($.default /.cannot_delete) + ($.default /.cannot_make_directory) + ($.default /.cannot_find_directory) + ($.default /.cannot_read_all_data) + (~~ (for [@.jvm (~~ (as_is ($.default /.cannot_modify_file) + ($.default /.default))) + @.js (~~ (as_is ($.default /.default))) + @.python (~~ (as_is ($.default /.default))) + @.ruby (~~ (as_is ($.default /.default)))] + (~~ (as_is))))] + [/watch.documentation])))) diff --git a/stdlib/source/documentation/lux/world/file/watch.lux b/stdlib/source/documentation/lux/world/file/watch.lux index 3328fba20..14b9faa0a 100644 --- a/stdlib/source/documentation/lux/world/file/watch.lux +++ b/stdlib/source/documentation/lux/world/file/watch.lux @@ -1,17 +1,18 @@ (.using - [library - [lux "*" - ["$" documentation {"+" documentation:}] - [control - ["<>" parser - ["<[0]>" code]]] - [data - ["[0]" text {"+" \n} - ["%" format {"+" format}]]] - [macro - ["[0]" template]]]] - [\\library - ["[0]" /]]) + [library + [lux "*" + ["$" documentation {"+" documentation:}] + ["@" target] + [control + ["<>" parser + ["<[0]>" code]]] + [data + ["[0]" text {"+" \n} + ["%" format {"+" format}]]] + [macro + ["[0]" template]]]] + [\\library + ["[0]" /]]) (documentation: /.Concern "A particular concern to watch-out for.") @@ -33,26 +34,28 @@ \n "Must be given a path separator for the file-system.") [(mock separator)]) -(documentation: /.default - "The default watcher for the default file-system.") +(for [@.jvm (as_is (documentation: /.default + "The default watcher for the default file-system."))] + (as_is)) (.def: .public documentation (.List $.Module) - ($.module /._ - "" - [..Concern - ..also - ..Watcher - ..polling - ..mock - ..default - ($.default /.creation) - ($.default /.creation?) - ($.default /.modification) - ($.default /.modification?) - ($.default /.deletion) - ($.default /.deletion?) - ($.default /.all) - ($.default /.not_being_watched) - ($.default /.cannot_poll_a_non_existent_directory)] - [])) + (`` (`` ($.module /._ + "" + [..Concern + ..also + ..Watcher + ..polling + ..mock + ($.default /.creation) + ($.default /.creation?) + ($.default /.modification) + ($.default /.modification?) + ($.default /.deletion) + ($.default /.deletion?) + ($.default /.all) + ($.default /.not_being_watched) + ($.default /.cannot_poll_a_non_existent_directory) + (~~ (for [@.jvm (~~ (as_is ..default))] + (~~ (as_is))))] + [])))) diff --git a/stdlib/source/documentation/lux/world/net/http/client.lux b/stdlib/source/documentation/lux/world/net/http/client.lux index d3124090c..a11e8a0bb 100644 --- a/stdlib/source/documentation/lux/world/net/http/client.lux +++ b/stdlib/source/documentation/lux/world/net/http/client.lux @@ -1,17 +1,18 @@ (.using - [library - [lux "*" - ["$" documentation {"+" documentation:}] - [control - ["<>" parser - ["<[0]>" code]]] - [data - ["[0]" text {"+" \n} - ["%" format {"+" format}]]] - [macro - ["[0]" template]]]] - [\\library - ["[0]" /]]) + [library + [lux "*" + ["$" documentation {"+" documentation:}] + ["@" target] + [control + ["<>" parser + ["<[0]>" code]]] + [data + ["[0]" text {"+" \n} + ["%" format {"+" format}]]] + [macro + ["[0]" template]]]] + [\\library + ["[0]" /]]) (documentation: (/.Client !) "A HTTP client capable of issuing requests to a HTTP server.") @@ -29,26 +30,24 @@ [/.connect] [/.options] [/.trace] - [/.default] - [/.async] - [/.headers] ) (.def: .public documentation (.List $.Module) - ($.module /._ - "" - [..Client - ..post - ..get - ..put - ..patch - ..delete - ..head - ..connect - ..options - ..trace - ..default - ..async - ..headers] - [])) + (`` (`` ($.module /._ + "" + [..Client + ..post + ..get + ..put + ..patch + ..delete + ..head + ..connect + ..options + ..trace + ($.default /.async) + ($.default /.headers) + (~~ (for [@.jvm (~~ (as_is ($.default /.default)))] + (~~ (as_is))))] + [])))) diff --git a/stdlib/source/documentation/lux/world/shell.lux b/stdlib/source/documentation/lux/world/shell.lux index 9b283f847..0a39e0c6a 100644 --- a/stdlib/source/documentation/lux/world/shell.lux +++ b/stdlib/source/documentation/lux/world/shell.lux @@ -1,17 +1,18 @@ (.using - [library - [lux "*" - ["$" documentation {"+" documentation:}] - [control - ["<>" parser - ["<[0]>" code]]] - [data - ["[0]" text {"+" \n} - ["%" format {"+" format}]]] - [macro - ["[0]" template]]]] - [\\library - ["[0]" /]]) + [library + [lux "*" + ["$" documentation {"+" documentation:}] + ["@" target] + [control + ["<>" parser + ["<[0]>" code]]] + [data + ["[0]" text {"+" \n} + ["%" format {"+" format}]]] + [macro + ["[0]" template]]]] + [\\library + ["[0]" /]]) (documentation: /.Exit "A program exit code.") @@ -37,18 +38,19 @@ (.def: .public documentation (.List $.Module) - ($.module /._ - "" - [..Exit - ..Process - ..Command - ..Argument - ..Shell - ..Mock - ..mock - ($.default /.normal) - ($.default /.error) - ($.default /.async) - ($.default /.no_more_output) - ($.default /.default)] - [])) + (`` (`` ($.module /._ + "" + [..Exit + ..Process + ..Command + ..Argument + ..Shell + ..Mock + ..mock + ($.default /.normal) + ($.default /.error) + ($.default /.async) + (~~ (for [@.jvm (~~ (as_is ($.default /.no_more_output) + ($.default /.default)))] + (~~ (as_is))))] + [])))) |