Skip to content

xavier268/mylisp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go Reference Go Report Card

mylisp

My lisp interpreter in Go. Inspired by scheme syntax. See :

Examples

Examples lisp/scheme files are in the examples folder.

You can run an example directly from the command line with :

go run . -l "examples/counter.scm"

Builtins and help

You can list the available keywords built-in with * (keywords )*.

You can display help on one or more keywoards ( kw1, kw2 ...) by evaluationg ( help kw1 kw2 )

Non standard keywords :

New keywords :

  • ( debug value ) sets the debug/trace level
  • ( join-path p1 p2 ... ) constructs a path from path components, using system file separator
  • ( load fullPathName ) loads and evaluate a file
  • ( file-sep ) retuns the system file separator
  • ( version ) gets the current version of the interpreter
  • ( help keyword ) : display online help for keyword

Extended behaviour vs standard :

  • ( display x1 x2 ... ) : display can display zero, one or more Terms.

Numbers

  • Numbers are integer or rationnal.
  • The decimal point is not accepted.
  • Rational are written 8/3. ( no space ! )
  • Rational are immutable and always normalized, with a positive denominator.
  • Zero is 0/1, while 1/0 represents NaN.

Strings

  • string litterlas are quoted with double quotes (")
  • there is no escaping, string litteral may contain newline directly

Errors

Error is a specific type that can be returned from evaluation.

About

My lisp interpreter in Go.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published