30 lines
766 B
Text
30 lines
766 B
Text
|
|
(meta (title "Bjolang")
|
||
|
|
(listing? #f))
|
||
|
|
|
||
|
|
@div["logo"]{@image["/_resources/logo.svg" #:alt "Bjolang"]}
|
||
|
|
|
||
|
|
Bjolang is a Lisp for .NET. It has types that are inferred, unions that are
|
||
|
|
matched exhaustively, traits, hygienic macros, and bjoroutines, and it
|
||
|
|
compiles to C#.
|
||
|
|
|
||
|
|
@codeblock[#:lang "bjolang"]|{
|
||
|
|
(import (std prelude))
|
||
|
|
|
||
|
|
(type (: Shape (Union (: Circle double)
|
||
|
|
(: Rect double double))))
|
||
|
|
|
||
|
|
(: area (-> Shape double))
|
||
|
|
(defun (area shape)
|
||
|
|
(match shape
|
||
|
|
((Circle r) (* 3.14159 (* r r)))
|
||
|
|
((Rect w h) (* w h))))
|
||
|
|
|
||
|
|
(defun (main args)
|
||
|
|
(loop (:for s [(Circle 1.0) (Rect 2.0 3.0)])
|
||
|
|
(:do (println #"area: ${(area s)}")))
|
||
|
|
0)
|
||
|
|
}|
|
||
|
|
|
||
|
|
@link["manual/"]{Read the manual}, or go straight to the
|
||
|
|
@link["manual/modules/"]{library reference}.
|