Language
Reads Lisp-style S-expressions and adds bracket syntax for message sends such as [object selector: value].
An experimental Lisp-family language and virtual machine written in C, with Scheme-like forms, Smalltalk-style message sends, classes, macros, modules, conditions, restarts, and an embedding API.
(define-class Point (Object) (x y))
(define-constructor [Point newX: x y: y]
(set! .x x)
(set! .y y)
self)
(define-method [Point magnitude]
(sqrt (+ (* .x .x) (* .y .y))))
Reads Lisp-style S-expressions and adds bracket syntax for message sends such as [object selector: value].
Includes native classes for objects, packages, lists, vectors, numbers, streams, weak references, conditions, restarts, and date/time values.
Builds listtalk for the REPL and scripts, plus libListTalkVM for C applications and native modules.
ListTalk starts with Scheme/CL-style forms, then adds compact message-send, closure, and slot-access notation.
(define (square x)
(* x x))
(square 12)
[object selector]
; expands to
(send object :selector)
[object at: key put: value]
; expands to
(send object :at:put: key value)
(define-method [Point moveX: dx y: dy]
(set! .x (+ .x dx))
(set! .y (+ .y dy))
self)
{foo}
; expands to
(lambda () foo)
{arg (+ arg 1)}
; expands to
(lambda (arg) (+ arg 1))
(lambda (x y :optional scale :rest more)
(list x y scale more))
(lambda (path :key mode)
[path openWithMode: mode])
:ready
ListTalk:command-line
http://example.org/ns:name
ListTalk uses Meson and Ninja. The implementation is under active development, so treat the language and C API as unstable.
git clone https://github.com/ListTalk/ListTalk.git
cd ListTalk
meson setup build
meson compile -C build
meson test -C build
./build/listtalk