magnars/s.el

make some function destructive

futurist opened this issue · 2 comments

I found it's no pros to use some s- functions compare to native ones, like: s-append compare to concat

Like some elisp functions, like sort ncons, people use it for it's simplify the modification.

So my proposal is to make some functions (maybe new ones) with modification feature, like:

(s-append-it ";" s)  ; will modify s

That way user can enjoy it than using native one: (setq s (concat s ";"))

If this is implemented, please ensure that there is a HUGE warning on any destructive functions; nothing sucks more than being surprised that a function modified data, instead of returning a modified version.

The ! convention probably works; (s-append-it! ...) to signal that this is destructive and should be treated as a huge red flag that the code is impure and risky for general use, so should be restricted to whatever context required that optimization.

Closing as not to be implemented.