# README
Xlisp
Simple lisp written in go using Sabre. Xlisp is a DSL for tview library.
Usage
xlisp
for REPLxlisp -e "(+ 1 2 3)"
for executing stringxlisp sample.lisp
for executing file.
Documentation
Xlisp is highly inspired by Clojure with their syntax and semantics but it's implemented in Go programming language. Some of the functions from clojure have been implemented in xlisp.
Example
First you have to compile the xlisp.
$ make
Then, you can run this example using bin/xlisp example/sample.lisp
(def app (tview/new-app))
(def text-view (tview/new-textview))
(def sample-text "Leverage agile frameworks to provide a robust synopsis for high level overviews. Iterative approaches to corporate strategy foster collaborative thinking to further the overall value proposition. Organically grow the holistic world view of disruptive innovation via workplace diversity and empowerment.
Bring to the table win-win survival strategies to ensure proactive domination. At the end of the day, going forward, a new normal that has evolved from generation X is on the runway heading towards a streamlined cloud solution. User generated content in real-time will have multiple touchpoints for offshoring.
Capitalize on low hanging fruit to identify a ballpark value added activity to beta test. Override the digital divide with additional clickthroughs from DevOps. Nanotechnology immersion along the information highway will close the loop on focusing solely on the bottom line")
(text-view.SetWordWrap true)
(text-view.SetBorder true)
(text-view.SetTitle "This is just an example")
(text-view.SetText sample-text)
(app.SetRoot text-view true)
; main loop
(app.Run)
Then it will fill up your terminal with box and texts. You can ctrl + c
to cancel
the application.
# Packages
No description provided by the author
# Functions
Add adds given floating point numbers and returns the sum.
No description provided by the author
No description provided by the author
BindAll binds all core functions into the given scope.
Case implements the switch case construct.
Divide returns the product of given numbers.
Gt returns true if the given args are monotonically decreasing.
GtE returns true if the given args are monotonically decreasing or all equal.
Implements checks if given value implements the interface represented by 't'.
TODO wrap all functions in tview library that requires callback.
Lt returns true if the given args are monotonically increasing.
LtE returns true if the given args are monotonically increasing or are all equal.
MacroExpand is a wrapper around the sabre MacroExpand function that ignores the expanded bool flag.
MakeString returns stringified version of all args.
Multiply multiplies the given args to 1 and returns the result.
returns new xlisp instance.
Printf is an alias for fmt.Printf which ignores the return values.
Println is an alias for fmt.Println which ignores the return values.
No description provided by the author
Reads from stdin and returns string.
No description provided by the author
Realize realizes a sequence by continuously calling First() and Next() until the sequence becomes nil.
No description provided by the author
Sub subtracts args from 'x' and returns the final result.
ThreadFirst threads the expressions through forms by inserting result of eval as first argument to next expr.
ThreadLast threads the expressions through forms by inserting result of eval as last argument to next expr.
Throw converts args to strings and returns an error with all the strings joined.
ToType attempts to convert given sabre value to target type.
TypeOf returns the type information object for the given argument.
# Interfaces
No description provided by the author