⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 non-standard-read-syntax.html

📁 Scheme跨平台编译器
💻 HTML
字号:
<html><head><title>CHICKEN User's Manual - Non-standard read syntax</title></head><body><a name="non-standard-read-syntax"></a><h1>Non-standard read syntax</h1><a name="multiline-block-comment"></a><h2>Multiline Block Comment</h2><pre>#| ... |# </pre><p>A multiline <em>block</em> comment. May be nested. Implements <a href="http://srfi.schemers.org/srfi-30/srfi-30.html" class="external">SRFI-30</a></p><a name="expression-comment"></a><h2>Expression Comment</h2><pre>#;EXPRESSION</pre><p>Treats <tt>EXPRESSION</tt> as a comment.  That is, the comment runs through the whole S-expression, regardless of newlines, which saves you from having to comment out every line, or add a newline in the middle of your parens to make the commenting of the last line work, or other things like that.</p><a name="external-representation"></a><h2>External Representation</h2><pre>#,(CONSTRUCTORNAME DATUM ...)</pre><p>Allows user-defined extension of external representations. (For more information see the documentation for <a href="http://srfi.schemers.org/srfi-10/srfi-10.html" class="external">SRFI-10</a>)</p><a name="syntax-expression"></a><h2>Syntax Expression</h2><pre>#'EXPRESSION</pre><p>An abbreviation for <tt>(syntax EXPRESSION)</tt>.</p><a name="location-expression"></a><h2>Location Expression</h2><pre>#$EXPRESSION</pre><p>An abbreviation for <tt>(location EXPRESSION)</tt>.</p><a name="keyword"></a><h2>Keyword</h2><pre>#:SYMBOL</pre><p>Syntax for keywords. Keywords are symbols that evaluate to themselves, and as such don't have to be quoted.</p><a name="multiline-string-constant"></a><h2>Multiline String Constant</h2><pre>#&lt;&lt;TAG</pre><p>Specifies a multiline string constant. Anything up to a line equal to <tt>TAG</tt> (or end of file) will be returned as a single string:</p><pre>(define msg #&lt;&lt;END "Hello, world!", she said.END)</pre><p>is equivalent to</p><pre>(define msg "\"Hello, world!\", she said.")</pre><a name="multiline-string-constant-with-embedded-expressions"></a><h2>Multiline String Constant with Embedded Expressions</h2><pre>#&lt;#TAG</pre><p>Similar to <tt>#&lt;&lt;</tt>, but allows substitution of embedded Scheme expressions prefixed with <tt>#</tt> and optionally enclosed in curly brackets. Two consecutive <tt>#</tt>s are translated to a single <tt>#</tt>:</p><pre>(define three 3)(display #&lt;#EOFThis is a simple string with an embedded `##' characterand substituted expressions: (+ three 99) ==&gt; #(+ three 99)(three is "#{three}")EOF)</pre><p>prints</p><pre>This is a simple string with an embedded `#' characterand substituted expressions: (+ three 99) ==&gt; 102(three is "3")</pre><a name="foreign-declare"></a><h2>Foreign Declare</h2><pre>#&gt; ... &lt;#</pre><p>Abbreviation for <tt>foreign-declare " ... ")</tt>.</p><a name="sharp-prefixed-symbol"></a><h2>Sharp Prefixed Symbol</h2><pre>#%... </pre><p>Reads like a normal symbol.</p><a name="bang"></a><h2>Bang</h2><pre>#!... </pre><p>Interpretation depends on the directly following characters. Only the following are recognized. Any other case results in a read error.</p><a name="line-comment"></a><h3>Line Comment</h3><ul><li>If followed by whitespace or a slash, then everything up the end of the current line is ignored</li></ul><a name="eof-object"></a><h3>Eof Object</h3><ul><li>If followed by the character sequence <tt>eof</tt>, then the (self-evaluating) end-of-file object is returned</li></ul><a name="dsssl-formal-parameter-list-annotation"></a><h3>DSSSL Formal Parameter List Annotation</h3><ul><li>If followed by any of the character sequences <tt>optional</tt>, <tt>rest</tt> or <tt>key</tt>, then a symbol with the same name (and prefixed with <tt>#!</tt>) is returned</li></ul><a name="read-mark-invocation"></a><h3>Read Mark Invocation</h3><ul><li>If a <em>read mark</em> with the same name as the token is registered, then its procedure is called and the result of the read-mark procedure will be returned</li></ul><a name="case-sensitive-expression"></a><h2>Case Sensitive Expression</h2><pre>#cs...</pre><p>Read the next expression in case-sensitive mode (regardless of the current global setting).</p><a name="case-insensitive-expression"></a><h2>Case Insensitive Expression</h2><pre>#ci...</pre><p>Read the next expression in case-insensitive mode (regardless of the current global setting).</p><a name="conditional-expansion"></a><h2>Conditional Expansion</h2><pre>#+FEATURE EXPR</pre><p>Equivalent to </p><pre>(cond-expand (FEATURE EXPR) (else))</pre><p>Previous: <a href="extensions-to-the-standard.html" class="internal">Extensions to the standard</a></p><p>Next: <a href="non-standard-macros-and-special-forms.html" class="internal">Non-standard macros and special forms</a></p></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -