On this page:
1.1 Delimiters
1.2 Expressions
1.3 Data Literals
1.4 Lambdas
lambda
λ
1.5 Sequencing
do
~>

1 Basic Syntax🔗

1.1 Delimiters🔗

(...) and [...] are generally interchangeable in the core syntax (like in Racket). They have different meanings when used in expressions, as described below.

1.2 Expressions🔗

(...) is ordinary function application.

[...] is an unquoted list.

1.3 Data Literals🔗

All of these literals are unquoted, meaning that the arguments are evaluated prior to construction of the datatype.

[...] is a list.

#(...) is an immutable vector (the delimiters here could also be #[]).

#{...} is a set.

{...} is a hash.

(...) is a Qi flow.

1.4 Lambdas🔗

syntax

(lambda args body ...)

syntax

(λ args body ...)

syntax

(lambda [args body ...] ...)

syntax

(λ [args body ...] ...)

Identical to either Racket’s lambda or case-lambda, depending on the syntax used.

(λ (a) (+ a a))
(λ [(a) (+ a a)]
   [(a b) (+ a b)]
   [args (apply + args)])

Lambdas power Raqit’s fun but should rarely be used directly — favor using Qi flows via (), instead.

1.5 Sequencing🔗

syntax

(do e ...)

Identical to Racket’s begin.

(do
  (def x 10)
  x)

syntax

(~> (arg ...) e ...)

Identical to Qi’s ~>.

(~> (3) sqr add1)