「48時間でSchemeを書こう/構文解析」の版間の差分

削除された内容 追加された内容
ページ分けによる記事の移動
 
M 練習問題に通し番号を振る
223 行
</syntaxhighlight>
 
練習問題2
# 以下の手法を使って<code>parseNumber</code>を書き直しなさい。
## do記法
295 行
Note that by referring to parseExpr within our parsers, we can nest them arbitrarily deep. Thus, we get a full Lisp reader with only a few definitions. That's the power of recursion.
 
練習問題3
# Add support for the [http://www.schemers.org/Documents/Standards/R5RS/HTML/r5rs-Z-H-7.html#%_sec_4.2.6 backquote] syntactic sugar: the Scheme standard details what it should expand into (quasiquote/unquote).
# Add support for [http://www.schemers.org/Documents/Standards/R5RS/HTML/r5rs-Z-H-9.html#%_sec_6.3.6 vectors]. The Haskell representation is up to you: GHC does have an [http://www.haskell.org/ghc/docs/latest/html/libraries/array-0.3.0.0/Data-Array.html Array] data type, but it can be difficult to use. Strictly speaking, a vector should have constant-time indexing and updating, but destructive update in a purely functional language is difficult. You may have a better idea how to do this after the section on set!, later in this tutorial.