Skip to content

Becojo/plsp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

plsp

Lisp for Python

Install

git clone https://github.com/becojo/plsp
cd plsp
python setup.py install

Usage

Execute

plsp file.plsp

Compile

Plsp compiles to Python bytecode. To send the output to a file, use the --output argument.

plsp --output file.pyc file.plsp

You can then run it directly using Python

python file.pyc

Or import it a Python script

>>> import file

Hello World Module

(defn main []
  (print "Hello World!"))

(ife (== __name__ "__main__")
     (main)
     None)

Syntax

Plsp Python
List
[1 2 3]
[1, 2, 3]
Dict
{'a' 1 'b' 2 'c' 3}
{'a': 1, 'b': 2, 'c': 3}
Lambda
(fn [x] (== x 5)
lambda x: x == 5
If
(ife (== password "admin123") 
     (print "Hello admin") 
     (print "Nope"))
if password == "admin123":
    print 'Hello admin'
else:
    print 'Nope'
Function
(defn hello [name]
  (print (add "hello " name)))
def hello(name):
    print 'hello ' + name

About

A Lisp that compiles into Python bytecode

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages