~technomancy

WA, USA

https://technomancy.us

custom keyboards, emacs, fennel, sometimes clojure?

~technomancy/fennel

Last active 10 days ago

Recent activity

Re: Breaking out of the loop 11 days ago

From Phil Hagelberg to ~technomancy/fennel

Slava Lopata <hayohayo@tuta.io> writes:

> Yes, I see. This one is indeed very specific. Yet, I assume, even then
> it may be less efficient than Lua's for with break/return?

I can't think of a reason it should be; Lua has proper tail calls, so
the recursion here basically compiles to a simple goto.

> Interesting, thanks. Don't all current looping constructs are statements
> though?.. (each), (for), (while).

No, lisps don't have statements; these are simply expressions which
return nil.

Re: Breaking out of the loop 11 days ago

From Phil Hagelberg to ~technomancy/fennel

hayohayo@tuta.io writes:

> I was reading documentation and stumbled upon a lack of early returns
> in Fennel:
> https://github.com/bakpakin/Fennel/blob/master/tutorial.md#gotchas. <https://github.com/bakpakin/Fennel/blob/master/tutorial.md#gotchas>
> Say, how does one look for an element in an array? I can think of
> doing this recursively and manually calling next() on table, but not
> sure if this is the preferred way.

Good question. For most codebases you will want to pull in a 3rd-party
library like Lume or Luafun since the Lua standard library is so small.

  https://github.com/rxi/lume

Re: Technique: using let for Rust-esque variable shadow chains 12 days ago

From Phil Hagelberg to ~technomancy/fennel

Benaiah Mischenko <benaiah@mischenko.com> writes:

> A similar pattern can be used in Fennel with let:
>
> ```fennel
> (let [x 1
>       x (+ x 2)
>       x (* x 2)
>       x (/ x 3)]
>   (print (.. "x: " x)))
> ```

This is a good general-purpose pattern, but you might find the arrow
macro more suitable in this case:

Re: Upcoming version 0.1.0 15 days ago

From Phil Hagelberg to ~technomancy/fennel

Well everybody, the big day finally arrived: the first official release
of Fennel! Notably you can now use `luarocks install --local fennel`
instead of needing to specify the dev server.

Here's the changelog of everything since February:

## 0.1.0 / 2018-11-29

* Save locals in between chunks in the repl
* Allow destructuring in more places
* Remove redundant `defn` macro
* Add `doto` macro
* Support newlines in strings
* Prevent typos from accidentally referring to unknown globals

Upcoming version 0.1.0 16 days ago

From Phil Hagelberg to ~technomancy/fennel

Hey folks, welcome to the brand new Fennel mailing list!

I thought I'd open by posting about the upcoming release. We decided[1]
that it's about time we cut actual version numbers instead of having
everyone just follow the master branch all the time. I've put together a
changelog of everything that's happened since development of Fennel
picked back up this February after the initial two weeks when it was
created in 2016:

  https://github.com/bakpakin/Fennel/blob/master/changelog.md

A recent notable change has been to make the repl persist locals across
multiple lines; previously you had to use globals if you wanted any
values saved across multiple evaluations, which was very unintuitive and