-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
32 lines (32 loc) · 5.16 KB
/
index.html
File metadata and controls
32 lines (32 loc) · 5.16 KB
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
<!DOCTYPE html>
<html>
<head>
<!-- SPDX-FileCopyrightText: 2026 Arthur A. Gleckler -->
<!-- SPDX-License-Identifier: MIT -->
<title>Curly-infix-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 105: Curly-infix-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> (2012-11-06)</p>
<p class="keywords">keywords: <a href="https://srfi.schemers.org/?keywords=reader-syntax">Reader Syntax</a></p><span class="see-also">See also <a href="/srfi-266/">SRFI 266: The expr syntax</a>.</span>
<ul class="info">
<li><a href="srfi-105.html">The SRFI Document</a></li>
<li><a href="https://srfi-email.schemers.org/srfi-105/">Discussion Archive</a></li>
<li><a href="https://github.com/scheme-requests-for-implementation/srfi-105">Git repo (on GitHub)</a></li>
<li><a href="mailto:srfi-105@srfi.schemers.org">srfi-105@<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-105 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-105"><input type="hidden" name="action" value="subscribe"><input type="hidden" name="list" value="srfi-105@srfi.schemers.org"></form></span></li>
<li><span class="firefox-column-workaround">
<form method="POST" action="https://www.simplelists.com/subscribe.php">
<div class="title">Unsubscribe from srfi-105 mailing list</div><input name="email" placeholder="email address" tabindex="5" type="email"><input class="submit" name="submit" tabindex="6" type="submit" value="Unsubscribe from srfi-105"><input type="hidden" name="action" value="unsubscribe"><input name="list" type="hidden" value="srfi-105@srfi.schemers.org"></form></span></li></ul>
<h2>Abstract</h2> <p>Lisp-based languages, like Scheme, are almost the only programming languages in modern use that do not support infix notation. In addition, most languages allow infix expressions to be combined with function call notation of the form <code><var>f</var>(<var>x</var>)</code>. This SRFI provides these capabilities, both for developers who already use Scheme and want these conveniences, and also for other developers who may choose to use other languages in part because they miss these conveniences. Scheme currently reserves <code>{</code>...<code>}</code> “for possible future extensions to the language”. We propose that <code>{</code>...<code>}</code> be used to support “curly-infix-expression” notation as a homoiconic infix abbreviation, as a modification of the Scheme reader. It is an abbreviation in much the same way that <samp>'x</samp> is an abbreviation for <samp>(quote x)</samp>. <p>A <dfn>curly-infix list</dfn> introduces a list whose visual presentation can be in infix order instead of prefix order. For example, <samp>{n > 5}</samp> ⇒ <samp>(> n 5)</samp>, and <samp>{a + b + c}</samp> ⇒ <samp>(+ a b c)</samp>. By intent, there is no precedence, but e.g., <samp>{x + {y * z}}</samp> maps cleanly to <samp>(+ x (* y z))</samp>. Forms with mixed infix operators and other complications have “<code>$nfx$</code>” prepended to enable later processing, e.g., <samp>{4 + 5 * 6}</samp> ⇒ <samp>($nfx$ 4 + 5 * 6)</samp>. Also, inside a curly-infix list (recursively), expressions of the form <code><var>f</var>(</code>...<code>)</code> are simply an abbreviation for <code>(<var>f</var> </code>...<code>)</code>. <p>Note that this is derived from the “<a href="http://readable.sourceforge.net/">readable</a>” project. We intend to later submit at least one additional SRFI that will build on top of this SRFI, but curly-infix-expressions are useful on their own.</body></html>