Skip to content

Latest commit

 

History

History
47 lines (39 loc) · 1.12 KB

README.org

File metadata and controls

47 lines (39 loc) · 1.12 KB

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’ LOOP macro using 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.