~andreyorst

Moscow

https://andreyorst.gitlab.io/

I love Lisp and text editors!

Recent activity

[PATCH fennel] a more robus __fennelrest metamethod detecting 14 days ago

From Andrey Listopadov to ~technomancy/fennel

This uses a proper `if` that doesn't have the disadvantage if `&`
destructuring decides to return `nil` or `false`.  The compilation
string is onelined.
---
 src/fennel/compiler.fnl | 11 +++++++++--
 test/core.fnl           |  1 +
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/fennel/compiler.fnl b/src/fennel/compiler.fnl
index 423bd05..207e732 100644
--- a/src/fennel/compiler.fnl
+++ b/src/fennel/compiler.fnl
@@ -692,8 +692,15 @@ which we have to do if we don't know."
          (when (not (and (= :number (type k))
[message trimmed]

[PATCH fennel v2] add __fennelrest metamethod to adjust & destructuring 15 days ago

From Andrey Listopadov to ~technomancy/fennel

If a table implements the __fennelrest metamethod, when destucturing
this table with the & operator, the metamethod is invoked.  The
metamethod receives the table as the first argument, and the amount of
values it needs to skip from the beginning of the table, much like
table.unpack
---
 changelog.md            |  1 +
 reference.md            | 22 ++++++++++++++++++++++
 src/fennel/compiler.fnl |  4 ++--
 test/core.fnl           |  4 +++-
 4 files changed, 28 insertions(+), 3 deletions(-)

diff --git a/changelog.md b/changelog.md
index 8ec8e29..f97256b 100644
[message trimmed]

[PATCH fennel] add __fnlrest metamethod to adjust & destructuring 15 days ago

From Andrey Listopadov to ~technomancy/fennel

If a table implements the __fnlrest metamethod, when destucturing this
table with the & operator, the metamethod is invoked.  The metamethod
receives the table as the first argument, and the amount of values it
needs to skip from the beginning of the table, much like table.unpack
---
 changelog.md            |  1 +
 reference.md            | 22 ++++++++++++++++++++++
 src/fennel/compiler.fnl |  4 ++--
 test/core.fnl           |  4 +++-
 4 files changed, 28 insertions(+), 3 deletions(-)

diff --git a/changelog.md b/changelog.md
index 8ec8e29..de5bc29 100644
--- a/changelog.md
[message trimmed]

Re: extra "do end" in generated Lua code 18 days ago

From Andrey Listopadov to ~technomancy/fennel

On October 7, 2021 10:28:19 PM UTC, Claude Marinier <claudem223@gmail.com> wrote:
> Hi,
> 
> I notice many extra adjacent "do end" pairs in the generated Lua code.
> 
> Here is an example.
> 
>       print("no move - kill velocity")
>       if ((math.abs(speed_x) < epsilon) and (math.abs(speed_y) < epsilon)) then
>         print("close to zero")
>         do end (dozer.body):setLinearVelocity(0.0, 0.0)
>         do end (dozer.body):applyForce(0.0, 0.0)
>       else
>         local force_x = ( - (math.cos(move_dir) *

[PATCH fennel] add --add-macro-path to the help message and mention in the changelog 22 days ago

From Andrey Listopadov to ~technomancy/fennel

---
 changelog.md     | 1 +
 src/launcher.fnl | 1 +
 2 files changed, 2 insertions(+)

diff --git a/changelog.md b/changelog.md
index 33dd044..9f3a9ac 100644
--- a/changelog.md
+++ b/changelog.md
@@ -12,6 +12,7 @@ Changes are **marked in bold** which could result in backwards-incompatibility.
* Apply strict globals checking in the repl by default
* Allow strict globals checking to be disabled with `--globals "*"`
* Emit warning when `--require-as-include` fails to find a module to include
* Support `--add-macro-path` for configuring macro path similarly to fennel module paths
[message trimmed]

Re: [PATCH fennel] add --add-macro-path switch 22 days ago

From Andrey Listopadov to ~technomancy/fennel

On October 3, 2021 4:34:50 PM UTC, Phil Hagelberg <phil@hagelb.org> wrote:
> Andrey Listopadov <andreyorst@gmail.com> writes:
> 
> > fixes #93
> 
> Thanks; applied both the patches. This one could use a mention in the
> changelog and help text too though, could you send that additionally?
> 
> -Phil

oh, right. Will do
-- 
Andrey Listopadov

[PATCH fennel] add --add-macro-path switch 23 days ago

From Andrey Listopadov to ~technomancy/fennel

fixes #93
---
 src/launcher.fnl | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/launcher.fnl b/src/launcher.fnl
index 8c3e33b..7d7fd2e 100644
--- a/src/launcher.fnl
+++ b/src/launcher.fnl
@@ -103,6 +103,9 @@ If ~/.fennelrc exists, it will be loaded before launching a repl.")
    :--add-fennel-path (let [entry (table.remove arg (+ i 1))]
                         (set fennel.path (.. entry ";" fennel.path))
                         (table.remove arg i))
    :--add-macro-path (let [entry (table.remove arg (+ i 1))]
[message trimmed]

[PATCH fennel] wrap non-list elements in doto similarly to threading macros 23 days ago

From Andrey Listopadov to ~technomancy/fennel

---
 src/fennel/macros.fnl | 5 +++--
 test/macro.fnl        | 6 ++++++
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/fennel/macros.fnl b/src/fennel/macros.fnl
index 4efd2f1..98285b1 100644
--- a/src/fennel/macros.fnl
+++ b/src/fennel/macros.fnl
@@ -78,8 +78,9 @@ a nil value in any of subsequent keys."
  (let [name (gensym)
        form `(let [,name ,val])]
    (each [_ elt (ipairs [...])]
      (table.insert elt 2 name)
[message trimmed]

[PATCH fennel] use correct metamethods in fennel.view a month ago

From Andrey Listopadov to ~technomancy/fennel

Older Lua implementations weren't using __pairs, __ipairs, and __len
metamethods.  This commit changes fennel.view to always check if
correct metamethod exists, and use it instead of Lua one.
---
 src/fennel/view.fnl | 36 ++++++++++++++++++++++++++++--------
 test/core.fnl       |  4 +++-
 2 files changed, 31 insertions(+), 9 deletions(-)

diff --git a/src/fennel/view.fnl b/src/fennel/view.fnl
index 85c8118..b6b5c4a 100644
--- a/src/fennel/view.fnl
+++ b/src/fennel/view.fnl
@@ -8,6 +8,26 @@
                   :userdata 6
[message trimmed]

[PATCH fennel] fix tables with negative arguments being treated as sequential a month ago

From Andrey Listopadov to ~technomancy/fennel

---
 src/fennel/view.fnl | 3 ++-
 test/core.fnl       | 6 ++++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/fennel/view.fnl b/src/fennel/view.fnl
index 0c8003c..85c8118 100644
--- a/src/fennel/view.fnl
+++ b/src/fennel/view.fnl
@@ -55,7 +55,8 @@
  (let [kv []
        insert table.insert]
    (each [k v (pairs t)]
      (when (not= (type k) :number)
[message trimmed]