Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/idorobots/cl-goodies

A heretical attempt at bringing some of the Lisp goodies to D. Greenspun's tenth rule included!
https://github.com/idorobots/cl-goodies

algorithms common-lisp d

Last synced: 3 days ago
JSON representation

A heretical attempt at bringing some of the Lisp goodies to D. Greenspun's tenth rule included!

Awesome Lists containing this project

README

        

* CL goodies
My heretical fun with D's CTFE...

How to get CL goodies:

: $ git clone https://github.com/Idorobots/cl-goodies cl-goodies
: $ cd cl-goodies
: $ git submodule init
: $ git submodule update
: $ make

Contents:

** cl.loop
An implementation of Common Lisp' [[http://www.gigamonkeys.com/book/loop-for-black-belts.html][LOOP macro]] using [[https://github.com/PhilippeSigaud/Pegged][Pegged]].
Example usage:

: import std.stdio;
: import cl.loop;
:
: void main(string[] args) {
: mixin(Loop!q{
: for arg in args
: print "Hello ", arg, "!"
: });
:
: auto result = mixin(Loope!q{
: for i from 0 to 50
: when $$ i & 1 $$
: collect i
: });
: writeln(result);
: }

Prints:
: $ ./loop Common Lisp
: Hello ./loop!
: Hello Common!
: Hello Lisp!
: [1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49]

** cl.quote
A stub of Lisp-eque quasiquote. WIP

** Stuff possibly comming in the future:
- *cl.format* - an implementation of Common Lisp' FORMAT macro.
- *cl.html* - a bunch of classic convinience macros for outputting HTML.