(defn insert [v i e] (vec (concat (subvec v 0 i) [e] (subvec v i))))
(insert [1 2 3 4] 2 10)
(defn insert [v i e] (vec (concat (take i v) [e] (drop i v))))
Chousers answer (from google clojure group): https://groups.google.com/forum/#!topic/clojure/zjZDSziZVQk
(apply conj [:a :b] :q [:c :d])
;=> [:a :b :q :c :d]
Chousers answer (from google clojure group): https://groups.google.com/forum/#!topic/clojure/zjZDSziZVQk
(apply conj [:a :b] :q [:c :d])
;=> [:a :b :q :c :d]Apparently, there's no direct way to do it because it's not efficient
On Sunday, May 3, 2015 at 7:23:08 PM UTC-4, John Tollison wrote:Or,(defn insert [v i e] (vec (concat (take i v) [e] (drop i v))))
On Sunday, May 3, 2015 at 9:28:22 AM UTC-4, John Tollison wrote:I always do it the hard way and then suspect there's a better way.One hard way:(defn insert [v i e] (vec (concat (subvec v 0 i) [e] (subvec v i))))
(insert [1 2 3 4] 2 10)
user => [1 2 10 3 4]On Sunday, May 3, 2015 at 9:02:44 AM UTC-4, Glen Peterson wrote:In Java, I sometimes want to prepend things to the beginning of a vector, or insert them into the middle, shifting the current item and all subsequent items to the right.Using assoc where the index is equal to the size of the vector is the same as an append, but with any other index, it is either a replace, or throws an exception. This seems weird to me:user=> (assoc [2 4 6] 1 7)[2 7 6]user=> (assoc [2 4 6] 2 7)[2 4 7]user=> (assoc [2 4 6] 3 7)[2 4 6 7]user=> (assoc [2 4 6] 4 7)IndexOutOfBoundsException clojure.lang.PersistentVector.assocN (PersistentVector.java:137)How do you "insert" in Clojure shifting subsequent items to the right? Maybe you don't use a vector, but use a sequence instead? A brief example might be helpful.
--
You received this message because you are subscribed to the Google Groups "Greenville Clojure Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to greenville-cloj...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
PolkaDot mushroom chocolate – The dotted Belgian delight with a punch
https://t.me/budExotic
https://t.me/budExotic
https://t.me/budExotic
https://t.me/budExotic
https://t.me/budExotic
Culinary innovations are here to redefine the boundaries of flavor. Need proof? Meet PolkaDot chocolate bars! Mouth-watering Belgian chocolate harmoniously entwined with the purest mushroom varieties carefully crammed into a polka-dotted bar – it is not just a snack but an extraordinary experience for your senses.
https://t.me/budExotic
https://t.me/budExotic
https://t.me/budExotic
https://t.me/budExotic
https://t.me/budExotic
Every bite of this chocolate bar will take you beyond your culinary dreams. Get ready for an exquisite exploration fueled by magic mushrooms and the indulgent sweetness of the Cinnamon Toast Crunch flavor. It adds an extra layer of delight, with each bar resonating perfectly with the next.
https://t.me/budExotic
https://t.me/budExotic
https://t.me/budExotic
https://t.me/budExotic
https://t.me/budExotic
https://t.me/budExotic
https://t.me/budExotic
The PolkaDot magic chocolate for sale is visually appetizing, too. The playful polka-dotted shape is an invitation to savor the artistry of the chocolatiers who have done their best to make it irresistible. Because they contain psilocybin, you wouldn’t give them to little ones, but PolkaDot bars are amazing as presents for grown-ups who don’t mind some punch.
https://t.me/budExotic
https://t.me/budExotic
https://t.me/budExotic
https://t.me/budExotic
https://t.me/budExotic
https://t.me/budExotic
https://t.me/budExotic
Preserving the goodness of your PolkaDot chocolate
If you want to keep your indulgence ready to bite over time, you won’t be disappointed with PolkaDot. Store it in a dry container – with other treats or alone – and your mushroom bar will not lose any delicious or invigorating properties within 12 months. This means you can stock up on PolkaDot chocolate online without any fear of its magic tapering off.
https://t.me/budExotic
https://t.me/budExotic
https://t.me/budExotic
https://t.me/budExotic
https://t.me/budExotic
https://t.me/budExotic
https://t.me/budExotic
https://t.me/budExotic
https://t.me/budExotic
There’s a caveat, though. Once you open the enchanting package, it’s best to have your delightful goodness within two weeks. The fresher, the better – it’s the key to unlocking the full spectrum of the Cinnamon Toast Crunch flavor and top-grade mushrooms.
Careful handling and secure delivery
https://t.me/budExotic
https://t.me/budExotic
https://t.me/budExotic
https://t.me/budExotic
https://t.me/budExotic
https://t.me/budExotic
https://t.me/budExotic
https://t.me/budExotic
If you are in the US, you can buy PolkaDot magic Belgian chocolate in the fastest way at Global Supply. We understand that when you crave something as extraordinary as PolkaDot bars, waiting is not an option. Our well-thought-out delivery system means you can get this product with overnight shipping, so all your cravings are promptly met.
https://t.me/budExotic
https://t.me/budExotic
https://t.me/budExotic
https://t.me/budExotic
https://t.me/budExotic
https://t.me/budExotic
https://t.me/budExotic
https://t.me/budExotic
https://t.me/budExotic
But what about the discreetness of PolkaDot packaging? The great news is that we put your bars in an invisible box to ensure your indulgence remains a delightful secret until you decide to unwrap it. Until then, nobody is going to judge your purchase or ask for a bite!
https://t.me/budExotic
https://t.me/budExotic
https://t.me/budExotic
https://t.me/budExotic
https://t.me/budExotic
https://t.me/budExotic
https://t.me/budExotic
https://t.me/budExotic
For the best experiences, we go above and beyond to ship PolkaDot chocolate with mushrooms at their freshest. You can trust us to deliver your bars safely and securely, preserving their quality and crunchy flavor until you’re ready to experience that magic.Treat yourself to the extraordinary as you buy PolkaDot chocolate online. This is where the Belgian taste, unusual texture, and psilocybin effects unite to create a sensory masterpiece. With a shelf life that allows you to savor it at your own pace and our dedication to discreet, secure delivery, nothing keeps you from having PolkaDot as your everyday treat. At only $50 per box, your taste buds will be quick to thank you
https://t.me/budExotic
https://t.me/budExotic
https://t.me/budExotic
https://t.me/budExotic
https://t.me/budExotic
https://t.me/budExotic
https://t.me/budExotic
https://t.me/budExotic
https://t.me/budExotic