-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
125 lines (121 loc) · 5.51 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<!--
SPDX-FileCopyrightText: 2012 - 2013 Alan Manuel K. Gloria
SPDX-FileCopyrightText: 2012 - 2013 David A. Wheeler
SPDX-License-Identifier: MIT
-->
<!DOCTYPE html>
<html>
<head>
<title>Sweet-expressions (t-expressions)</title>
<link href="/admin.css" rel="stylesheet">
<link href="/list.css" rel="stylesheet">
<link href="/favicon.png" rel="icon" sizes="192x192" type="image/png">
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
});
</script>
<script crossorigin="anonymous" integrity=
"sha384-Ra6zh6uYMmH5ydwCqqMoykyf1T/+ZcnOQfFPhDrp2kI4OIxadnhsvvA2vv9A7xYv" src=
"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"
type="text/javascript"></script>
</head>
<body>
<h1>SRFI 110: Sweet-expressions (t-expressions)</h1>
<p class="authors">by David A. Wheeler and Alan Manuel K. Gloria</p>
<p class="based-on"></p>
<p class="status">status: <em>final</em> (2013-09-09)</p>
<p class="keywords">keywords: <a href="https://srfi.schemers.org/?keywords=reader-syntax">Reader Syntax</a></p>
<ul class="info">
<li><a href="srfi-110.html">The SRFI Document</a></li>
<li><a href="https://srfi-email.schemers.org/srfi-110/">Discussion Archive</a></li>
<li><a href="https://github.com/scheme-requests-for-implementation/srfi-110">Git repo (on Github)</a></li>
<li>
<a href="mailto:[email protected]">srfi-110@<span class="antispam">nospam</span>srfi.schemers.org (subscribers only)</a></li>
<li>
<span class="firefox-column-workaround">
<form method="POST" action="https://www.simplelists.com/subscribe.php">
<div class="title">Subscribe to srfi-110 mailing list</div>
<input name="email"
placeholder="email address"
tabindex="1"
type="email" >
<input name="name"
placeholder="full name"
tabindex="2"
type="text" >
<p>
<input id="sub-digest"
name="digest"
tabindex="3"
type="checkbox"
value="digest" >
<label for="sub-digest">daily digest?</label></p>
<input class="submit"
name="submit"
tabindex="4"
type="submit"
value="Subscribe to srfi-110" >
<input type="hidden" name="action" value="subscribe">
<input type="hidden" name="list" value="[email protected]"></form></a></li>
<li>
<span class="firefox-column-workaround">
<form method="POST" action="https://www.simplelists.com/subscribe.php">
<p class="title">Unsubscribe from srfi-110 mailing list</p>
<input name="email"
placeholder="email address"
tabindex="5"
type="email" >
<input class="submit"
name="submit"
tabindex="6"
type="submit"
value="Unsubscribe from srfi-110" >
<input name="action"
type="hidden"
value="unsubscribe" >
<input name="list"
type="hidden"
value="[email protected]"></form></a></li></ul>
<h2>Abstract</h2> <p>This SRFI describes a set of syntax extensions
for Scheme, called sweet-expressions (t-expressions), that has the same
descriptive power as s-expressions but is designed to be easier for
humans to read. The sweet-expression syntax enables the use of
syntactically-meaningful indentation to group expressions (similar to
Python), and it builds on the infix and traditional function notation
defined in <a href="https://srfi.schemers.org/srfi-105/">SRFI-105 (curly-infix-expressions)</a>.
Unlike nearly all past efforts to improve s-expression readability,
sweet-expressions are general (the notation is independent from any
underlying semantic) and homoiconic (the underlying data structure is
clear from the syntax). This notation was developed by the “<a href="http://readable.sourceforge.net/">Readable Lisp S-expressions
Project</a>” and can be used for both programs and data.
<p>Sweet-expressions can be considered a set of
additional abbreviations, just as <code>'x</code> already abbreviates
<code>(quote x)</code>. Sweet-expressions and traditionally formatted
s-expressions can be freely mixed; this provides backwards compatibility,
simplifies transition, and enables developers to maximize readability.
Here is an example of a sweet-expression and its equivalent s-expression
(note that a sweet-expression reader would accept <em>either</em>
format):
<table border="1" cellpadding="4">
<tr>
<th>sweet-expression
<th>s-expression
<tr>
<td>
<pre>
define fibfast(n) ; Typical function notation
if {n < 2} ; Indentation, infix {...}
n ; Single expr = no new list
fibup n 2 1 0 ; Simple function calls
</pre>
<td>
<pre>
(define (fibfast n)
(if (< n 2)
n
(fibup n 2 1 0)))
</pre>
</table></body></html>