Skip to content

kjinho/rayden

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rayden

https://github.com/kjinho/rayden/actions/workflows/ci.yml/badge.svg

Rayden includes utilities to aid in the writing of Common Lisp code. In particular, there are convenience functions and macros (and re-exports) for writing functional code.

The package depends on the public domain :alexandria and and MIT License :arrow-macros packages.

Usage

Install Rayden by saving the repository into your local lisp directory, such as ​~/.roswell/local-projects/, and loading it from there. For example, once saved in the local lisp directory, you may load it using (ql:quickload :rayden) or (asdf:load-system "rayden").

API

Exports:

  • :drop => removes n items from head of a list
  • :take => returns a list of the first n items from the head of a sequence
  • :iota => from alexandria
  • :curry => from alexandria
  • :-> => from arrow-macros
  • :->> => from arrow-macros
  • :as-> => from arrow-macros
  • :len=1 => checks if length of list is one
  • :length=1 => checks if length of sequence is one
  • :string-split => splits string

Test

After installing rove (ros install rove), execute the following command:

rove rayden.asd

Tested on SBCL, CCL, ECL, and ABCL on GNU/Linux and MacOS (both on AMD64). Also tested on SBCL on Windows (on AMD64).

Benchmarks

:len=1, :length=1

ros -Q benchmarks.ros

These (naive) benchmarks, using :trivial-benchmarks, show that :len=1 and :length=1 are significantly faster than (lambda (x) (= 1 (length x))) on CCL, ECL, and ABCL for (long) lists. There is little (or no) advantage to using :length=1 in other circumstances.

:length=1 and :len=1 are not faster for long lists in SBCL, likely because SBCL optimizes calls to length or otherwise caches results.

License

Released under the MIT-0 License, (c) Jin-Ho King 2021.

About

Utilities for writing Common Lisp code

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors