diff options
Diffstat (limited to '')
24 files changed, 1167 insertions, 75 deletions
diff --git a/locale/eo/LC_MESSAGES/_articles/2020-10-05-swift2nix-run-swift-inside-nix-builds.po b/locale/eo/LC_MESSAGES/_articles/2020-10-05-swift2nix-run-swift-inside-nix-builds.po index 86c8389..3c7e6ec 100644 --- a/locale/eo/LC_MESSAGES/_articles/2020-10-05-swift2nix-run-swift-inside-nix-builds.po +++ b/locale/eo/LC_MESSAGES/_articles/2020-10-05-swift2nix-run-swift-inside-nix-builds.po @@ -12,8 +12,8 @@ msgstr "" msgid "" "I wrote a simple little tool called " -"[swift2nix](https://git.euandreh.xyz/swift2nix/) that allows you trick" -" Swift's package manager into assuming everything is set up. Here's the " +"[swift2nix](https://git.euandreh.xyz/swift2nix/) that allows you trick " +"Swift's package manager into assuming everything is set up. Here's the " "example from swift2nix's README file:" msgstr "" diff --git a/locale/eo/LC_MESSAGES/_articles/2020-11-12-durable-persistent-trees-and-parser-combinators-building-a-database.po b/locale/eo/LC_MESSAGES/_articles/2020-11-12-durable-persistent-trees-and-parser-combinators-building-a-database.po index 0e0bc8c..ecd28a5 100644 --- a/locale/eo/LC_MESSAGES/_articles/2020-11-12-durable-persistent-trees-and-parser-combinators-building-a-database.po +++ b/locale/eo/LC_MESSAGES/_articles/2020-11-12-durable-persistent-trees-and-parser-combinators-building-a-database.po @@ -381,18 +381,18 @@ msgstr "" #~ msgid "" #~ "I've started a fork of cbindgen: " -#~ "[x-bindgen](https://git.euandreh.xyz/x-bindgen/). Right now it is just " -#~ "a copy of cbindgen verbatim, and I plan to remove all C and C++ emitting " -#~ "code from it, and add a IR emitting code instead." +#~ "[x-bindgen](https://git.euandreh.xyz/x-bindgen/). Right now it is just a " +#~ "copy of cbindgen verbatim, and I plan to remove all C and C++ emitting code " +#~ "from it, and add a IR emitting code instead." #~ msgstr "" #~ msgid "" #~ "When starting working on x-bindgen, I realized I didn't know what to look " #~ "for in a header file, as I haven't written any C code in many years. So as I" -#~ " was writing [libedn](https://git.euandreh.xyz/libedn/), I didn't know " -#~ "how to build a good C API to expose. So I tried porting the code to C, and " -#~ "right now I'm working on building a *good* C API for a JSON parser using " -#~ "parser combinators: [ParsecC](https://git.euandreh.xyz/parsecc/)." +#~ " was writing [libedn](https://git.euandreh.xyz/libedn/), I didn't know how " +#~ "to build a good C API to expose. So I tried porting the code to C, and right" +#~ " now I'm working on building a *good* C API for a JSON parser using parser " +#~ "combinators: [ParsecC](https://git.euandreh.xyz/parsecc/)." #~ msgstr "" #~ msgid "" diff --git a/locale/eo/LC_MESSAGES/_articles/2021-01-26-ann-remembering-add-memory-to-dmenu-fzf-and-similar-tools.po b/locale/eo/LC_MESSAGES/_articles/2021-01-26-ann-remembering-add-memory-to-dmenu-fzf-and-similar-tools.po index a7e3382..c85754b 100644 --- a/locale/eo/LC_MESSAGES/_articles/2021-01-26-ann-remembering-add-memory-to-dmenu-fzf-and-similar-tools.po +++ b/locale/eo/LC_MESSAGES/_articles/2021-01-26-ann-remembering-add-memory-to-dmenu-fzf-and-similar-tools.po @@ -269,9 +269,9 @@ msgstr "" msgid "" "For my personal use, I've [packaged](https://git.euandreh.xyz/package-" -"repository/) `remembering` for GNU Guix and Nix. Packaging it to any " -"other distribution should be trivial, or just downloading the tarball and " -"running `[sudo] make install`." +"repository/) `remembering` for GNU Guix and Nix. Packaging it to any other " +"distribution should be trivial, or just downloading the tarball and running " +"`[sudo] make install`." msgstr "" #~ msgid "" @@ -288,8 +288,8 @@ msgstr "" #~ msgid "" #~ "Today I pushed v0.1.0 of " -#~ "[remembering](https://git.euandreh.xyz/remembering/), a tool to " -#~ "enhance the interactive usability of menu-like tools, such as " +#~ "[remembering](https://git.euandreh.xyz/remembering/), a tool to enhance the " +#~ "interactive usability of menu-like tools, such as " #~ "[dmenu](https://tools.suckless.org/dmenu/) and " #~ "[fzf](https://github.com/junegunn/fzf)." #~ msgstr "" diff --git a/locale/eo/LC_MESSAGES/_pastebins/2021-04-03-javascript-naive-slugify.po b/locale/eo/LC_MESSAGES/_pastebins/2021-04-03-javascript-naive-slugify.po new file mode 100644 index 0000000..6f638f2 --- /dev/null +++ b/locale/eo/LC_MESSAGES/_pastebins/2021-04-03-javascript-naive-slugify.po @@ -0,0 +1,44 @@ +# +msgid "" +msgstr "" + +msgid "title: JavaScript naive slugify" +msgstr "" + +msgid "date: 2021-04-03" +msgstr "" + +msgid "layout: post" +msgstr "" + +msgid "lang: en" +msgstr "" + +msgid "ref: javascript-naive-slugify" +msgstr "" + +msgid "" +"const s = \"Pézão: açaí, saci-pererê.\";\n" +"\n" +"function slugify(s) {\n" +" return s\n" +" .toLowerCase()\n" +" .replaceAll(\":\", \"\")\n" +" .replaceAll(\".\", \"\")\n" +" .replaceAll(\",\", \"\")\n" +" .replaceAll(\"-\", \"\")\n" +" .replaceAll(\"á\", \"a\")\n" +" .replaceAll(\"ã\", \"a\")\n" +" .replaceAll(\"à\", \"a\")\n" +" .replaceAll(\"é\", \"e\")\n" +" .replaceAll(\"ê\", \"e\")\n" +" .replaceAll(\"í\", \"i\")\n" +" .replaceAll(\"ó\", \"o\")\n" +" .replaceAll(\"ô\", \"o\")\n" +" .replaceAll(\"ú\", \"u\")\n" +" .replaceAll(\"ü\", \"u\")\n" +" .replaceAll(\"ç\", \"c\");\n" +"}\n" +"\n" +"console.log(slugify(s));\n" +msgstr "" diff --git a/locale/eo/LC_MESSAGES/_screencasts/2021-02-07-autoqemu-automate-installation-and-ssh-setup-of-iso-os-images.po b/locale/eo/LC_MESSAGES/_screencasts/2021-02-07-autoqemu-automate-installation-and-ssh-setup-of-iso-os-images.po index badc41e..d0e9b44 100644 --- a/locale/eo/LC_MESSAGES/_screencasts/2021-02-07-autoqemu-automate-installation-and-ssh-setup-of-iso-os-images.po +++ b/locale/eo/LC_MESSAGES/_screencasts/2021-02-07-autoqemu-automate-installation-and-ssh-setup-of-iso-os-images.po @@ -57,14 +57,6 @@ msgid "It assumes that `$HOME/.local/bin` is in `$PATH`." msgstr "" msgid "" -"This screencast is a simple demo of automating the installation of Alpine " -"Linux 3.12.3 standard x86_64 with " -"[AutoQEMU](https://git.euandreh.xyz/autoqemu/), which is nothing more " -"than POSIX sh, [expect](https://core.tcl-lang.org/expect/index) scripts and " -"Makefiles glued together." -msgstr "" - -msgid "" "pushd `mktemp -d`\n" "git clone https://git.euandreh.xyz/autoqemu .\n" "make\n" @@ -72,6 +64,22 @@ msgid "" "autoqemu ssh alpine\n" msgstr "" +msgid "" +"This screencast is a simple demo of automating the installation of Alpine " +"Linux 3.12.3 standard x86_64 with " +"[AutoQEMU](https://git.euandreh.xyz/autoqemu/about), which is nothing more " +"than POSIX sh, [expect](https://core.tcl-lang.org/expect/index) scripts and " +"Makefiles glued together." +msgstr "" + +#~ msgid "" +#~ "This screencast is a simple demo of automating the installation of Alpine " +#~ "Linux 3.12.3 standard x86_64 with " +#~ "[AutoQEMU](https://git.euandreh.xyz/autoqemu/), which is nothing more than " +#~ "POSIX sh, [expect](https://core.tcl-lang.org/expect/index) scripts and " +#~ "Makefiles glued together." +#~ msgstr "" + #~ msgid "" #~ "pushd `mktemp -d`\n" #~ "git clone https://git.euandreh.xyz/autoqemu .\n" diff --git a/locale/eo/LC_MESSAGES/_tils/2020-09-05-pull-requests-with-git-the-old-school-way.po b/locale/eo/LC_MESSAGES/_tils/2020-09-05-pull-requests-with-git-the-old-school-way.po index 182061b..1610cea 100644 --- a/locale/eo/LC_MESSAGES/_tils/2020-09-05-pull-requests-with-git-the-old-school-way.po +++ b/locale/eo/LC_MESSAGES/_tils/2020-09-05-pull-requests-with-git-the-old-school-way.po @@ -25,9 +25,9 @@ msgid "" "The only difference is that you're working with only Git itself, so you're " "not tied to any Git hosting provider: you can send pull requests across them" " transparently! You could even use your own " -"[cgit](https://git.zx2c4.com/cgit/) installation. No need to be locked" -" in by any of them, putting the \"D\" back in \"DVCS\": it's a " -"**distributed** version control system." +"[cgit](https://git.zx2c4.com/cgit/) installation. No need to be locked in by" +" any of them, putting the \"D\" back in \"DVCS\": it's a **distributed** " +"version control system." msgstr "" msgid "`git request-pull` introduction" diff --git a/locale/eo/LC_MESSAGES/_tils/2021-04-24-clojure-auto-curry.po b/locale/eo/LC_MESSAGES/_tils/2021-04-24-clojure-auto-curry.po new file mode 100644 index 0000000..67ff1b4 --- /dev/null +++ b/locale/eo/LC_MESSAGES/_tils/2021-04-24-clojure-auto-curry.po @@ -0,0 +1,127 @@ +# +msgid "" +msgstr "" + +msgid "title: Clojure auto curry" +msgstr "" + +msgid "date: 2021-04-24" +msgstr "" + +msgid "layout: post" +msgstr "" + +msgid "lang: en" +msgstr "" + +msgid "ref: clojure-auto-curry" +msgstr "" + +msgid "" +"A simple macro defined by [Loretta " +"He](http://lorettahe.github.io/clojure/2016/09/22/clojure-auto-curry) to " +"create Clojure functions that are curried on all arguments, relying on " +"Clojure's multi-arity support:" +msgstr "" + +msgid "" +"(defmacro defcurry\n" +" [fname args & body]\n" +" (let [partials (map (fn [n]\n" +" `(~(subvec args 0 n) (partial ~fname ~@(take n args))))\n" +" (range 1 (count args)))]\n" +" `(defn ~fname\n" +" (~args ~@body)\n" +" ~@partials)))\n" +msgstr "" + +msgid "A naive `add` definition, alongside its usage and macroexpansion:" +msgstr "" + +msgid "" +"user=> (defcurry add\n" +" [a b c d e]\n" +" (+ 1 2 3 4 5))\n" +"#'user/add\n" +"\n" +"user=> (add 1)\n" +"#object[clojure.core$partial$fn__5857 0x2c708440 \"clojure.core$partial$fn__5857@2c708440\"]\n" +"\n" +"user=> (add 1 2 3 4)\n" +"#object[clojure.core$partial$fn__5863 0xf4c0e4e \"clojure.core$partial$fn__5863@f4c0e4e\"]\n" +"\n" +"user=> ((add 1) 2 3 4 5)\n" +"15\n" +"\n" +"user=> (((add 1) 2 3) 4 5)\n" +"15\n" +"\n" +"user=> (use 'clojure.pprint)\n" +"nil\n" +"\n" +"user=> (pprint\n" +" (macroexpand\n" +" '(defcurry add\n" +" [a b c d e]\n" +" (+ 1 2 3 4 5))))\n" +"(def\n" +" add\n" +" (clojure.core/fn\n" +" ([a b c d e] (+ 1 2 3 4 5))\n" +" ([a] (clojure.core/partial add a))\n" +" ([a b] (clojure.core/partial add a b))\n" +" ([a b c] (clojure.core/partial add a b c))\n" +" ([a b c d] (clojure.core/partial add a b c d))))\n" +"nil\n" +msgstr "" + +msgid "" +"This simplistic `defcurry` definition doesn't support optional parameters, " +"multi-arity, `&` rest arguments, docstrings, etc., but it could certainly " +"evolve to do so." +msgstr "" + +msgid "" +"I like how `defcurry` is so short, and abdicates the responsability of doing" +" the multi-arity logic to Clojure's built-in multi-arity support. Simple and" +" elegant." +msgstr "" + +msgid "Same Clojure as before, now with auto-currying via macros." +msgstr "" + +msgid "Comparison with Common Lisp" +msgstr "" + +msgid "My attempt at writing an equivalent for Common Lisp gives me:" +msgstr "" + +msgid "" +"(defun curry-n (n fn)\n" +" (if (= 0 n)\n" +" (funcall fn)\n" +" (lambda (&rest rest)\n" +" (curry-n (something n) fn))))\n" +"\n" +"(defun add (a b c d e)\n" +" (curry-n\n" +" (length '(a b c d e))\n" +" (lambda (&rest rest)\n" +" (apply #'+ rest))))\n" +msgstr "" + +msgid "" +"Without built-in multi-arity support, we have to do more work, like tracking" +" the number of arguments consumed so far. That is, without dependending on " +"any library, sticking to ANSI Common Lisp." +msgstr "" + +msgid "" +"This also require `funcall`s, since we return a `lambda` that doesn't live " +"in the function namespace." +msgstr "" + +msgid "" +"Like the Clojure one, it doesn't support optional parameters, `&rest` rest " +"arguments, docstrings, etc., but it also could evolve to do so." +msgstr "" diff --git a/locale/eo/LC_MESSAGES/_tils/2021-04-24-common-lisp-argument-precedence-order-parameterization-of-a-generic-function.po b/locale/eo/LC_MESSAGES/_tils/2021-04-24-common-lisp-argument-precedence-order-parameterization-of-a-generic-function.po new file mode 100644 index 0000000..b773879 --- /dev/null +++ b/locale/eo/LC_MESSAGES/_tils/2021-04-24-common-lisp-argument-precedence-order-parameterization-of-a-generic-function.po @@ -0,0 +1,185 @@ +# +msgid "" +msgstr "" + +msgid "" +"title: Common Lisp argument precedence order parameterization of a generic " +"function" +msgstr "" + +msgid "date: 2021-04-24" +msgstr "" + +msgid "layout: post" +msgstr "" + +msgid "lang: en" +msgstr "" + +msgid "" +"ref: common-lisp-argument-precedence-order-parameterization-of-a-generic-" +"function" +msgstr "" + +msgid "" +"When CLOS dispatches a method, it picks the most specific method definition " +"to the argument list:" +msgstr "" + +msgid "" +"\n" +"* (defgeneric a-fn (x))\n" +"#<STANDARD-GENERIC-FUNCTION A-FN (0) {5815ACB9}>\n" +"\n" +"* (defmethod a-fn (x) :default-method)\n" +"#<STANDARD-METHOD A-FN (T) {581DB535}>\n" +"\n" +"* (defmethod a-fn ((x number)) :a-number)\n" +"#<STANDARD-METHOD A-FN (NUMBER) {58241645}>\n" +"\n" +"* (defmethod a-fn ((x (eql 1))) :number-1)\n" +"#<STANDARD-METHOD A-FN ((EQL 1)) {582A7D75}>\n" +"\n" +"* (a-fn nil)\n" +":DEFAULT-METHOD\n" +"\n" +"* (a-fn \"1\")\n" +":DEFAULT-METHOD\n" +"\n" +"* (a-fn 0)\n" +":A-NUMBER\n" +"\n" +"* (a-fn 1)\n" +":NUMBER-1\n" +msgstr "" + +msgid "" +"CLOS uses a similar logic when choosing the method from parent classes, when" +" multiple ones are available:" +msgstr "" + +msgid "" +"* (defclass class-a () ())\n" +"\n" +"#<STANDARD-CLASS CLASS-A {583E0B25}>\n" +"* (defclass class-b () ())\n" +"\n" +"#<STANDARD-CLASS CLASS-B {583E7F6D}>\n" +"* (defgeneric another-fn (obj))\n" +"\n" +"#<STANDARD-GENERIC-FUNCTION ANOTHER-FN (0) {583DA749}>\n" +"* (defmethod another-fn ((obj class-a)) :class-a)\n" +"; Compiling LAMBDA (.PV-CELL. .NEXT-METHOD-CALL. OBJ):\n" +"; Compiling Top-Level Form:\n" +"\n" +"#<STANDARD-METHOD ANOTHER-FN (CLASS-A) {584523C5}>\n" +"* (defmethod another-fn ((obj class-b)) :class-b)\n" +"; Compiling LAMBDA (.PV-CELL. .NEXT-METHOD-CALL. OBJ):\n" +"; Compiling Top-Level Form:\n" +"\n" +"#<STANDARD-METHOD ANOTHER-FN (CLASS-B) {584B8895}>\n" +msgstr "" + +msgid "" +"Given the above definitions, when inheriting from `class-a` and `class-b`, " +"the order of inheritance matters:" +msgstr "" + +msgid "" +"* (defclass class-a-coming-first (class-a class-b) ())\n" +"#<STANDARD-CLASS CLASS-A-COMING-FIRST {584BE6AD}>\n" +"\n" +"* (defclass class-b-coming-first (class-b class-a) ())\n" +"#<STANDARD-CLASS CLASS-B-COMING-FIRST {584C744D}>\n" +"\n" +"* (another-fn (make-instance 'class-a-coming-first))\n" +":CLASS-A\n" +"\n" +"* (another-fn (make-instance 'class-b-coming-first))\n" +":CLASS-B\n" +msgstr "" + +msgid "" +"Combining the order of inheritance with generic functions with multiple " +"arguments, CLOS has to make a choice of how to pick a method given two " +"competing definitions, and its default strategy is prioritizing from left to" +" right:" +msgstr "" + +msgid "" +"* (defgeneric yet-another-fn (obj1 obj2))\n" +"#<STANDARD-GENERIC-FUNCTION YET-ANOTHER-FN (0) {584D9EC9}>\n" +"\n" +"* (defmethod yet-another-fn ((obj1 class-a) obj2) :first-arg-specialized)\n" +"#<STANDARD-METHOD YET-ANOTHER-FN (CLASS-A T) {5854269D}>\n" +"\n" +"* (defmethod yet-another-fn (obj1 (obj2 class-b)) :second-arg-specialized)\n" +"#<STANDARD-METHOD YET-ANOTHER-FN (T CLASS-B) {585AAAAD}>\n" +"\n" +"* (yet-another-fn (make-instance 'class-a) (make-instance 'class-b))\n" +":FIRST-ARG-SPECIALIZED\n" +msgstr "" + +msgid "" +"CLOS has to make a choice between the first and the second definition of " +"`yet-another-fn`, but its choice is just a heuristic. What if we want to the" +" choice to be based on the second argument first?" +msgstr "" + +msgid "" +"For that, we use the `:argument-precedence-order` option when declaring a " +"generic function:" +msgstr "" + +msgid "" +"* (defgeneric yet-another-fn (obj1 obj2) (:argument-precedence-order obj2 obj1))\n" +"#<STANDARD-GENERIC-FUNCTION YET-ANOTHER-FN (2) {584D9EC9}>\n" +"\n" +"* (yet-another-fn (make-instance 'class-a) (make-instance 'class-b))\n" +":SECOND-ARG-SPECIALIZED\n" +msgstr "" + +msgid "" +"I liked that the `:argument-precedence-order` option exists. We shouldn't " +"have to change the arguments from `(obj1 obj2)` to `(obj2 obj1)` just to " +"make CLOS pick the method that we want. We can configure its default " +"behaviour if desired, and keep the order of arguments however it best fits " +"the generic function." +msgstr "" + +msgid "Comparison with Clojure" +msgstr "" + +msgid "Clojure has an equivalent, when using `defmulti`." +msgstr "" + +msgid "" +"Since when declaring a multi-method with `defmulti` we must define the " +"dispatch function, Clojure uses it to pick the method definition. Since the " +"dispatch function is required, there is no need for a default behaviour, " +"such as left-to-right." +msgstr "" + +msgid "Conclusion" +msgstr "" + +msgid "" +"Making the argument precedence order configurable for generic functions but " +"not for class definitions makes a lot of sense." +msgstr "" + +msgid "" +"When declaring a class, we can choose the precedence order, and that is " +"about it. But when defining a generic function, the order of argumentws is " +"more important to the function semantics, and the argument precedence being " +"left-to-right is just the default behaviour." +msgstr "" + +msgid "" +"One shouldn't change the order of arguments of a generic function for the " +"sake of tailoring it to the CLOS priority ranking algorithm, but doing it " +"for a class definition is just fine." +msgstr "" + +msgid "TIL." +msgstr "" diff --git a/locale/fr/LC_MESSAGES/_articles/2020-10-05-swift2nix-run-swift-inside-nix-builds.po b/locale/fr/LC_MESSAGES/_articles/2020-10-05-swift2nix-run-swift-inside-nix-builds.po index 86c8389..3c7e6ec 100644 --- a/locale/fr/LC_MESSAGES/_articles/2020-10-05-swift2nix-run-swift-inside-nix-builds.po +++ b/locale/fr/LC_MESSAGES/_articles/2020-10-05-swift2nix-run-swift-inside-nix-builds.po @@ -12,8 +12,8 @@ msgstr "" msgid "" "I wrote a simple little tool called " -"[swift2nix](https://git.euandreh.xyz/swift2nix/) that allows you trick" -" Swift's package manager into assuming everything is set up. Here's the " +"[swift2nix](https://git.euandreh.xyz/swift2nix/) that allows you trick " +"Swift's package manager into assuming everything is set up. Here's the " "example from swift2nix's README file:" msgstr "" diff --git a/locale/fr/LC_MESSAGES/_articles/2020-11-12-durable-persistent-trees-and-parser-combinators-building-a-database.po b/locale/fr/LC_MESSAGES/_articles/2020-11-12-durable-persistent-trees-and-parser-combinators-building-a-database.po index 0e0bc8c..ecd28a5 100644 --- a/locale/fr/LC_MESSAGES/_articles/2020-11-12-durable-persistent-trees-and-parser-combinators-building-a-database.po +++ b/locale/fr/LC_MESSAGES/_articles/2020-11-12-durable-persistent-trees-and-parser-combinators-building-a-database.po @@ -381,18 +381,18 @@ msgstr "" #~ msgid "" #~ "I've started a fork of cbindgen: " -#~ "[x-bindgen](https://git.euandreh.xyz/x-bindgen/). Right now it is just " -#~ "a copy of cbindgen verbatim, and I plan to remove all C and C++ emitting " -#~ "code from it, and add a IR emitting code instead." +#~ "[x-bindgen](https://git.euandreh.xyz/x-bindgen/). Right now it is just a " +#~ "copy of cbindgen verbatim, and I plan to remove all C and C++ emitting code " +#~ "from it, and add a IR emitting code instead." #~ msgstr "" #~ msgid "" #~ "When starting working on x-bindgen, I realized I didn't know what to look " #~ "for in a header file, as I haven't written any C code in many years. So as I" -#~ " was writing [libedn](https://git.euandreh.xyz/libedn/), I didn't know " -#~ "how to build a good C API to expose. So I tried porting the code to C, and " -#~ "right now I'm working on building a *good* C API for a JSON parser using " -#~ "parser combinators: [ParsecC](https://git.euandreh.xyz/parsecc/)." +#~ " was writing [libedn](https://git.euandreh.xyz/libedn/), I didn't know how " +#~ "to build a good C API to expose. So I tried porting the code to C, and right" +#~ " now I'm working on building a *good* C API for a JSON parser using parser " +#~ "combinators: [ParsecC](https://git.euandreh.xyz/parsecc/)." #~ msgstr "" #~ msgid "" diff --git a/locale/fr/LC_MESSAGES/_articles/2021-01-26-ann-remembering-add-memory-to-dmenu-fzf-and-similar-tools.po b/locale/fr/LC_MESSAGES/_articles/2021-01-26-ann-remembering-add-memory-to-dmenu-fzf-and-similar-tools.po index a7e3382..c85754b 100644 --- a/locale/fr/LC_MESSAGES/_articles/2021-01-26-ann-remembering-add-memory-to-dmenu-fzf-and-similar-tools.po +++ b/locale/fr/LC_MESSAGES/_articles/2021-01-26-ann-remembering-add-memory-to-dmenu-fzf-and-similar-tools.po @@ -269,9 +269,9 @@ msgstr "" msgid "" "For my personal use, I've [packaged](https://git.euandreh.xyz/package-" -"repository/) `remembering` for GNU Guix and Nix. Packaging it to any " -"other distribution should be trivial, or just downloading the tarball and " -"running `[sudo] make install`." +"repository/) `remembering` for GNU Guix and Nix. Packaging it to any other " +"distribution should be trivial, or just downloading the tarball and running " +"`[sudo] make install`." msgstr "" #~ msgid "" @@ -288,8 +288,8 @@ msgstr "" #~ msgid "" #~ "Today I pushed v0.1.0 of " -#~ "[remembering](https://git.euandreh.xyz/remembering/), a tool to " -#~ "enhance the interactive usability of menu-like tools, such as " +#~ "[remembering](https://git.euandreh.xyz/remembering/), a tool to enhance the " +#~ "interactive usability of menu-like tools, such as " #~ "[dmenu](https://tools.suckless.org/dmenu/) and " #~ "[fzf](https://github.com/junegunn/fzf)." #~ msgstr "" diff --git a/locale/fr/LC_MESSAGES/_pastebins/2021-04-03-javascript-naive-slugify.po b/locale/fr/LC_MESSAGES/_pastebins/2021-04-03-javascript-naive-slugify.po new file mode 100644 index 0000000..6f638f2 --- /dev/null +++ b/locale/fr/LC_MESSAGES/_pastebins/2021-04-03-javascript-naive-slugify.po @@ -0,0 +1,44 @@ +# +msgid "" +msgstr "" + +msgid "title: JavaScript naive slugify" +msgstr "" + +msgid "date: 2021-04-03" +msgstr "" + +msgid "layout: post" +msgstr "" + +msgid "lang: en" +msgstr "" + +msgid "ref: javascript-naive-slugify" +msgstr "" + +msgid "" +"const s = \"Pézão: açaí, saci-pererê.\";\n" +"\n" +"function slugify(s) {\n" +" return s\n" +" .toLowerCase()\n" +" .replaceAll(\":\", \"\")\n" +" .replaceAll(\".\", \"\")\n" +" .replaceAll(\",\", \"\")\n" +" .replaceAll(\"-\", \"\")\n" +" .replaceAll(\"á\", \"a\")\n" +" .replaceAll(\"ã\", \"a\")\n" +" .replaceAll(\"à\", \"a\")\n" +" .replaceAll(\"é\", \"e\")\n" +" .replaceAll(\"ê\", \"e\")\n" +" .replaceAll(\"í\", \"i\")\n" +" .replaceAll(\"ó\", \"o\")\n" +" .replaceAll(\"ô\", \"o\")\n" +" .replaceAll(\"ú\", \"u\")\n" +" .replaceAll(\"ü\", \"u\")\n" +" .replaceAll(\"ç\", \"c\");\n" +"}\n" +"\n" +"console.log(slugify(s));\n" +msgstr "" diff --git a/locale/fr/LC_MESSAGES/_screencasts/2021-02-07-autoqemu-automate-installation-and-ssh-setup-of-iso-os-images.po b/locale/fr/LC_MESSAGES/_screencasts/2021-02-07-autoqemu-automate-installation-and-ssh-setup-of-iso-os-images.po index badc41e..d0e9b44 100644 --- a/locale/fr/LC_MESSAGES/_screencasts/2021-02-07-autoqemu-automate-installation-and-ssh-setup-of-iso-os-images.po +++ b/locale/fr/LC_MESSAGES/_screencasts/2021-02-07-autoqemu-automate-installation-and-ssh-setup-of-iso-os-images.po @@ -57,14 +57,6 @@ msgid "It assumes that `$HOME/.local/bin` is in `$PATH`." msgstr "" msgid "" -"This screencast is a simple demo of automating the installation of Alpine " -"Linux 3.12.3 standard x86_64 with " -"[AutoQEMU](https://git.euandreh.xyz/autoqemu/), which is nothing more " -"than POSIX sh, [expect](https://core.tcl-lang.org/expect/index) scripts and " -"Makefiles glued together." -msgstr "" - -msgid "" "pushd `mktemp -d`\n" "git clone https://git.euandreh.xyz/autoqemu .\n" "make\n" @@ -72,6 +64,22 @@ msgid "" "autoqemu ssh alpine\n" msgstr "" +msgid "" +"This screencast is a simple demo of automating the installation of Alpine " +"Linux 3.12.3 standard x86_64 with " +"[AutoQEMU](https://git.euandreh.xyz/autoqemu/about), which is nothing more " +"than POSIX sh, [expect](https://core.tcl-lang.org/expect/index) scripts and " +"Makefiles glued together." +msgstr "" + +#~ msgid "" +#~ "This screencast is a simple demo of automating the installation of Alpine " +#~ "Linux 3.12.3 standard x86_64 with " +#~ "[AutoQEMU](https://git.euandreh.xyz/autoqemu/), which is nothing more than " +#~ "POSIX sh, [expect](https://core.tcl-lang.org/expect/index) scripts and " +#~ "Makefiles glued together." +#~ msgstr "" + #~ msgid "" #~ "pushd `mktemp -d`\n" #~ "git clone https://git.euandreh.xyz/autoqemu .\n" diff --git a/locale/fr/LC_MESSAGES/_tils/2020-09-05-pull-requests-with-git-the-old-school-way.po b/locale/fr/LC_MESSAGES/_tils/2020-09-05-pull-requests-with-git-the-old-school-way.po index 182061b..1610cea 100644 --- a/locale/fr/LC_MESSAGES/_tils/2020-09-05-pull-requests-with-git-the-old-school-way.po +++ b/locale/fr/LC_MESSAGES/_tils/2020-09-05-pull-requests-with-git-the-old-school-way.po @@ -25,9 +25,9 @@ msgid "" "The only difference is that you're working with only Git itself, so you're " "not tied to any Git hosting provider: you can send pull requests across them" " transparently! You could even use your own " -"[cgit](https://git.zx2c4.com/cgit/) installation. No need to be locked" -" in by any of them, putting the \"D\" back in \"DVCS\": it's a " -"**distributed** version control system." +"[cgit](https://git.zx2c4.com/cgit/) installation. No need to be locked in by" +" any of them, putting the \"D\" back in \"DVCS\": it's a **distributed** " +"version control system." msgstr "" msgid "`git request-pull` introduction" diff --git a/locale/fr/LC_MESSAGES/_tils/2021-04-24-clojure-auto-curry.po b/locale/fr/LC_MESSAGES/_tils/2021-04-24-clojure-auto-curry.po new file mode 100644 index 0000000..67ff1b4 --- /dev/null +++ b/locale/fr/LC_MESSAGES/_tils/2021-04-24-clojure-auto-curry.po @@ -0,0 +1,127 @@ +# +msgid "" +msgstr "" + +msgid "title: Clojure auto curry" +msgstr "" + +msgid "date: 2021-04-24" +msgstr "" + +msgid "layout: post" +msgstr "" + +msgid "lang: en" +msgstr "" + +msgid "ref: clojure-auto-curry" +msgstr "" + +msgid "" +"A simple macro defined by [Loretta " +"He](http://lorettahe.github.io/clojure/2016/09/22/clojure-auto-curry) to " +"create Clojure functions that are curried on all arguments, relying on " +"Clojure's multi-arity support:" +msgstr "" + +msgid "" +"(defmacro defcurry\n" +" [fname args & body]\n" +" (let [partials (map (fn [n]\n" +" `(~(subvec args 0 n) (partial ~fname ~@(take n args))))\n" +" (range 1 (count args)))]\n" +" `(defn ~fname\n" +" (~args ~@body)\n" +" ~@partials)))\n" +msgstr "" + +msgid "A naive `add` definition, alongside its usage and macroexpansion:" +msgstr "" + +msgid "" +"user=> (defcurry add\n" +" [a b c d e]\n" +" (+ 1 2 3 4 5))\n" +"#'user/add\n" +"\n" +"user=> (add 1)\n" +"#object[clojure.core$partial$fn__5857 0x2c708440 \"clojure.core$partial$fn__5857@2c708440\"]\n" +"\n" +"user=> (add 1 2 3 4)\n" +"#object[clojure.core$partial$fn__5863 0xf4c0e4e \"clojure.core$partial$fn__5863@f4c0e4e\"]\n" +"\n" +"user=> ((add 1) 2 3 4 5)\n" +"15\n" +"\n" +"user=> (((add 1) 2 3) 4 5)\n" +"15\n" +"\n" +"user=> (use 'clojure.pprint)\n" +"nil\n" +"\n" +"user=> (pprint\n" +" (macroexpand\n" +" '(defcurry add\n" +" [a b c d e]\n" +" (+ 1 2 3 4 5))))\n" +"(def\n" +" add\n" +" (clojure.core/fn\n" +" ([a b c d e] (+ 1 2 3 4 5))\n" +" ([a] (clojure.core/partial add a))\n" +" ([a b] (clojure.core/partial add a b))\n" +" ([a b c] (clojure.core/partial add a b c))\n" +" ([a b c d] (clojure.core/partial add a b c d))))\n" +"nil\n" +msgstr "" + +msgid "" +"This simplistic `defcurry` definition doesn't support optional parameters, " +"multi-arity, `&` rest arguments, docstrings, etc., but it could certainly " +"evolve to do so." +msgstr "" + +msgid "" +"I like how `defcurry` is so short, and abdicates the responsability of doing" +" the multi-arity logic to Clojure's built-in multi-arity support. Simple and" +" elegant." +msgstr "" + +msgid "Same Clojure as before, now with auto-currying via macros." +msgstr "" + +msgid "Comparison with Common Lisp" +msgstr "" + +msgid "My attempt at writing an equivalent for Common Lisp gives me:" +msgstr "" + +msgid "" +"(defun curry-n (n fn)\n" +" (if (= 0 n)\n" +" (funcall fn)\n" +" (lambda (&rest rest)\n" +" (curry-n (something n) fn))))\n" +"\n" +"(defun add (a b c d e)\n" +" (curry-n\n" +" (length '(a b c d e))\n" +" (lambda (&rest rest)\n" +" (apply #'+ rest))))\n" +msgstr "" + +msgid "" +"Without built-in multi-arity support, we have to do more work, like tracking" +" the number of arguments consumed so far. That is, without dependending on " +"any library, sticking to ANSI Common Lisp." +msgstr "" + +msgid "" +"This also require `funcall`s, since we return a `lambda` that doesn't live " +"in the function namespace." +msgstr "" + +msgid "" +"Like the Clojure one, it doesn't support optional parameters, `&rest` rest " +"arguments, docstrings, etc., but it also could evolve to do so." +msgstr "" diff --git a/locale/fr/LC_MESSAGES/_tils/2021-04-24-common-lisp-argument-precedence-order-parameterization-of-a-generic-function.po b/locale/fr/LC_MESSAGES/_tils/2021-04-24-common-lisp-argument-precedence-order-parameterization-of-a-generic-function.po new file mode 100644 index 0000000..b773879 --- /dev/null +++ b/locale/fr/LC_MESSAGES/_tils/2021-04-24-common-lisp-argument-precedence-order-parameterization-of-a-generic-function.po @@ -0,0 +1,185 @@ +# +msgid "" +msgstr "" + +msgid "" +"title: Common Lisp argument precedence order parameterization of a generic " +"function" +msgstr "" + +msgid "date: 2021-04-24" +msgstr "" + +msgid "layout: post" +msgstr "" + +msgid "lang: en" +msgstr "" + +msgid "" +"ref: common-lisp-argument-precedence-order-parameterization-of-a-generic-" +"function" +msgstr "" + +msgid "" +"When CLOS dispatches a method, it picks the most specific method definition " +"to the argument list:" +msgstr "" + +msgid "" +"\n" +"* (defgeneric a-fn (x))\n" +"#<STANDARD-GENERIC-FUNCTION A-FN (0) {5815ACB9}>\n" +"\n" +"* (defmethod a-fn (x) :default-method)\n" +"#<STANDARD-METHOD A-FN (T) {581DB535}>\n" +"\n" +"* (defmethod a-fn ((x number)) :a-number)\n" +"#<STANDARD-METHOD A-FN (NUMBER) {58241645}>\n" +"\n" +"* (defmethod a-fn ((x (eql 1))) :number-1)\n" +"#<STANDARD-METHOD A-FN ((EQL 1)) {582A7D75}>\n" +"\n" +"* (a-fn nil)\n" +":DEFAULT-METHOD\n" +"\n" +"* (a-fn \"1\")\n" +":DEFAULT-METHOD\n" +"\n" +"* (a-fn 0)\n" +":A-NUMBER\n" +"\n" +"* (a-fn 1)\n" +":NUMBER-1\n" +msgstr "" + +msgid "" +"CLOS uses a similar logic when choosing the method from parent classes, when" +" multiple ones are available:" +msgstr "" + +msgid "" +"* (defclass class-a () ())\n" +"\n" +"#<STANDARD-CLASS CLASS-A {583E0B25}>\n" +"* (defclass class-b () ())\n" +"\n" +"#<STANDARD-CLASS CLASS-B {583E7F6D}>\n" +"* (defgeneric another-fn (obj))\n" +"\n" +"#<STANDARD-GENERIC-FUNCTION ANOTHER-FN (0) {583DA749}>\n" +"* (defmethod another-fn ((obj class-a)) :class-a)\n" +"; Compiling LAMBDA (.PV-CELL. .NEXT-METHOD-CALL. OBJ):\n" +"; Compiling Top-Level Form:\n" +"\n" +"#<STANDARD-METHOD ANOTHER-FN (CLASS-A) {584523C5}>\n" +"* (defmethod another-fn ((obj class-b)) :class-b)\n" +"; Compiling LAMBDA (.PV-CELL. .NEXT-METHOD-CALL. OBJ):\n" +"; Compiling Top-Level Form:\n" +"\n" +"#<STANDARD-METHOD ANOTHER-FN (CLASS-B) {584B8895}>\n" +msgstr "" + +msgid "" +"Given the above definitions, when inheriting from `class-a` and `class-b`, " +"the order of inheritance matters:" +msgstr "" + +msgid "" +"* (defclass class-a-coming-first (class-a class-b) ())\n" +"#<STANDARD-CLASS CLASS-A-COMING-FIRST {584BE6AD}>\n" +"\n" +"* (defclass class-b-coming-first (class-b class-a) ())\n" +"#<STANDARD-CLASS CLASS-B-COMING-FIRST {584C744D}>\n" +"\n" +"* (another-fn (make-instance 'class-a-coming-first))\n" +":CLASS-A\n" +"\n" +"* (another-fn (make-instance 'class-b-coming-first))\n" +":CLASS-B\n" +msgstr "" + +msgid "" +"Combining the order of inheritance with generic functions with multiple " +"arguments, CLOS has to make a choice of how to pick a method given two " +"competing definitions, and its default strategy is prioritizing from left to" +" right:" +msgstr "" + +msgid "" +"* (defgeneric yet-another-fn (obj1 obj2))\n" +"#<STANDARD-GENERIC-FUNCTION YET-ANOTHER-FN (0) {584D9EC9}>\n" +"\n" +"* (defmethod yet-another-fn ((obj1 class-a) obj2) :first-arg-specialized)\n" +"#<STANDARD-METHOD YET-ANOTHER-FN (CLASS-A T) {5854269D}>\n" +"\n" +"* (defmethod yet-another-fn (obj1 (obj2 class-b)) :second-arg-specialized)\n" +"#<STANDARD-METHOD YET-ANOTHER-FN (T CLASS-B) {585AAAAD}>\n" +"\n" +"* (yet-another-fn (make-instance 'class-a) (make-instance 'class-b))\n" +":FIRST-ARG-SPECIALIZED\n" +msgstr "" + +msgid "" +"CLOS has to make a choice between the first and the second definition of " +"`yet-another-fn`, but its choice is just a heuristic. What if we want to the" +" choice to be based on the second argument first?" +msgstr "" + +msgid "" +"For that, we use the `:argument-precedence-order` option when declaring a " +"generic function:" +msgstr "" + +msgid "" +"* (defgeneric yet-another-fn (obj1 obj2) (:argument-precedence-order obj2 obj1))\n" +"#<STANDARD-GENERIC-FUNCTION YET-ANOTHER-FN (2) {584D9EC9}>\n" +"\n" +"* (yet-another-fn (make-instance 'class-a) (make-instance 'class-b))\n" +":SECOND-ARG-SPECIALIZED\n" +msgstr "" + +msgid "" +"I liked that the `:argument-precedence-order` option exists. We shouldn't " +"have to change the arguments from `(obj1 obj2)` to `(obj2 obj1)` just to " +"make CLOS pick the method that we want. We can configure its default " +"behaviour if desired, and keep the order of arguments however it best fits " +"the generic function." +msgstr "" + +msgid "Comparison with Clojure" +msgstr "" + +msgid "Clojure has an equivalent, when using `defmulti`." +msgstr "" + +msgid "" +"Since when declaring a multi-method with `defmulti` we must define the " +"dispatch function, Clojure uses it to pick the method definition. Since the " +"dispatch function is required, there is no need for a default behaviour, " +"such as left-to-right." +msgstr "" + +msgid "Conclusion" +msgstr "" + +msgid "" +"Making the argument precedence order configurable for generic functions but " +"not for class definitions makes a lot of sense." +msgstr "" + +msgid "" +"When declaring a class, we can choose the precedence order, and that is " +"about it. But when defining a generic function, the order of argumentws is " +"more important to the function semantics, and the argument precedence being " +"left-to-right is just the default behaviour." +msgstr "" + +msgid "" +"One shouldn't change the order of arguments of a generic function for the " +"sake of tailoring it to the CLOS priority ranking algorithm, but doing it " +"for a class definition is just fine." +msgstr "" + +msgid "TIL." +msgstr "" diff --git a/locale/pt/LC_MESSAGES/_articles/2020-10-05-swift2nix-run-swift-inside-nix-builds.po b/locale/pt/LC_MESSAGES/_articles/2020-10-05-swift2nix-run-swift-inside-nix-builds.po index 86c8389..3c7e6ec 100644 --- a/locale/pt/LC_MESSAGES/_articles/2020-10-05-swift2nix-run-swift-inside-nix-builds.po +++ b/locale/pt/LC_MESSAGES/_articles/2020-10-05-swift2nix-run-swift-inside-nix-builds.po @@ -12,8 +12,8 @@ msgstr "" msgid "" "I wrote a simple little tool called " -"[swift2nix](https://git.euandreh.xyz/swift2nix/) that allows you trick" -" Swift's package manager into assuming everything is set up. Here's the " +"[swift2nix](https://git.euandreh.xyz/swift2nix/) that allows you trick " +"Swift's package manager into assuming everything is set up. Here's the " "example from swift2nix's README file:" msgstr "" diff --git a/locale/pt/LC_MESSAGES/_articles/2020-11-12-durable-persistent-trees-and-parser-combinators-building-a-database.po b/locale/pt/LC_MESSAGES/_articles/2020-11-12-durable-persistent-trees-and-parser-combinators-building-a-database.po index 0e0bc8c..ecd28a5 100644 --- a/locale/pt/LC_MESSAGES/_articles/2020-11-12-durable-persistent-trees-and-parser-combinators-building-a-database.po +++ b/locale/pt/LC_MESSAGES/_articles/2020-11-12-durable-persistent-trees-and-parser-combinators-building-a-database.po @@ -381,18 +381,18 @@ msgstr "" #~ msgid "" #~ "I've started a fork of cbindgen: " -#~ "[x-bindgen](https://git.euandreh.xyz/x-bindgen/). Right now it is just " -#~ "a copy of cbindgen verbatim, and I plan to remove all C and C++ emitting " -#~ "code from it, and add a IR emitting code instead." +#~ "[x-bindgen](https://git.euandreh.xyz/x-bindgen/). Right now it is just a " +#~ "copy of cbindgen verbatim, and I plan to remove all C and C++ emitting code " +#~ "from it, and add a IR emitting code instead." #~ msgstr "" #~ msgid "" #~ "When starting working on x-bindgen, I realized I didn't know what to look " #~ "for in a header file, as I haven't written any C code in many years. So as I" -#~ " was writing [libedn](https://git.euandreh.xyz/libedn/), I didn't know " -#~ "how to build a good C API to expose. So I tried porting the code to C, and " -#~ "right now I'm working on building a *good* C API for a JSON parser using " -#~ "parser combinators: [ParsecC](https://git.euandreh.xyz/parsecc/)." +#~ " was writing [libedn](https://git.euandreh.xyz/libedn/), I didn't know how " +#~ "to build a good C API to expose. So I tried porting the code to C, and right" +#~ " now I'm working on building a *good* C API for a JSON parser using parser " +#~ "combinators: [ParsecC](https://git.euandreh.xyz/parsecc/)." #~ msgstr "" #~ msgid "" diff --git a/locale/pt/LC_MESSAGES/_articles/2021-01-26-ann-remembering-add-memory-to-dmenu-fzf-and-similar-tools.po b/locale/pt/LC_MESSAGES/_articles/2021-01-26-ann-remembering-add-memory-to-dmenu-fzf-and-similar-tools.po index a7e3382..c85754b 100644 --- a/locale/pt/LC_MESSAGES/_articles/2021-01-26-ann-remembering-add-memory-to-dmenu-fzf-and-similar-tools.po +++ b/locale/pt/LC_MESSAGES/_articles/2021-01-26-ann-remembering-add-memory-to-dmenu-fzf-and-similar-tools.po @@ -269,9 +269,9 @@ msgstr "" msgid "" "For my personal use, I've [packaged](https://git.euandreh.xyz/package-" -"repository/) `remembering` for GNU Guix and Nix. Packaging it to any " -"other distribution should be trivial, or just downloading the tarball and " -"running `[sudo] make install`." +"repository/) `remembering` for GNU Guix and Nix. Packaging it to any other " +"distribution should be trivial, or just downloading the tarball and running " +"`[sudo] make install`." msgstr "" #~ msgid "" @@ -288,8 +288,8 @@ msgstr "" #~ msgid "" #~ "Today I pushed v0.1.0 of " -#~ "[remembering](https://git.euandreh.xyz/remembering/), a tool to " -#~ "enhance the interactive usability of menu-like tools, such as " +#~ "[remembering](https://git.euandreh.xyz/remembering/), a tool to enhance the " +#~ "interactive usability of menu-like tools, such as " #~ "[dmenu](https://tools.suckless.org/dmenu/) and " #~ "[fzf](https://github.com/junegunn/fzf)." #~ msgstr "" diff --git a/locale/pt/LC_MESSAGES/_pastebins/2021-04-03-javascript-naive-slugify.po b/locale/pt/LC_MESSAGES/_pastebins/2021-04-03-javascript-naive-slugify.po new file mode 100644 index 0000000..6f638f2 --- /dev/null +++ b/locale/pt/LC_MESSAGES/_pastebins/2021-04-03-javascript-naive-slugify.po @@ -0,0 +1,44 @@ +# +msgid "" +msgstr "" + +msgid "title: JavaScript naive slugify" +msgstr "" + +msgid "date: 2021-04-03" +msgstr "" + +msgid "layout: post" +msgstr "" + +msgid "lang: en" +msgstr "" + +msgid "ref: javascript-naive-slugify" +msgstr "" + +msgid "" +"const s = \"Pézão: açaí, saci-pererê.\";\n" +"\n" +"function slugify(s) {\n" +" return s\n" +" .toLowerCase()\n" +" .replaceAll(\":\", \"\")\n" +" .replaceAll(\".\", \"\")\n" +" .replaceAll(\",\", \"\")\n" +" .replaceAll(\"-\", \"\")\n" +" .replaceAll(\"á\", \"a\")\n" +" .replaceAll(\"ã\", \"a\")\n" +" .replaceAll(\"à\", \"a\")\n" +" .replaceAll(\"é\", \"e\")\n" +" .replaceAll(\"ê\", \"e\")\n" +" .replaceAll(\"í\", \"i\")\n" +" .replaceAll(\"ó\", \"o\")\n" +" .replaceAll(\"ô\", \"o\")\n" +" .replaceAll(\"ú\", \"u\")\n" +" .replaceAll(\"ü\", \"u\")\n" +" .replaceAll(\"ç\", \"c\");\n" +"}\n" +"\n" +"console.log(slugify(s));\n" +msgstr "" diff --git a/locale/pt/LC_MESSAGES/_screencasts/2021-02-07-autoqemu-automate-installation-and-ssh-setup-of-iso-os-images.po b/locale/pt/LC_MESSAGES/_screencasts/2021-02-07-autoqemu-automate-installation-and-ssh-setup-of-iso-os-images.po index badc41e..d0e9b44 100644 --- a/locale/pt/LC_MESSAGES/_screencasts/2021-02-07-autoqemu-automate-installation-and-ssh-setup-of-iso-os-images.po +++ b/locale/pt/LC_MESSAGES/_screencasts/2021-02-07-autoqemu-automate-installation-and-ssh-setup-of-iso-os-images.po @@ -57,14 +57,6 @@ msgid "It assumes that `$HOME/.local/bin` is in `$PATH`." msgstr "" msgid "" -"This screencast is a simple demo of automating the installation of Alpine " -"Linux 3.12.3 standard x86_64 with " -"[AutoQEMU](https://git.euandreh.xyz/autoqemu/), which is nothing more " -"than POSIX sh, [expect](https://core.tcl-lang.org/expect/index) scripts and " -"Makefiles glued together." -msgstr "" - -msgid "" "pushd `mktemp -d`\n" "git clone https://git.euandreh.xyz/autoqemu .\n" "make\n" @@ -72,6 +64,22 @@ msgid "" "autoqemu ssh alpine\n" msgstr "" +msgid "" +"This screencast is a simple demo of automating the installation of Alpine " +"Linux 3.12.3 standard x86_64 with " +"[AutoQEMU](https://git.euandreh.xyz/autoqemu/about), which is nothing more " +"than POSIX sh, [expect](https://core.tcl-lang.org/expect/index) scripts and " +"Makefiles glued together." +msgstr "" + +#~ msgid "" +#~ "This screencast is a simple demo of automating the installation of Alpine " +#~ "Linux 3.12.3 standard x86_64 with " +#~ "[AutoQEMU](https://git.euandreh.xyz/autoqemu/), which is nothing more than " +#~ "POSIX sh, [expect](https://core.tcl-lang.org/expect/index) scripts and " +#~ "Makefiles glued together." +#~ msgstr "" + #~ msgid "" #~ "pushd `mktemp -d`\n" #~ "git clone https://git.euandreh.xyz/autoqemu .\n" diff --git a/locale/pt/LC_MESSAGES/_tils/2020-09-05-pull-requests-with-git-the-old-school-way.po b/locale/pt/LC_MESSAGES/_tils/2020-09-05-pull-requests-with-git-the-old-school-way.po index 182061b..1610cea 100644 --- a/locale/pt/LC_MESSAGES/_tils/2020-09-05-pull-requests-with-git-the-old-school-way.po +++ b/locale/pt/LC_MESSAGES/_tils/2020-09-05-pull-requests-with-git-the-old-school-way.po @@ -25,9 +25,9 @@ msgid "" "The only difference is that you're working with only Git itself, so you're " "not tied to any Git hosting provider: you can send pull requests across them" " transparently! You could even use your own " -"[cgit](https://git.zx2c4.com/cgit/) installation. No need to be locked" -" in by any of them, putting the \"D\" back in \"DVCS\": it's a " -"**distributed** version control system." +"[cgit](https://git.zx2c4.com/cgit/) installation. No need to be locked in by" +" any of them, putting the \"D\" back in \"DVCS\": it's a **distributed** " +"version control system." msgstr "" msgid "`git request-pull` introduction" diff --git a/locale/pt/LC_MESSAGES/_tils/2021-04-24-clojure-auto-curry.po b/locale/pt/LC_MESSAGES/_tils/2021-04-24-clojure-auto-curry.po new file mode 100644 index 0000000..67ff1b4 --- /dev/null +++ b/locale/pt/LC_MESSAGES/_tils/2021-04-24-clojure-auto-curry.po @@ -0,0 +1,127 @@ +# +msgid "" +msgstr "" + +msgid "title: Clojure auto curry" +msgstr "" + +msgid "date: 2021-04-24" +msgstr "" + +msgid "layout: post" +msgstr "" + +msgid "lang: en" +msgstr "" + +msgid "ref: clojure-auto-curry" +msgstr "" + +msgid "" +"A simple macro defined by [Loretta " +"He](http://lorettahe.github.io/clojure/2016/09/22/clojure-auto-curry) to " +"create Clojure functions that are curried on all arguments, relying on " +"Clojure's multi-arity support:" +msgstr "" + +msgid "" +"(defmacro defcurry\n" +" [fname args & body]\n" +" (let [partials (map (fn [n]\n" +" `(~(subvec args 0 n) (partial ~fname ~@(take n args))))\n" +" (range 1 (count args)))]\n" +" `(defn ~fname\n" +" (~args ~@body)\n" +" ~@partials)))\n" +msgstr "" + +msgid "A naive `add` definition, alongside its usage and macroexpansion:" +msgstr "" + +msgid "" +"user=> (defcurry add\n" +" [a b c d e]\n" +" (+ 1 2 3 4 5))\n" +"#'user/add\n" +"\n" +"user=> (add 1)\n" +"#object[clojure.core$partial$fn__5857 0x2c708440 \"clojure.core$partial$fn__5857@2c708440\"]\n" +"\n" +"user=> (add 1 2 3 4)\n" +"#object[clojure.core$partial$fn__5863 0xf4c0e4e \"clojure.core$partial$fn__5863@f4c0e4e\"]\n" +"\n" +"user=> ((add 1) 2 3 4 5)\n" +"15\n" +"\n" +"user=> (((add 1) 2 3) 4 5)\n" +"15\n" +"\n" +"user=> (use 'clojure.pprint)\n" +"nil\n" +"\n" +"user=> (pprint\n" +" (macroexpand\n" +" '(defcurry add\n" +" [a b c d e]\n" +" (+ 1 2 3 4 5))))\n" +"(def\n" +" add\n" +" (clojure.core/fn\n" +" ([a b c d e] (+ 1 2 3 4 5))\n" +" ([a] (clojure.core/partial add a))\n" +" ([a b] (clojure.core/partial add a b))\n" +" ([a b c] (clojure.core/partial add a b c))\n" +" ([a b c d] (clojure.core/partial add a b c d))))\n" +"nil\n" +msgstr "" + +msgid "" +"This simplistic `defcurry` definition doesn't support optional parameters, " +"multi-arity, `&` rest arguments, docstrings, etc., but it could certainly " +"evolve to do so." +msgstr "" + +msgid "" +"I like how `defcurry` is so short, and abdicates the responsability of doing" +" the multi-arity logic to Clojure's built-in multi-arity support. Simple and" +" elegant." +msgstr "" + +msgid "Same Clojure as before, now with auto-currying via macros." +msgstr "" + +msgid "Comparison with Common Lisp" +msgstr "" + +msgid "My attempt at writing an equivalent for Common Lisp gives me:" +msgstr "" + +msgid "" +"(defun curry-n (n fn)\n" +" (if (= 0 n)\n" +" (funcall fn)\n" +" (lambda (&rest rest)\n" +" (curry-n (something n) fn))))\n" +"\n" +"(defun add (a b c d e)\n" +" (curry-n\n" +" (length '(a b c d e))\n" +" (lambda (&rest rest)\n" +" (apply #'+ rest))))\n" +msgstr "" + +msgid "" +"Without built-in multi-arity support, we have to do more work, like tracking" +" the number of arguments consumed so far. That is, without dependending on " +"any library, sticking to ANSI Common Lisp." +msgstr "" + +msgid "" +"This also require `funcall`s, since we return a `lambda` that doesn't live " +"in the function namespace." +msgstr "" + +msgid "" +"Like the Clojure one, it doesn't support optional parameters, `&rest` rest " +"arguments, docstrings, etc., but it also could evolve to do so." +msgstr "" diff --git a/locale/pt/LC_MESSAGES/_tils/2021-04-24-common-lisp-argument-precedence-order-parameterization-of-a-generic-function.po b/locale/pt/LC_MESSAGES/_tils/2021-04-24-common-lisp-argument-precedence-order-parameterization-of-a-generic-function.po new file mode 100644 index 0000000..b773879 --- /dev/null +++ b/locale/pt/LC_MESSAGES/_tils/2021-04-24-common-lisp-argument-precedence-order-parameterization-of-a-generic-function.po @@ -0,0 +1,185 @@ +# +msgid "" +msgstr "" + +msgid "" +"title: Common Lisp argument precedence order parameterization of a generic " +"function" +msgstr "" + +msgid "date: 2021-04-24" +msgstr "" + +msgid "layout: post" +msgstr "" + +msgid "lang: en" +msgstr "" + +msgid "" +"ref: common-lisp-argument-precedence-order-parameterization-of-a-generic-" +"function" +msgstr "" + +msgid "" +"When CLOS dispatches a method, it picks the most specific method definition " +"to the argument list:" +msgstr "" + +msgid "" +"\n" +"* (defgeneric a-fn (x))\n" +"#<STANDARD-GENERIC-FUNCTION A-FN (0) {5815ACB9}>\n" +"\n" +"* (defmethod a-fn (x) :default-method)\n" +"#<STANDARD-METHOD A-FN (T) {581DB535}>\n" +"\n" +"* (defmethod a-fn ((x number)) :a-number)\n" +"#<STANDARD-METHOD A-FN (NUMBER) {58241645}>\n" +"\n" +"* (defmethod a-fn ((x (eql 1))) :number-1)\n" +"#<STANDARD-METHOD A-FN ((EQL 1)) {582A7D75}>\n" +"\n" +"* (a-fn nil)\n" +":DEFAULT-METHOD\n" +"\n" +"* (a-fn \"1\")\n" +":DEFAULT-METHOD\n" +"\n" +"* (a-fn 0)\n" +":A-NUMBER\n" +"\n" +"* (a-fn 1)\n" +":NUMBER-1\n" +msgstr "" + +msgid "" +"CLOS uses a similar logic when choosing the method from parent classes, when" +" multiple ones are available:" +msgstr "" + +msgid "" +"* (defclass class-a () ())\n" +"\n" +"#<STANDARD-CLASS CLASS-A {583E0B25}>\n" +"* (defclass class-b () ())\n" +"\n" +"#<STANDARD-CLASS CLASS-B {583E7F6D}>\n" +"* (defgeneric another-fn (obj))\n" +"\n" +"#<STANDARD-GENERIC-FUNCTION ANOTHER-FN (0) {583DA749}>\n" +"* (defmethod another-fn ((obj class-a)) :class-a)\n" +"; Compiling LAMBDA (.PV-CELL. .NEXT-METHOD-CALL. OBJ):\n" +"; Compiling Top-Level Form:\n" +"\n" +"#<STANDARD-METHOD ANOTHER-FN (CLASS-A) {584523C5}>\n" +"* (defmethod another-fn ((obj class-b)) :class-b)\n" +"; Compiling LAMBDA (.PV-CELL. .NEXT-METHOD-CALL. OBJ):\n" +"; Compiling Top-Level Form:\n" +"\n" +"#<STANDARD-METHOD ANOTHER-FN (CLASS-B) {584B8895}>\n" +msgstr "" + +msgid "" +"Given the above definitions, when inheriting from `class-a` and `class-b`, " +"the order of inheritance matters:" +msgstr "" + +msgid "" +"* (defclass class-a-coming-first (class-a class-b) ())\n" +"#<STANDARD-CLASS CLASS-A-COMING-FIRST {584BE6AD}>\n" +"\n" +"* (defclass class-b-coming-first (class-b class-a) ())\n" +"#<STANDARD-CLASS CLASS-B-COMING-FIRST {584C744D}>\n" +"\n" +"* (another-fn (make-instance 'class-a-coming-first))\n" +":CLASS-A\n" +"\n" +"* (another-fn (make-instance 'class-b-coming-first))\n" +":CLASS-B\n" +msgstr "" + +msgid "" +"Combining the order of inheritance with generic functions with multiple " +"arguments, CLOS has to make a choice of how to pick a method given two " +"competing definitions, and its default strategy is prioritizing from left to" +" right:" +msgstr "" + +msgid "" +"* (defgeneric yet-another-fn (obj1 obj2))\n" +"#<STANDARD-GENERIC-FUNCTION YET-ANOTHER-FN (0) {584D9EC9}>\n" +"\n" +"* (defmethod yet-another-fn ((obj1 class-a) obj2) :first-arg-specialized)\n" +"#<STANDARD-METHOD YET-ANOTHER-FN (CLASS-A T) {5854269D}>\n" +"\n" +"* (defmethod yet-another-fn (obj1 (obj2 class-b)) :second-arg-specialized)\n" +"#<STANDARD-METHOD YET-ANOTHER-FN (T CLASS-B) {585AAAAD}>\n" +"\n" +"* (yet-another-fn (make-instance 'class-a) (make-instance 'class-b))\n" +":FIRST-ARG-SPECIALIZED\n" +msgstr "" + +msgid "" +"CLOS has to make a choice between the first and the second definition of " +"`yet-another-fn`, but its choice is just a heuristic. What if we want to the" +" choice to be based on the second argument first?" +msgstr "" + +msgid "" +"For that, we use the `:argument-precedence-order` option when declaring a " +"generic function:" +msgstr "" + +msgid "" +"* (defgeneric yet-another-fn (obj1 obj2) (:argument-precedence-order obj2 obj1))\n" +"#<STANDARD-GENERIC-FUNCTION YET-ANOTHER-FN (2) {584D9EC9}>\n" +"\n" +"* (yet-another-fn (make-instance 'class-a) (make-instance 'class-b))\n" +":SECOND-ARG-SPECIALIZED\n" +msgstr "" + +msgid "" +"I liked that the `:argument-precedence-order` option exists. We shouldn't " +"have to change the arguments from `(obj1 obj2)` to `(obj2 obj1)` just to " +"make CLOS pick the method that we want. We can configure its default " +"behaviour if desired, and keep the order of arguments however it best fits " +"the generic function." +msgstr "" + +msgid "Comparison with Clojure" +msgstr "" + +msgid "Clojure has an equivalent, when using `defmulti`." +msgstr "" + +msgid "" +"Since when declaring a multi-method with `defmulti` we must define the " +"dispatch function, Clojure uses it to pick the method definition. Since the " +"dispatch function is required, there is no need for a default behaviour, " +"such as left-to-right." +msgstr "" + +msgid "Conclusion" +msgstr "" + +msgid "" +"Making the argument precedence order configurable for generic functions but " +"not for class definitions makes a lot of sense." +msgstr "" + +msgid "" +"When declaring a class, we can choose the precedence order, and that is " +"about it. But when defining a generic function, the order of argumentws is " +"more important to the function semantics, and the argument precedence being " +"left-to-right is just the default behaviour." +msgstr "" + +msgid "" +"One shouldn't change the order of arguments of a generic function for the " +"sake of tailoring it to the CLOS priority ranking algorithm, but doing it " +"for a class definition is just fine." +msgstr "" + +msgid "TIL." +msgstr "" |