Skip to content

Latest commit

 

History

History

reference

Otus Lisp

Otus Lisp (Ol in short) is a purely functional dialect of Lisp.

Ol implements an extended subset of the R7RS Scheme (PDF), including but not limited to some SRFIs. It's tiny (~ 64KB), embeddable, and cross-platform; provides a portable, high level interface to call code written in another language (c, python, lua, etc).

Reference

This is an Ol reference, not a Scheme. Scheme R7RS differences described in the DIFFERENCES file.

Examples are provided in two forms:

  1. in the equivalence (in sense of equal?) form using symbols "==>" and "===",
(+ 1 2 3)  ==>  6
[1 2 3 4]  ===  (make-vector '(1 2 3 4))
  1. in the interactive form using prompt symbol "> ", which shows the behavior as if someone were typing code in an interactive ol session.
> #i1.2
1.199999999

> (let ((N 10000))
      (define (sign n)
         (if (even? n) + -))
      (fold (lambda (f x i)
               ((sign i) f (/ #i4 x)))
         #i4
         (iota N 3 2)
         (iota N 1)))
3.14169264

All provided examples are tested with the Ol's latest build each time the code is submitted to GitHub.

List of Standard procedures

Alphabetic Index of Definitions of Concepts, Keywords, and Procedures

! # A B C D E
F G H I J K L
M N O P Q R S
T U V W X Y Z

!

= < <= > >= + - * / \\

#

#null #u8()

A

abs actor actor-linked alist->ff append assq assv assoc async async-linked await await-linked

B

bytevector bytevector-append bytevector-copy bytevector-copy! bytevector-length bytevector-u8-ref bytevector-u8-set! boolean? boolean=?

C

c/../ car cdr caar cadr cdar cddr caaar caadr cadar caddr cdaar cdadr cddar cdddr caaaar caaadr caadar caaddr cadaar cadadr caddar cadddr cdaaar cdaadr cdadar cdaddr cddaar cddadr cdddar cddddr ceiling char? char->integer check-mail complex? cons cons*

D

decode2 define-instant-macro define-lazy-macro define-macro define-syntax del denominator deserialize digit-value drop

E

eighth encode2 eq? eqv? equal? even? exact?

F

fasl-decode fasl-encode ff->alist ff->list ff->pairs ff-diff ff-fold ff-foldr ff-map ff-for-each ff-replace ff-union fifth finite? first floor fold foldr fourth

G

g/../ get getf

H

I

inexact? infinite? infix-notation integer? integer->char isort iota

J

K

keys

L

length list list? list->ff list->vector list-copy list-ref (lref) list-set! list-tail lrange

M

m/../ mail make-ff make-list make-bytevector make-vector map max memq memv member mergesort min modulo

N

nan? natural? negative? ninth not null? number? numerator

O

odd?

P

pair? pairs->ff positive? put put!

Q

quicksort quotient

R

rational? rationalize real? remainder repeat reverse round

S

s/../ second set-car! set-cdr! seventh serialize sixth sleep sort square sqrt string->regex string->symbol string->uninterned-symbol string->utf8 string->vector symbol? symbol=? symbol->string

T

take tenth third truncate

U

utf8->string

V

vector vector? vector->list vector->string vector-append vector-copy vector-copy! vector-fill! vector-length vector-ref vector-set!

W

wait-mail

X

Y

Z

zero?