Skip to content

Commit

Permalink
Re-named the Codec functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardoejp committed Aug 21, 2023
1 parent 7c144b9 commit b548a7e
Show file tree
Hide file tree
Showing 154 changed files with 751 additions and 710 deletions.
6 changes: 3 additions & 3 deletions licentia/source/program/licentia.lux
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@
(do (try.with io.monad)
[blob (of file.default read input)
document (io#wrap (do [! try.monad]
[raw_json (of utf8.codec decoded blob)
[raw_json (of utf8.codec projection blob)
json (|> raw_json
java/lang/String::trim
(of json.codec decoded))]
(of json.codec projection))]
(|> json
(<json>.value /input.license)
(of ! each /output.license))))]
(of file.default write (of utf8.codec encoded document) output)))]
(of file.default write (of utf8.codec injection document) output)))]
(wrap (debug.log! (when ?done
{try.#Success _}
(success_message output)
Expand Down
4 changes: 2 additions & 2 deletions lux-c++/source/program.lux
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@

(the (ingest context content)
(|> content
(of utf8.codec decoded)
(of utf8.codec projection)
try.trusted
(as /runtime.Declaration)))

Expand Down Expand Up @@ -270,7 +270,7 @@
platform.#runtime /runtime.translation

platform.#phase_wrapper ..phase_wrapper
platform.#write (|>> _.code (of utf8.codec encoded))]])))
platform.#write (|>> _.code (of utf8.codec injection))]])))

(the (extender _)
Extender
Expand Down
7 changes: 5 additions & 2 deletions lux-cl/source/program.lux
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,10 @@
(wrap [global value definition]))))

(the (ingest context content)
(|> content (of encoding.utf8 decoded) try.trusted (as (_.Expression Any))))
(|> content
(of encoding.utf8 projection)
try.trusted
(as (_.Expression Any))))

(the (re_learn context content)
(run! content))
Expand All @@ -359,7 +362,7 @@
platform.#host host
platform.#phase common_lisp.translate
platform.#runtime runtime.translate
platform.#write (|>> _.code (of encoding.utf8 encoded))])))
platform.#write (|>> _.code (of encoding.utf8 injection))])))

(the get_ecl_cli_inputs
(let [@idx (_.var "i")]
Expand Down
12 changes: 9 additions & 3 deletions lux-js/source/program.lux
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,10 @@
(the (define context custom [_ input]) (..define! interpreter context custom input))

(the (ingest context content)
(|> content (of utf8.codec decoded) try.trusted (as _.Statement)))
(|> content
(of utf8.codec projection)
try.trusted
(as _.Statement)))

(the (re_learn context custom content)
(..execute! interpreter content))
Expand Down Expand Up @@ -617,7 +620,10 @@
(the (define context custom [_ input]) (..define! context custom input))

(the (ingest context content)
(|> content (of utf8.codec decoded) try.trusted (as _.Statement)))
(|> content
(of utf8.codec projection)
try.trusted
(as _.Statement)))

(the (re_learn context custom content)
(..execute! content))
Expand Down Expand Up @@ -654,7 +660,7 @@
platform.#phase js.expression
platform.#runtime runtime.translate
platform.#phase_wrapper ..phase_wrapper
platform.#write (|>> _.code (of utf8.codec encoded))])))
platform.#write (|>> _.code (of utf8.codec injection))])))

(the (lux_program context program)
(Program _.Expression _.Statement)
Expand Down
11 changes: 7 additions & 4 deletions lux-lua/source/program.lux
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@

(the (ingest context content)
(|> content
(of utf8.codec decoded)
(of utf8.codec projection)
try.trusted
(as _.Statement)))

Expand Down Expand Up @@ -774,7 +774,10 @@
(in [global value definition]))))

(the (ingest context content)
(|> content (of utf8.codec decoded) try.trusted (as _.Statement)))
(|> content
(of utf8.codec projection)
try.trusted
(as _.Statement)))

(the (re_learn context custom content)
(run! content))
Expand Down Expand Up @@ -854,7 +857,7 @@
platform.#phase lua.expression
platform.#runtime runtime.translate
platform.#phase_wrapper (..phase_wrapper ..to_host)
platform.#write (|>> _.code (of utf8.codec encoded))]])))]
platform.#write (|>> _.code (of utf8.codec injection))]])))]
(for .old <jvm>
.jvm <jvm>
.lua (the platform
Expand All @@ -866,7 +869,7 @@
platform.#phase lua.expression
platform.#runtime runtime.translate
platform.#phase_wrapper (..phase_wrapper ..to_host)
platform.#write (|>> _.code (of utf8.codec encoded))])))))
platform.#write (|>> _.code (of utf8.codec injection))])))))

(the (lux_program context program)
(Program _.Expression _.Statement)
Expand Down
2 changes: 1 addition & 1 deletion lux-mode/lux-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ Called by `imenu--generic-function'."
(type//syntax (altRE "Union" "Or" "Variant"
"Tuple" "And" "Record"
"Rec"
"Nominal" "->"
"Nominal" "->" "<-"
"All" "Ex"
"Interface"
"Class"
Expand Down
7 changes: 5 additions & 2 deletions lux-php/source/program.lux
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,10 @@
(wrap [global value definition]))))

(the (ingest context content)
(|> content (of utf8.codec decoded) try.trusted (as _.Statement)))
(|> content
(of utf8.codec projection)
try.trusted
(as _.Statement)))

(the (re_learn context content)
(run! content))
Expand All @@ -516,7 +519,7 @@
platform.#host host
platform.#phase php.translate
platform.#runtime runtime.translate
platform.#write (|>> _.code (of utf8.codec encoded))])))
platform.#write (|>> _.code (of utf8.codec injection))])))

(the (program context program)
(Program _.Expression _.Statement)
Expand Down
9 changes: 6 additions & 3 deletions lux-python/source/program.lux
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@

(the (ingest context content)
(|> content
(of utf8.codec decoded)
(of utf8.codec projection)
try.trusted
(as (_.Statement Any))))

Expand Down Expand Up @@ -486,7 +486,10 @@
(the define! define!)

(the (ingest context content)
(|> content (of utf8.codec decoded) try.trusted (as (_.Statement Any))))
(|> content
(of utf8.codec projection)
try.trusted
(as (_.Statement Any))))

(the (re_learn context content)
(execute! content))
Expand Down Expand Up @@ -541,7 +544,7 @@
platform.#phase python.expression
platform.#runtime runtime.translate
platform.#phase_wrapper ..phase_wrapper
platform.#write (|>> _.code (of utf8.codec encoded))])))
platform.#write (|>> _.code (of utf8.codec injection))])))

(the (lux_program context program)
(Program (_.Expression Any) (_.Statement Any))
Expand Down
7 changes: 5 additions & 2 deletions lux-r/source/program.lux
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,10 @@
(wrap [global value definition]))))

(the (ingest context content)
(|> content (of utf8.codec decoded) try.trusted (as _.Expression)))
(|> content
(of utf8.codec projection)
try.trusted
(as _.Expression)))

(the (re_learn context content)
(run! content))
Expand All @@ -558,7 +561,7 @@
platform.#host host
platform.#phase r.translate
platform.#runtime runtime.translate
platform.#write (|>> _.code (of utf8.codec encoded))]])))
platform.#write (|>> _.code (of utf8.codec injection))]])))

(the (program context program)
(Program _.Expression _.Expression)
Expand Down
4 changes: 2 additions & 2 deletions lux-ruby/source/program.lux
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,7 @@

(the (ingest context content)
(|> content
(of utf8.codec decoded)
(of utf8.codec projection)
try.trusted
(as _.Statement)))

Expand Down Expand Up @@ -974,7 +974,7 @@
platform.#phase ruby.expression
platform.#runtime runtime.translate
platform.#phase_wrapper ..phase_wrapper
platform.#write (|>> _.code (of utf8.codec encoded))])))
platform.#write (|>> _.code (of utf8.codec injection))])))

(the (lux_program context program)
(Program _.Expression _.Statement)
Expand Down
7 changes: 5 additions & 2 deletions lux-scheme/source/program.lux
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,10 @@
(wrap [global value definition]))))

(the (ingest context content)
(|> content (of encoding.utf8 decoded) try.trusted (as _.Expression)))
(|> content
(of encoding.utf8 projection)
try.trusted
(as _.Expression)))

(the (re_learn context content)
(run! content))
Expand All @@ -414,7 +417,7 @@
platform.#host host
platform.#phase scheme.translate
platform.#runtime runtime.translate
platform.#write (|>> _.code (of encoding.utf8 encoded))])))
platform.#write (|>> _.code (of encoding.utf8 injection))])))

(the (program context program)
(Program _.Expression _.Expression)
Expand Down
22 changes: 11 additions & 11 deletions stdlib/source/documentation/lux.lux
Original file line number Diff line number Diff line change
Expand Up @@ -255,25 +255,25 @@
($.definition /.|>
"Piping macro."
($.example (' (|> elems
(list#each int#encoded)
(list#each int#injection)
(interposed " ")
(mix text#composite ""))))
($.comment "=>")
($.example (' (mix text#composite ""
(interposed " "
(list#each int#encoded
(list#each int#injection
elems))))))

($.definition /.<|
"Reverse piping macro."
($.example (' (<| (mix text#composite "")
(interposed " ")
(list#each int#encoded)
(list#each int#injection)
elems)))
($.comment "=>")
($.example (' (mix text#composite ""
(interposed " "
(list#each int#encoded
(list#each int#injection
elems))))))

($.definition /.template
Expand Down Expand Up @@ -565,25 +565,25 @@

($.definition /.|>>
"Similar to the piping macro, but rather than taking an initial object to work on, creates a function for taking it."
($.example (' (|>> (list#each int#encoded)
($.example (' (|>> (list#each int#injection)
(interposed " ")
(mix text#composite ""))))
($.comment "=>")
($.example (' (function (_ <it>)
(mix text#composite ""
(interposed " "
(list#each int#encoded <it>)))))))
(list#each int#injection <it>)))))))

($.definition /.<<|
"Similar to the reverse piping macro, but rather than taking an initial object to work on, creates a function for taking it."
($.example (' (<<| (mix text#composite "")
(interposed " ")
(list#each int#encoded))))
(list#each int#injection))))
($.comment "=>")
($.example (' (function (_ <it>)
(mix text#composite ""
(interposed " "
(list#each int#encoded
(list#each int#injection
<it>)))))))

($.definition /.require
Expand All @@ -602,10 +602,10 @@

($.definition /.of
"Allows accessing the value of a implementation's member."
($.example (' (of codec encoded)))
($.example (' (of codec injection)))

($.comment "Also allows using that value as a function.")
($.example (' (of codec encoded +123))))
($.example (' (of codec injection +123))))

($.definition /.has
"Sets the value of a record at a given tag."
Expand Down Expand Up @@ -705,7 +705,7 @@
[<tests> (with_template [<function> <parameter> <expected>]
[(cover [<function>]
(compare <text>
(of codec encoded <function> <parameter>)))]
(of codec injection <function> <parameter>)))]

[bit #1 "#1"]
[int +123 "+123"]
Expand Down
2 changes: 1 addition & 1 deletion stdlib/source/documentation/lux/control/pipe.lux
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
($.example (' (|> +5
(tuple [(i.* +10)]
[-- (i./ +2)]
[i#encoded]))))
[i#injection]))))
($.comment "=>")
($.example (' [+50 +2 "+5"])))

Expand Down
6 changes: 3 additions & 3 deletions stdlib/source/documentation/lux/data/color/named.lux
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
[($.definition <name>
(let [[red green blue] <name>
[_ name] (symbol <name>)]
(format "R:" (hex#encoded red)
" G:" (hex#encoded green)
" B:" (hex#encoded blue)
(format "R:" (hex#injection red)
" G:" (hex#injection green)
" B:" (hex#injection blue)
" | " (text.replaced "_" " " name))))]))

(`` (the .public documentation
Expand Down
4 changes: 2 additions & 2 deletions stdlib/source/documentation/lux/data/text/unicode/block.lux
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
(template (_ <name>)
[($.definition <name>
(let [[_ name] (symbol <name>)]
(format (hex#encoded (/.start <name>))
"-" (hex#encoded (/.end <name>))
(format (hex#injection (/.start <name>))
"-" (hex#injection (/.end <name>))
" | " (text.replaced "_" " " name))))]))

(`` (the all_1/4
Expand Down
4 changes: 2 additions & 2 deletions stdlib/source/documentation/lux/test/coverage.lux
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@

($.definition /.Coverage)
($.definition /.of)
($.definition /.encoded)
($.definition /.decoded)
($.definition /.injection)
($.definition /.projection)
))
2 changes: 1 addition & 1 deletion stdlib/source/format/lux/data/binary.lux
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@
(with_template [<name> <binary>]
[(the .public <name>
(Format Text)
(|>> (of utf8.codec encoded) <binary>))]
(|>> (of utf8.codec injection) <binary>))]

[utf8_8 ..binary_8]
[utf8_16 ..binary_16]
Expand Down

0 comments on commit b548a7e

Please sign in to comment.