Skip to content
This repository

Clojure-like Lisp on Rubinius

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 benchmarks
Octocat-spinner-32 bin
Octocat-spinner-32 examples
Octocat-spinner-32 kernel
Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .rspec
Octocat-spinner-32 .ruby-version
Octocat-spinner-32 .travis.yml
Octocat-spinner-32 Gemfile
Octocat-spinner-32 Gemfile.lock
Octocat-spinner-32 README.md
Octocat-spinner-32 Rakefile
Octocat-spinner-32 apricot.gemspec
README.md

Apricot Gem Version Build Status Dependency Status

A Clojure-like Lisp on Rubinius.

Try to contain your excitement, please.

Install

First of all, you're going to need Rubinius. If you're using RVM:

$ rvm install rbx
$ rvm use rbx
$ gem install apricot

The REPL

Apricot provides an awesome read-eval-print-loop with line editing, history, tab-completion, and some interesting commands like !bytecode. To enter the REPL just run apricot.

Once in the repl you can get help with !help or use (doc <name>) to see the documentation of any function or macro. Play around, read kernel/core.apr and try out our functions, and make some of your own. Experiment. Tell us what you think!

apr> (+ 1 2 3)
=> 6
apr> (map (fn [x] (* x x)) (Range. 1 10))
=> [1 4 9 16 25 36 49 64 81 100]
apr> (defn square [x] (* x x))
=> #<Proc:0x330@(eval):3 (lambda)>
apr> (map square (Range. 1 10))
=> [1 4 9 16 25 36 49 64 81 100]
apr> (map (comp str square) (Range. 1 10))
=> ["1" "4" "9" "16" "25" "36" "49" "64" "81" "100"]
apr> (doc comp)
-------------------------
comp
([] [f] [f g] [f g h] [f1 f2 f3 & fs])
  Take a set of functions and return a fn that is the composition of those
  fns. The returned fn takes a variable number of args, applies the rightmost
  of fns to the args, the next fn (right-to-left) to the result, etc.
=> nil

Hello World

So you want to put your program in a file and not type it into the REPL? Sure:

$ cat hello.apr
(println "Hello, world!")
$ apricot hello.apr
Hello, world!

Development

If you want to hack on Apricot, first install Rubinius as explained above. When you cd to the Apricot git repo, RVM should automatically switch to Rubinius thanks to the .ruby-version file. Now install and run Bundler:

$ gem install bundler
$ bundle

You're all set. Run the tests with rake and run the bleeding edge REPL with ruby -Ilib bin/apricot. Similarily, use irb -Ilib -rapricot for an IRB session with Apricot loaded.

Contact / Bug Reports

If you have any questions don't hesitate to email us or visit us in #apricot on freenode (we are curtism and scott). And we'd really appreciate it if you opened bug reports on the GitHub issue tracker!

License

Copyright (c) 2012-2013, Curtis McEnroe <programble@gmail.com>

Copyright (c) 2012-2013, Scott Olson <scott@scott-olson.org>

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

Something went wrong with that request. Please try again.