Golisp Save

Lisp Interpreter

Project README

golisp

CI

Lisp Interpreter

Usage

$ golisp < foo.lisp

Installation

$ go get github.com/mattn/golisp/cmd/golisp

Features

Call Go functions.

Print random ints.

(setq time (go:import 'time))
(setq rand (go:import 'math/rand))
(.Seed rand (.UnixNano (.Now time)))
(print (.Int rand))

Use goroutine/channel

(setq time (go:import time))
(let ((ch (go:make-chan string 1)))
  (go
    (.Sleep time 1e9)
    (go:chan-send ch "3")
    (.Sleep time 1e9)
    (go:chan-send ch "2")
    (.Sleep time 1e9)
    (go:chan-send ch "1")
    (.Sleep time 1e9)
    (go:chan-send ch "Fire!")
  )
  (print (car (go:chan-recv ch)))
  (print (car (go:chan-recv ch)))
  (print (car (go:chan-recv ch)))
  (print (car (go:chan-recv ch)))
)

TODO

  • macro

License

MIT

Author

Yasuhiro Matsumoto (a.k.a. mattn)

Open Source Agenda is not affiliated with "Golisp" Project. README Source: mattn/golisp
Stars
121
Open Issues
0
Last Commit
1 month ago
Repository
License
MIT

Open Source Agenda Badge

Open Source Agenda Rating