{"id":23070164,"url":"https://github.com/strojure/vectops","last_synced_at":"2025-08-15T13:32:45.281Z","repository":{"id":58643325,"uuid":"531433764","full_name":"strojure/vectops","owner":"strojure","description":"Basic operations with Clojure vectors.","archived":false,"fork":false,"pushed_at":"2023-03-09T10:39:05.000Z","size":46,"stargazers_count":5,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"default","last_synced_at":"2024-11-29T03:05:49.433Z","etag":null,"topics":["clojure","clojurescript","optimization","persistent-data-structure","vectors"],"latest_commit_sha":null,"homepage":"","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/strojure.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-09-01T08:41:45.000Z","updated_at":"2023-07-25T15:01:09.000Z","dependencies_parsed_at":"2022-09-06T10:40:58.753Z","dependency_job_id":null,"html_url":"https://github.com/strojure/vectops","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strojure%2Fvectops","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strojure%2Fvectops/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strojure%2Fvectops/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strojure%2Fvectops/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/strojure","download_url":"https://codeload.github.com/strojure/vectops/tar.gz/refs/heads/default","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229916370,"owners_count":18144129,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clojure","clojurescript","optimization","persistent-data-structure","vectors"],"created_at":"2024-12-16T06:19:53.129Z","updated_at":"2024-12-16T06:19:53.765Z","avatar_url":"https://github.com/strojure.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vectops\n\nBasic operations with Clojure(Script) vectors.\n\n[![Clojars Project](https://img.shields.io/clojars/v/com.github.strojure/vectops.svg)](https://clojars.org/com.github.strojure/vectops)\n\n[![cljdoc badge](https://cljdoc.org/badge/com.github.strojure/vectops)](https://cljdoc.org/d/com.github.strojure/vectops)\n[![cljs compatible](https://img.shields.io/badge/cljs-compatible-green)](https://clojurescript.org/)\n[![tests](https://github.com/strojure/vectops/actions/workflows/tests.yml/badge.svg)](https://github.com/strojure/vectops/actions/workflows/tests.yml)\n\n## Purpose\n\n* Provide functions for basic operations with persistent vectors like inserting\n  or removing elements at index.\n* Performant implementation without extra dependencies.\n* Support Clojure and ClojureScript.\n\n## Usage\n\n### insert-at\n\nThe function `insert-at` inserts element in persistent vector at specified\nindex. There is also `insert-at!` function for transient vectors.\n\n```clojure\n(ns readme.usage.insert-at\n  (:require [strojure.vectops.core :as vec]))\n\n(vec/insert-at [0 1 2 3 4] 0 :x)\n#_=\u003e [:x 0 1 2 3 4]\n\n(vec/insert-at [0 1 2 3 4] 2 :x)\n#_=\u003e [0 1 :x 2 3 4]\n\n(vec/insert-at [0 1 2 3 4] 5 :x)\n#_=\u003e [0 1 2 3 4 :x]\n\n(vec/insert-at [0 1 2 3 4] 6 :x)\n;; Execution error (IndexOutOfBoundsException)\n\n(vec/insert-at nil 0 :x)\n#_=\u003e [:x]\n```\n\n### remove-at\n\nThe function `remove-at` removes element at specified index from persistent\nvector. There is also `remove-at!` function for transient vectors.\n\n```clojure\n(ns readme.usage.remove-at\n  (:require [strojure.vectops.core :as vec]))\n\n(vec/remove-at [0 1 2 3 4] 0)\n#_=\u003e [1 2 3 4]\n\n(vec/remove-at [0 1 2 3 4] 2)\n#_=\u003e [0 1 3 4]\n\n(vec/remove-at [0 1 2 3 4] 4)\n#_=\u003e [0 1 2 3]\n\n(vec/remove-at [0 1 2 3 4] 5)\n;; Execution error (IndexOutOfBoundsException)\n```\n\n### swap-at\n\nThe function `swap-at` swaps elements in persistent vector at two indexes.\nThere is also `swap-at!` function for transient vectors.\n\n```clojure\n(ns readme.usage.swap-at\n  (:require [strojure.vectops.core :as vec]))\n\n(vec/swap-at [0 1 2 3 4] 1 3)\n#_[0 3 2 1 4]\n\n(vec/swap-at [0 1 2 3 4] 0 5)\n;; Execution error (IndexOutOfBoundsException)\n```\n\n## Performance\n\n* [vec/insert-at](doc/benchmarks/insert_at.cljc)\n\n* [vec/remove-at](doc/benchmarks/remove_at.cljc)\n\n* [vec/swap-at](doc/benchmarks/swap_at.cljc)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstrojure%2Fvectops","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstrojure%2Fvectops","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstrojure%2Fvectops/lists"}