Module Lisp
In: lib/facet/lisp-format.rb
lib/facet/lisp.rb

Description

This module provides Lisp-like functional notation. With this module it almost possibel to write real Lisp code in Ruby.

Usage

It’s hardly believable, but the following IS valid ruby code:

  (def accumulate (fun, x, list)
    (if (null? list)
      x
    else
      (accumulate fun, (fun.call x, (car list)), (cdr list))
    end)
  end)

A real programmer can write LISP in any language… ;)

Author(s)

  • Florian Frank
  • Thomas Sawyer

Methods

accumulate   all?   append   assoc   atom?   car   cdr   cons   consonto   drop   equal?   exists?   explode   filter   foldleft   foldright   format   implode   length   link   list   map   member?   null?   pair!   pair?   pairlis   prod   reduce   reverse   set   set_car!   set_cdr!   sum   take   zip  

Classes and Modules

Module Lisp::Format
Class Lisp::DottedPair

Constants

VERSION = '1.1.0'

Public Class methods

Public Instance methods

Functional API

foldleft(fun, x, list)

Alias for accumulate

foldright(fun, x, list)

Alias for reduce

[Validate]