From 0e6bf02503fffd89891eb37f023911ff98d022cf Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Sat, 24 Apr 2021 18:57:40 -0300 Subject: Update locale files --- ...04-24-three-way-conditional-for-number-signs.po | 84 ++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 locale/fr/LC_MESSAGES/_tils/2021-04-24-three-way-conditional-for-number-signs.po (limited to 'locale/fr/LC_MESSAGES/_tils/2021-04-24-three-way-conditional-for-number-signs.po') diff --git a/locale/fr/LC_MESSAGES/_tils/2021-04-24-three-way-conditional-for-number-signs.po b/locale/fr/LC_MESSAGES/_tils/2021-04-24-three-way-conditional-for-number-signs.po new file mode 100644 index 0000000..4b98383 --- /dev/null +++ b/locale/fr/LC_MESSAGES/_tils/2021-04-24-three-way-conditional-for-number-signs.po @@ -0,0 +1,84 @@ +# +msgid "" +msgstr "" + +msgid "title: Three-way conditional for number signs" +msgstr "" + +msgid "date: 2021-04-24 3" +msgstr "" + +msgid "layout: post" +msgstr "" + +msgid "lang: en" +msgstr "" + +msgid "ref: three-way-conditional-for-number-signs" +msgstr "" + +msgid "" +"A useful macro from Paul Graham's [On " +"Lisp](http://www.paulgraham.com/onlisptext.html) book:" +msgstr "" + +msgid "" +"(defmacro nif (expr pos zero neg)\n" +" (let ((g (gensym)))\n" +" `(let ((,g ,expr))\n" +" (cond ((plusp ,g) ,pos)\n" +" ((zerop ,g) ,zero)\n" +" (t ,neg)))))\n" +msgstr "" + +msgid "" +"After I looked at this macro, I started seeing opportunities to using it in " +"many places, and yet I didn't see anyonelse using it." +msgstr "" + +msgid "" +"The latest example I can think of is section 1.3.3 of [Structure and " +"Interpretation of Computer " +"Programs](https://mitpress.mit.edu/sites/default/files/sicp/index.html), " +"which I was reading recently:" +msgstr "" + +msgid "" +"(define (search f neg-point pos-point)\n" +" (let ((midpoint (average neg-point pos-point)))\n" +" (if (close-enough? neg-point post-point)\n" +" midpoint\n" +" (let ((test-value (f midpoint)))\n" +" (cond ((positive? test-value)\n" +" (search f neg-point midpoint))\n" +" ((negative? test-value)\n" +" (search f midpoint pos-point))\n" +" (else midpoint))))))\n" +msgstr "" + +msgid "" +"Not that the book should introduce such macro this early, but I couldn't " +"avoid feeling bothered by not using a `nif` macro, which could even remove " +"the need for the intermediate `test-value` variable:" +msgstr "" + +msgid "" +"(define (search f neg-point pos-point)\n" +" (let ((midpoint (average neg-point pos-point)))\n" +" (if (close-enough? neg-point post-point)\n" +" midpoint\n" +" (nif (f midpoint)\n" +" (search f neg-point midpoint)\n" +" (midpoint)\n" +" (search f midpoint pos-point)))))\n" +msgstr "" + +msgid "" +"It also avoids `cond`'s extra clunky parentheses for grouping, which is " +"unnecessary but built-in." +msgstr "" + +msgid "" +"As a macro, I personally feel it tilts the balance towards expressivenes " +"despite its extra cognitive load toll." +msgstr "" -- cgit v1.2.3 From 128509ccbf0b280a38636b75ba001808b9ad250f Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Sat, 24 Apr 2021 19:08:45 -0300 Subject: Proofread TIL on nif macro --- ...04-24-three-way-conditional-for-number-signs.md | 4 +-- ...04-24-three-way-conditional-for-number-signs.po | 33 ++++++++++++++-------- ...04-24-three-way-conditional-for-number-signs.po | 33 ++++++++++++++-------- ...04-24-three-way-conditional-for-number-signs.po | 33 ++++++++++++++-------- 4 files changed, 68 insertions(+), 35 deletions(-) (limited to 'locale/fr/LC_MESSAGES/_tils/2021-04-24-three-way-conditional-for-number-signs.po') diff --git a/_tils/2021-04-24-three-way-conditional-for-number-signs.md b/_tils/2021-04-24-three-way-conditional-for-number-signs.md index 4a55b61..ec62378 100644 --- a/_tils/2021-04-24-three-way-conditional-for-number-signs.md +++ b/_tils/2021-04-24-three-way-conditional-for-number-signs.md @@ -23,7 +23,7 @@ A useful macro from Paul Graham's [On Lisp][on-lisp] book: (t ,neg))))) ``` -After I looked at this macro, I started seeing opportunities to using it in many places, and yet I didn't see anyonelse using it. +After I looked at this macro, I started seeing opportunities to using it in many places, and yet I didn't see anyone else using it. The latest example I can think of is section 1.3.3 of [Structure and Interpretation of Computer Programs][sicp], which I was reading recently: @@ -40,7 +40,7 @@ The latest example I can think of is section 1.3.3 of [Structure and Interpretat (else midpoint)))))) ``` -Not that the book should introduce such macro this early, but I couldn't avoid feeling bothered by not using a `nif` macro, which could even remove the need for the intermediate `test-value` variable: +Not that the book should introduce such macro this early, but I couldn't avoid feeling bothered by not using the `nif` macro, which could even remove the need for the intermediate `test-value` variable: ```scheme (define (search f neg-point pos-point) diff --git a/locale/eo/LC_MESSAGES/_tils/2021-04-24-three-way-conditional-for-number-signs.po b/locale/eo/LC_MESSAGES/_tils/2021-04-24-three-way-conditional-for-number-signs.po index 4b98383..925a00b 100644 --- a/locale/eo/LC_MESSAGES/_tils/2021-04-24-three-way-conditional-for-number-signs.po +++ b/locale/eo/LC_MESSAGES/_tils/2021-04-24-three-way-conditional-for-number-signs.po @@ -31,11 +31,6 @@ msgid "" " (t ,neg)))))\n" msgstr "" -msgid "" -"After I looked at this macro, I started seeing opportunities to using it in " -"many places, and yet I didn't see anyonelse using it." -msgstr "" - msgid "" "The latest example I can think of is section 1.3.3 of [Structure and " "Interpretation of Computer " @@ -56,12 +51,6 @@ msgid "" " (else midpoint))))))\n" msgstr "" -msgid "" -"Not that the book should introduce such macro this early, but I couldn't " -"avoid feeling bothered by not using a `nif` macro, which could even remove " -"the need for the intermediate `test-value` variable:" -msgstr "" - msgid "" "(define (search f neg-point pos-point)\n" " (let ((midpoint (average neg-point pos-point)))\n" @@ -82,3 +71,25 @@ msgid "" "As a macro, I personally feel it tilts the balance towards expressivenes " "despite its extra cognitive load toll." msgstr "" + +msgid "" +"After I looked at this macro, I started seeing opportunities to using it in " +"many places, and yet I didn't see anyone else using it." +msgstr "" + +msgid "" +"Not that the book should introduce such macro this early, but I couldn't " +"avoid feeling bothered by not using the `nif` macro, which could even remove" +" the need for the intermediate `test-value` variable:" +msgstr "" + +#~ msgid "" +#~ "After I looked at this macro, I started seeing opportunities to using it in " +#~ "many places, and yet I didn't see anyonelse using it." +#~ msgstr "" + +#~ msgid "" +#~ "Not that the book should introduce such macro this early, but I couldn't " +#~ "avoid feeling bothered by not using a `nif` macro, which could even remove " +#~ "the need for the intermediate `test-value` variable:" +#~ msgstr "" diff --git a/locale/fr/LC_MESSAGES/_tils/2021-04-24-three-way-conditional-for-number-signs.po b/locale/fr/LC_MESSAGES/_tils/2021-04-24-three-way-conditional-for-number-signs.po index 4b98383..925a00b 100644 --- a/locale/fr/LC_MESSAGES/_tils/2021-04-24-three-way-conditional-for-number-signs.po +++ b/locale/fr/LC_MESSAGES/_tils/2021-04-24-three-way-conditional-for-number-signs.po @@ -31,11 +31,6 @@ msgid "" " (t ,neg)))))\n" msgstr "" -msgid "" -"After I looked at this macro, I started seeing opportunities to using it in " -"many places, and yet I didn't see anyonelse using it." -msgstr "" - msgid "" "The latest example I can think of is section 1.3.3 of [Structure and " "Interpretation of Computer " @@ -56,12 +51,6 @@ msgid "" " (else midpoint))))))\n" msgstr "" -msgid "" -"Not that the book should introduce such macro this early, but I couldn't " -"avoid feeling bothered by not using a `nif` macro, which could even remove " -"the need for the intermediate `test-value` variable:" -msgstr "" - msgid "" "(define (search f neg-point pos-point)\n" " (let ((midpoint (average neg-point pos-point)))\n" @@ -82,3 +71,25 @@ msgid "" "As a macro, I personally feel it tilts the balance towards expressivenes " "despite its extra cognitive load toll." msgstr "" + +msgid "" +"After I looked at this macro, I started seeing opportunities to using it in " +"many places, and yet I didn't see anyone else using it." +msgstr "" + +msgid "" +"Not that the book should introduce such macro this early, but I couldn't " +"avoid feeling bothered by not using the `nif` macro, which could even remove" +" the need for the intermediate `test-value` variable:" +msgstr "" + +#~ msgid "" +#~ "After I looked at this macro, I started seeing opportunities to using it in " +#~ "many places, and yet I didn't see anyonelse using it." +#~ msgstr "" + +#~ msgid "" +#~ "Not that the book should introduce such macro this early, but I couldn't " +#~ "avoid feeling bothered by not using a `nif` macro, which could even remove " +#~ "the need for the intermediate `test-value` variable:" +#~ msgstr "" diff --git a/locale/pt/LC_MESSAGES/_tils/2021-04-24-three-way-conditional-for-number-signs.po b/locale/pt/LC_MESSAGES/_tils/2021-04-24-three-way-conditional-for-number-signs.po index 4b98383..925a00b 100644 --- a/locale/pt/LC_MESSAGES/_tils/2021-04-24-three-way-conditional-for-number-signs.po +++ b/locale/pt/LC_MESSAGES/_tils/2021-04-24-three-way-conditional-for-number-signs.po @@ -31,11 +31,6 @@ msgid "" " (t ,neg)))))\n" msgstr "" -msgid "" -"After I looked at this macro, I started seeing opportunities to using it in " -"many places, and yet I didn't see anyonelse using it." -msgstr "" - msgid "" "The latest example I can think of is section 1.3.3 of [Structure and " "Interpretation of Computer " @@ -56,12 +51,6 @@ msgid "" " (else midpoint))))))\n" msgstr "" -msgid "" -"Not that the book should introduce such macro this early, but I couldn't " -"avoid feeling bothered by not using a `nif` macro, which could even remove " -"the need for the intermediate `test-value` variable:" -msgstr "" - msgid "" "(define (search f neg-point pos-point)\n" " (let ((midpoint (average neg-point pos-point)))\n" @@ -82,3 +71,25 @@ msgid "" "As a macro, I personally feel it tilts the balance towards expressivenes " "despite its extra cognitive load toll." msgstr "" + +msgid "" +"After I looked at this macro, I started seeing opportunities to using it in " +"many places, and yet I didn't see anyone else using it." +msgstr "" + +msgid "" +"Not that the book should introduce such macro this early, but I couldn't " +"avoid feeling bothered by not using the `nif` macro, which could even remove" +" the need for the intermediate `test-value` variable:" +msgstr "" + +#~ msgid "" +#~ "After I looked at this macro, I started seeing opportunities to using it in " +#~ "many places, and yet I didn't see anyonelse using it." +#~ msgstr "" + +#~ msgid "" +#~ "Not that the book should introduce such macro this early, but I couldn't " +#~ "avoid feeling bothered by not using a `nif` macro, which could even remove " +#~ "the need for the intermediate `test-value` variable:" +#~ msgstr "" -- cgit v1.2.3