Olical / aniseed

Neovim configuration and plugins in Fennel (Lisp compiled to Lua)
https://discord.gg/wXAMr8F
The Unlicense
610 stars 28 forks source link

Implement aniseed.core/str akin to Clojure str #38

Closed semperos closed 3 years ago

semperos commented 3 years ago

This implementation borrows entirely from the existing aniseed.core/println function, differing only in that (1) it does not put spaces into the final string between its arguments and (2) it returns the string rather than printing it.

I recognize that a str function is already provided in a different module. I believe the presence of this aniseed.core/str function will not cause confusion and will ease the learning curve for Clojure developers coming to Fennel/Lua, who may not be familiar with Lua's string concatenation syntax exposed by Fennel and who might be surprised by certain data types causing errors when passed to .. rather than providing default string representations.


Further thoughts:

Olical commented 3 years ago

Oh nice! I like this, thank you very much 😄 people may assume a str function exists since aniseed.core is a spiritual copy of clojure.core, so I like the sound of including things you'd assume exist. I'll merge this and add a little doc string but the rest of it is fine.

And I agree, not including the compiled Lua is probably best practice since I work on stuff that massively changes the output quite regularly. So we'd just run into silly false positive conflicts all the time anyway, just having a .fnl diff is much easier to merge.

Thanks again!