الرئيسية / التوثيق

التوثيق

مرجع لما يقبله المفسّر اليوم. وحيث لم يُنفَّذ شيء بعد، يقول المرجع ذلك بدل حذفه.

اقرأ التوثيق الشيفرة المصدرية

هذا القسم لم يُترجم بعد إلى لغتك، وهو معروض بالإنجليزية. الترجمات مرحب بها.

القيم

TypeMeansWritten as
nilThe absence of a value, and the result of a branch with no alternative.nil
booleanTrue or false. Only false is falsey.#t #f
integerA signed 64-bit integer.42 -7
floatA double-precision number.3.14
runeA Unicode code point.\u00e9
stringAn immutable sequence of bytes, written as text."hello"
symbolAn interned name. Evaluating one looks it up.foo bar?
keywordAn interned name that evaluates to itself.:a
pairA cons cell: a value and the rest of the list.(1 2 3) '()
vectorAn immutable indexed sequence.[1 2 3]
tableAn immutable string-keyed map with sorted keys, so output is stable.{:a 1}
arrayA mutable indexed sequence.@[1 2 3]
closureA procedure and the environment it captured.(lambda (x) ...)
primitiveA built-in procedure implemented in V.+ car

هذا القسم لم يُترجم بعد إلى لغتك، وهو معروض بالإنجليزية. الترجمات مرحب بها.

الأصناف الأساسية

FormMeaningDesugars to
ifEvaluate the test, then one branch. With no alternative the result is nil.`if`
defineBind a name in the current frame. A list target defines a procedure.`define`
set!Assign to the frame that owns the binding, so a closure sees the change on its next call.`set!`
lambdaCreate a procedure. fn is a synonym.`lambda`, `fn`
beginEvaluate in order, return the last. The last form keeps its tail position, so tail calls inside a begin are still tail calls.`begin`
letBind names and evaluate the body in a new frame. let binds simultaneously, let* in order, letrec with every name visible to every value.`let`, `let*`, `letrec`
andShort-circuit. Return the first falsey value, or the last value.`and`, `or`
quoteReturn the form itself instead of evaluating it. The apostrophe is shorthand.`quote`

هذا القسم لم يُترجم بعد إلى لغتك، وهو معروض بالإنجليزية. الترجمات مرحب بها.

الأصناف المشتقة

FormMeaningDesugars to
whenRun the body only if the test is true, otherwise nil.`if`
unlessRun the body only if the test is false, otherwise nil.`if`
condTry clauses in order and take the first whose test is true. => separates test from body.nested `if`
caseCompare one value against a list of candidates per clause.`cond`
loopA named let: bind the variable, run the body while the test holds, and advance the variable each round.named `let`
dotimesloop with an implicit counter from zero.`loop`

هذا القسم لم يُترجم بعد إلى لغتك، وهو معروض بالإنجليزية. الترجمات مرحب بها.

في الصدق

Only #f is false. The number zero, the empty string, nil, and the empty list are all true. This matches R5RS and Clojure, and deliberately does not match Ruby, JavaScript, or Python.

The rule matters more than it looks. A language that treats 0 as falsey makes every numeric result a potential branch, which is why code in those languages needs explicit nil checks that vlip code does not.

هذا القسم لم يُترجم بعد إلى لغتك، وهو معروض بالإنجليزية. الترجمات مرحب بها.

الدوال البدائية

FormMeaningDesugars to
arithmeticWhole numbers, with promotion when a float is involved.`+` `-` `*` `/` `%`
comparisonReturn #t or #f.`=` `<` `>` `<=` `>=`
logicNegation. and and or are forms, not primitives, because they short-circuit.`not`
listsBuild and take apart cons cells.`car` `cdr` `cons` `list` `null?`
sequencesTake a procedure and a list, and return a new list.`map` `filter` `fold` `apply`
outputWrite to the machine's output buffer, not straight to a terminal, so a host can capture it.`print` `println`

هذا القسم لم يُترجم بعد إلى لغتك، وهو معروض بالإنجليزية. الترجمات مرحب بها.

لم يُنفَّذ بعد

let* and rest parameters are written in the examples and do not yet evaluate correctly. Callable keywords do not work either.

The cause of the let* failure is a real design question rather than a typo: [ ] is a vector literal in a value position and a binding group in a form position, and the reader does not yet record which reading applies. It is written up in the roadmap.