Coder Social home page Coder Social logo

list-utils's Introduction

Build Status

Overview

List-manipulation utility functions for Emacs.

Quickstart

(require 'list-utils)
 
(list-utils-flatten '(1 2 (3 4 (5 6 7))))
;; '(1 2 3 4 5 6 7)
 
(list-utils-depth '(1 2 (3 4 (5 6 7))))
;; 3
 
(let ((cyclic-list '(1 2 3 4 5 6 7)))
  (nconc cyclic-list (cdr cyclic-list))
  (list-utils-make-linear-inplace cyclic-list))
;; '(1 2 3 4 5 6 7)
 
(list-utils-cyclic-p '(1 2 3))
;; nil
 
(list-utils-plist-del '(:one 1 :two 2 :three 3) :two)
;; '(:one 1 :three 3)

Explanation

List-utils is a collection of functions for list manipulation. This library has no user-level interface; it is only useful for programming in Emacs Lisp.

Notable functionality includes

  • list-utils-flatten, a robust list-flattener which handles cyclic lists, non-nil-terminated lists, and preserves nils when they are found as list elements.

  • tconc, a simple data structure for efficiently appending to a list

The following functions are provided:

make-tconc
tconc-p
tconc-list
tconc
list-utils-cons-cell-p
list-utils-cyclic-length
list-utils-improper-p
list-utils-make-proper-copy
list-utils-make-proper-inplace
list-utils-make-improper-copy
list-utils-make-improper-inplace
list-utils-linear-p
list-utils-linear-subseq
list-utils-cyclic-p
list-utils-cyclic-subseq
list-utils-make-linear-copy
list-utils-make-linear-inplace
list-utils-safe-length
list-utils-safe-equal
list-utils-depth
list-utils-flat-length
list-utils-flatten
list-utils-alist-or-flat-length
list-utils-alist-flatten
list-utils-insert-before
list-utils-insert-after
list-utils-insert-before-pos
list-utils-insert-after-pos
list-utils-and
list-utils-not
list-utils-xor
list-utils-uniq
list-utils-dupes
list-utils-singlets
list-utils-partition-dupes
list-utils-plist-reverse
list-utils-plist-del

To use list-utils, place the list-utils.el library somewhere Emacs can find it, and add the following to your ~/.emacs file:

(require 'list-utils)

Notes

This library includes an implementation of the classic Lisp tconc which is outside the list-utils- namespace.

Compatibility and Requirements

No external dependencies

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.