2017 © Pedro Peláez
 

library phil

PHp Interpreted Lisp

image

pogotc/phil

PHp Interpreted Lisp

  • Tuesday, June 9, 2015
  • by pogotc
  • Repository
  • 2 Watchers
  • 0 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 3 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Phil

License Build Status Scrutinizer Code Quality, (*1)

PHp Interpreted Lisp., (*2)

Phil is a LISP dialect loosely based on the syntax used by Clojure., (*3)

Usage

Phil can either be invoked by running bin/phil or using ./phil.phar (coming soon). Running this will open the REPL where you can run simple commands. The binary also accepts a file path to run code contained in a script file., (*4)

Example Code

As with all LISP dialects the pattern is (functionname args), so to run a simple Hello World app you run:, (*5)

(println "Hello, World")

or to add a list of numbers together:, (*6)

(+ 1 2 3 4) ; returns 10

Functions can be declared using the defn keyword found in Clojure:, (*7)

(defn sayHello (name) (println (+ "Hello, " name)))

(sayHello "Bob") ; returns "Hello, Bob"

Recursive functions and conditionals are also supported allow for code such as:, (*8)

(defn length (xs)
    (if
        (= 0 (count xs))
        0
        (+ 1 (length (rest xs)))
    )
)

(length '(1 2 3 4 5)) ; returns 5

The Versions

09/06 2015

dev-master

9999999-dev

PHp Interpreted Lisp

  Sources   Download

MIT

The Development Requires

by Steven Ellis