Skip to content

Idorobots/cl-goodies

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages