bass icon indicating copy to clipboard operation
bass copied to clipboard

deprecate `(append)` in favor of `(concat)`

Open vito opened this issue 2 years ago • 2 comments

The function for joining a list of lists together is currently called (append). It should be called (concat) for consistency with Clojure.

Also the name (append) feels more like (conj).

vito avatar Mar 26 '22 15:03 vito

I would be interested to give a try at this. What's a good way to start? Also would append need to stick around as deprecated until something like v1.0.0 to avoid a breaking change or is fully replacing it already the goal?

pfiaux avatar Aug 27 '22 09:08 pfiaux

Great! The best way to start is just regular old find and replace. Some key searches: defn append for the definition and (append for any uses. Technically there could be higher-order calls too like (apply append lists).

Here's the definition: https://github.com/vito/bass/blob/b280ab3a3ee752957fe7f8a9cad192a5294db8f8/std/root.bass#L217-L227

re: deprecation - it's probably worth trying out a real deprecation flow here for the sake of exercise. There are some usages of (append) in the wild so it'd be nice to avoid breakage. I can add an issue for removing (append) and put it in the v1.0 milestone.

Side note: if you have bass --lsp set up for your editor's LSP integration (bass.vim if you use vim) you can also go-to-definition on append in any Bass script, though it'll take you to a copy of the embedded source rather than the file in your local repo. Mostly useful for read-only introspection.

vito avatar Aug 27 '22 15:08 vito

@vito I saw this is still open, it can be closed right or was there still an open point to tackle?

pfiaux avatar Oct 19 '22 16:10 pfiaux

Oh yep, closing! I already split out a separate issue for removing (append) so this part is done. Thanks for the ping.

vito avatar Oct 19 '22 17:10 vito