/goclisp

common lisp interpreter

Primary LanguageGoMIT LicenseMIT

goclisp

.github/workflows/ci.yaml

Common Lisp interpreter written in go.

how to use

$ go run ./cmd/goclisp/main.go

samples

$ (+ 1 2) // add
$ (- 1 2) // sub
$ (* 1 2) // mul
$ (/ 1 2) // div
$ (= 1 2) // ==
$ (/= 1 2) // !=
$ (< 1 1) // less than
$ (<= 1 2) // less than or equal
$ (> 1 2) // greater than
$ (>= 1 2) // greater than or equal

$ (format t "hello") -> "hello"
$ (format t "~A, world" "hello" ) -> "hello, world"

$ (setq a 1)
$ a -> 1

$ (defun plus (x y) "func-description" (+ x y))
$ (plus 1 2) -> 3

$ (if (= 3 3) (format t "true!") (format t "false!"))
-> true!

features

  • add
  • sub
  • mul
  • div
  • eq
  • ne
  • lt
  • le
  • gt
  • ge
  • format
  • setq
  • defun
  • if