dev-master
9999999-devPHp Interpreted Lisp
MIT
The Development Requires
by Steven Ellis
Wallogit.com
2017 © Pedro Peláez
PHp Interpreted Lisp
PHp Interpreted Lisp., (*2)
Phil is a LISP dialect loosely based on the syntax used by Clojure., (*3)
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)
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
PHp Interpreted Lisp
MIT