109 lines
5.4 KiB
HTML
109 lines
5.4 KiB
HTML
|
<!DOCTYPE html>
|
||
|
<html>
|
||
|
<!-- Created by GNU Texinfo 7.1, https://www.gnu.org/software/texinfo/ -->
|
||
|
<head>
|
||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||
|
<!-- This manual documents Guile version 3.0.10.
|
||
|
|
||
|
Copyright (C) 1996-1997, 2000-2005, 2009-2023 Free Software Foundation,
|
||
|
Inc.
|
||
|
|
||
|
Copyright (C) 2021 Maxime Devos
|
||
|
|
||
|
Copyright (C) 2024 Tomas Volf
|
||
|
|
||
|
|
||
|
Permission is granted to copy, distribute and/or modify this document
|
||
|
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||
|
any later version published by the Free Software Foundation; with no
|
||
|
Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A
|
||
|
copy of the license is included in the section entitled "GNU Free
|
||
|
Documentation License." -->
|
||
|
<title>Syntax Summary (Guile Reference Manual)</title>
|
||
|
|
||
|
<meta name="description" content="Syntax Summary (Guile Reference Manual)">
|
||
|
<meta name="keywords" content="Syntax Summary (Guile Reference Manual)">
|
||
|
<meta name="resource-type" content="document">
|
||
|
<meta name="distribution" content="global">
|
||
|
<meta name="Generator" content=".texi2any-real">
|
||
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||
|
|
||
|
<link href="index.html" rel="start" title="Top">
|
||
|
<link href="Concept-Index.html" rel="index" title="Concept Index">
|
||
|
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
|
||
|
<link href="About-Expressions.html" rel="up" title="About Expressions">
|
||
|
<link href="The-REPL.html" rel="prev" title="The REPL">
|
||
|
<style type="text/css">
|
||
|
<!--
|
||
|
a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em}
|
||
|
span:hover a.copiable-link {visibility: visible}
|
||
|
-->
|
||
|
</style>
|
||
|
<link rel="stylesheet" type="text/css" href="https://www.gnu.org/software/gnulib/manual.css">
|
||
|
|
||
|
|
||
|
</head>
|
||
|
|
||
|
<body lang="en">
|
||
|
<div class="subsection-level-extent" id="Syntax-Summary">
|
||
|
<div class="nav-panel">
|
||
|
<p>
|
||
|
Previous: <a href="The-REPL.html" accesskey="p" rel="prev">Using the Guile REPL</a>, Up: <a href="About-Expressions.html" accesskey="u" rel="up">Expressions and Evaluation</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html" title="Index" rel="index">Index</a>]</p>
|
||
|
</div>
|
||
|
<hr>
|
||
|
<h4 class="subsection" id="Summary-of-Common-Syntax"><span>3.3.4 Summary of Common Syntax<a class="copiable-link" href="#Summary-of-Common-Syntax"> ¶</a></span></h4>
|
||
|
|
||
|
<p>This subsection lists the most commonly used Scheme syntactic
|
||
|
expressions, simply so that you will recognize common special syntax
|
||
|
when you see it. For a full description of each of these syntaxes,
|
||
|
follow the appropriate reference.
|
||
|
</p>
|
||
|
<p><code class="code">lambda</code> (see <a class="pxref" href="Lambda.html">Lambda: Basic Procedure Creation</a>) is used to construct procedure objects.
|
||
|
</p>
|
||
|
<p><code class="code">define</code> (see <a class="pxref" href="Top-Level.html">Top Level Variable Definitions</a>) is used to create a new variable and
|
||
|
set its initial value.
|
||
|
</p>
|
||
|
<p><code class="code">set!</code> (see <a class="pxref" href="Top-Level.html">Top Level Variable Definitions</a>) is used to modify an existing variable’s
|
||
|
value.
|
||
|
</p>
|
||
|
<p><code class="code">let</code>, <code class="code">let*</code> and <code class="code">letrec</code> (see <a class="pxref" href="Local-Bindings.html">Local Variable Bindings</a>)
|
||
|
create an inner lexical environment for the evaluation of a sequence of
|
||
|
expressions, in which a specified set of local variables is bound to the
|
||
|
values of a corresponding set of expressions. For an introduction to
|
||
|
environments, see See <a class="xref" href="About-Closure.html">The Concept of Closure</a>.
|
||
|
</p>
|
||
|
<p><code class="code">begin</code> (see <a class="pxref" href="begin.html">Sequencing and Splicing</a>) executes a sequence of expressions in order
|
||
|
and returns the value of the last expression. Note that this is not the
|
||
|
same as a procedure which returns its last argument, because the
|
||
|
evaluation of a procedure invocation expression does not guarantee to
|
||
|
evaluate the arguments in order.
|
||
|
</p>
|
||
|
<p><code class="code">if</code> and <code class="code">cond</code> (see <a class="pxref" href="Conditionals.html">Simple Conditional Evaluation</a>) provide conditional
|
||
|
evaluation of argument expressions depending on whether one or more
|
||
|
conditions evaluate to “true” or “false”.
|
||
|
</p>
|
||
|
<p><code class="code">case</code> (see <a class="pxref" href="Conditionals.html">Simple Conditional Evaluation</a>) provides conditional evaluation of
|
||
|
argument expressions depending on whether a variable has one of a
|
||
|
specified group of values.
|
||
|
</p>
|
||
|
<p><code class="code">and</code> (see <a class="pxref" href="and-or.html">Conditional Evaluation of a Sequence of Expressions</a>) executes a sequence of expressions in order
|
||
|
until either there are no expressions left, or one of them evaluates to
|
||
|
“false”.
|
||
|
</p>
|
||
|
<p><code class="code">or</code> (see <a class="pxref" href="and-or.html">Conditional Evaluation of a Sequence of Expressions</a>) executes a sequence of expressions in order
|
||
|
until either there are no expressions left, or one of them evaluates to
|
||
|
“true”.
|
||
|
</p>
|
||
|
|
||
|
</div>
|
||
|
<hr>
|
||
|
<div class="nav-panel">
|
||
|
<p>
|
||
|
Previous: <a href="The-REPL.html">Using the Guile REPL</a>, Up: <a href="About-Expressions.html">Expressions and Evaluation</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html" title="Index" rel="index">Index</a>]</p>
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
</body>
|
||
|
</html>
|