Closed semperos closed 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!
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:
lua/aniseed/core.lua
if desired, I wasn't sure if anything environment-specific on my end might cause issues with the output Lua code (I was made further suspicious bylua/aniseed/deps/fennel.lua
seeing changes as part of my work).