~technomancy

WA, USA

https://technomancy.us

tryin' to catch the last train out of Omelas

~technomancy/fennel

Last active 22 hours ago
View more

Recent activity

Re: [PATCH v2] add ,apropos ,apropos-doc and ,apropos-show-docs repl commands 10 days ago

From Phil Hagelberg to ~technomancy/fennel

Andrey Listopadov <andreyorst@gmail.com> writes:

> This patch adds three new commands: ,apropos ,apropos-doc and
> ,apropos-show-docs.  All commands accept a Lua pattern as an input.
>
> ,apropos will print all function names matching this pattern,
> e.g. ,apropos table%. will list all functions from the table module
>
> ,aprops-doc works similarly, but instead of searching for the pattern
> in function name, it searches the pattern in all documentations
> available. E.g. ,apropos-doc "arity check" will list lambda and λ
>
> ,apropos-show-docs works similarly to ,apropos but displays all docs
> matching a pattern in the function name.

Re: [PATCH] add ,apropos and ,apropos-doc repl commands 12 days ago

From Phil Hagelberg to ~technomancy/fennel

Andrey Listopadov <andreyorst@gmail.com> writes:

> This patch adds two new commands: ,apropos and ,apropos-doc
> Both commands accept a Lua pattern as an input.
>
> ,apropos table%. will print all function names matching this pattern,
> e.g. all functions from the table module
>
> ,aprops-doc works similarly, but instead of printing all names, prints
> all docs for functions that match the pattern.

Oh, I think maybe I miscommunicated this--my intent was that apropos-doc
would search the docstrings and print the names of the matches, not that
it would run doc on the results from apropos. Sorry for the confusion

Re: linked lists 19 days ago

From to ~technomancy/fennel

Claude Marinier <claudem223@gmail.com> writes:

> What would an idiomatic Fennel way of doing what I am used to
> doing with lists?

In Fennel the main way you walk thru tables is using iterators as
mentioned; either `pairs` or `ipairs` usually: 
https://www.lua.org/pil/7.1.html

You can also walk thru a sequential table using recursion, but it will
look different from in Scheme:

     (fn recur [tbl ?i]
       (match (. tbl (or ?i 1))

Re: [PATCH] Add some notes on dynamic scope, and reference Cljlib 2 months ago

From Phil Hagelberg to ~technomancy/fennel

Andrey Listopadov <andreyorst@gmail.com> writes:

> I've thought that it may be worth including Cljlib in the guide, as it
> allows almost direct porting of Clojure code into Fennel with some
> small alternations in function and macro names, thus can make the
> transition easier.

This is great; thanks. Applied and pushed.

-Phil

[ANN] Fennel 0.9.2 released 2 months ago

From Phil Hagelberg to ~technomancy/fennel

Hello Fennelers!

I'm happy to announce the release of Fennel 0.9.2. All the changes here
were pretty minor bug fixes, but they add up.

## 0.9.2 / 2021-05-17

* Add Fennel for Clojure Users guide
* Never treat `_ENV` as an unknown global
* Fix multi-value destructuring in pattern matches that use `where`
* Fix a bug around disambiguating parens in method calls
* Improve behavior of `?.` when used directly on nil
* Fix a bug where line number correlation was thrown off in macros
* Fix a bug where `--use-bit-lib` was not propagating to the REPL

Re: [PATCH] compiler: allow strings at call position 2 months ago

From Phil Hagelberg to ~technomancy/fennel

Andrey Listopadov <andreyorst@gmail.com> writes:

> Strings can possibly have a __call metamethod, and it's actually
> possible to call strings in Lua with the following notation:
> `("str")(...)`.  This patch adds a check if AST element at call
> position is a string, and if it is, it is wrapped in parentheses to
> ensure correct Lua syntax.

Thanks; applied and pushed.

-Phil

[PATCH] Don't double-uniquify gensyms. 3 months ago

From Phil Hagelberg to ~technomancy/fennel

Gensyms already have uniqueness checks, so they can skip the extra
uniqueness checks from declare-local.

This should fix https://todo.sr.ht/~technomancy/fennel/54
---
 src/fennel/compiler.fnl | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/fennel/compiler.fnl b/src/fennel/compiler.fnl
index 023d63b..349f270 100644
--- a/src/fennel/compiler.fnl
+++ b/src/fennel/compiler.fnl
@@ -24,7 +24,8 @@ implement nesting. "
     :specials (setmetatable [] {:__index (and parent parent.specials)})
[message trimmed]

Re: [PATCH] Support short version flag (-v) 3 months ago

From Phil Hagelberg to ~technomancy/fennel

Jack Hill <jackhill@jackhill.us> writes:

> * src/launcher.fnl: Match on -v in addition to --version to print the
> version information.

Thanks but it looks like someone beat you to this; sorry!

-Phil

Re: Minetest 3 months ago

From Phil Hagelberg to ~technomancy/fennel

vapnik spaknik <vapniks@yahoo.com> writes:

> I came here looking for a way to create minetest mods using lisp; I'm
> not sure how to access all the minetest functions from within fennel.
> I notice there is a link to the minetest website on
> https://fennel-lang.org, but I can't find any other information about
> minetest on that website, or the wiki, or the mailing list archives.
> Was it just a nice hypothetical idea, or has someone actually
> succeeded in doing this (using fennel to write minetest mods).

I've written a proof of concept minetest mod but nothing significant yet.
It was a while ago now tho, and I can't find the source. But it worked fine.

The Minetest API is just like any other Lua API. You can call its

[ANN] Fennel 0.9.1 released 3 months ago

From Phil Hagelberg to ~technomancy/fennel

Hello folks!

Just wanted to let you know that Fennel 0.9.1 has been released. It
contains one single bugfix:

## 0.9.1 / 2021-04-10

* Fix a bug in compiled output for statement separators in LuaJIT

You can read more about it here: https://todo.sr.ht/~technomancy/fennel/52

Basically the previous version could emit code that would be rejected by
LuaJIT (but not PUC Lua) in certain cases where you had a method call as
the first thing in a function.