| 1 |
@node Library modules - Overview, Library modules - Gauche extensions, Object system, Top |
| 2 |
@chapter Library modules - Overview |
| 3 |
@c NODE ライブラリモジュール - 概要 |
| 4 |
|
| 5 |
@c EN |
| 6 |
In the following chapters, we explain library modules bundled with Gauche's |
| 7 |
distribution. |
| 8 |
These modules should generally be loaded and imported (usually using @code{use} |
| 9 |
- @xref{Using modules}, for details), unless otherwise noted. |
| 10 |
@c JP |
| 11 |
続くいくつかの章で、Gaucheのディストリビューションに含まれる |
| 12 |
ライブラリモジュールを解説します。 |
| 13 |
これらのモジュールを使うにあたっては、特に断りのない限り、 |
| 14 |
モジュールをロードしてimportすることが必要です |
| 15 |
(通常は@code{use}マクロが使えます。@ref{Using modules}参照)。 |
| 16 |
@c COMMON |
| 17 |
|
| 18 |
@c EN |
| 19 |
Some modules are described as "autoloaded". That means you don't need |
| 20 |
to @code{load} or @code{use} the module explicitly; at the first time |
| 21 |
the bindings are used in the program, the module is automatically |
| 22 |
loaded and imported. See @ref{Autoload}, for the details of autoloading. |
| 23 |
@c JP |
| 24 |
いくつかのモジュールは「オートロードされる」と表記されています。 |
| 25 |
この場合は、そのモジュールを使うにあたってあらかじめモジュールをロードしたり |
| 26 |
@code{use}しておく必要はありません。そのモジュールの束縛が使われた時点で、 |
| 27 |
モジュールが自動的にロードされインポートされます。オートロードの |
| 28 |
詳細については@ref{Autoload}を参照してください。 |
| 29 |
@c COMMON |
| 30 |
|
| 31 |
@c EN |
| 32 |
As the number of bundled libraries grows, it becomes harder |
| 33 |
to find the one you need. If you feel lost, check |
| 34 |
out the section @ref{Finding libraries you need}, in which |
| 35 |
we categorize libraries by their purposes. |
| 36 |
@c JP |
| 37 |
付属ライブラリの数が増えるにつれ、必要なライブラリを探すのが難しく |
| 38 |
なりつつあります。迷ったら、@ref{Finding libraries you need}を |
| 39 |
見てみて下さい。目的に合わせてライブラリをカテゴライズしています。 |
| 40 |
@c COMMON |
| 41 |
|
| 42 |
@c EN |
| 43 |
The following four chapters describe bundled modules, |
| 44 |
grouped by their names. |
| 45 |
|
| 46 |
@itemize |
| 47 |
@item |
| 48 |
@ref{Library modules - Gauche extensions} contains a description of |
| 49 |
@code{gauche.*} modules, which are more or less considered |
| 50 |
the core features of Gauche but separated since less frequently used. |
| 51 |
(Some modules are rather ad-hoc, but here for historical reasons). |
| 52 |
|
| 53 |
@item |
| 54 |
@ref{Library modules - R7RS standard libraries} explains how Gauche |
| 55 |
integrates R7RS into existing Gauche structures. If you want to |
| 56 |
write R7RS-compliant portable programs, you definitely want to |
| 57 |
check the first two sections of this chapter. What follows is |
| 58 |
the description of R7RS modules. The ``small'' part of R7RS |
| 59 |
has been frozen, but the ``large'' part--additional libraries--are |
| 60 |
still growing. |
| 61 |
|
| 62 |
@item |
| 63 |
@ref{Library modules - SRFIs} describes the modules which |
| 64 |
provide SRFI functionalities. They have the names beginning |
| 65 |
with @code{srfi.}. |
| 66 |
Note that some of SRFI features are built in Gauche core and |
| 67 |
not listed here. @xref{Standard conformance}, for the entire list |
| 68 |
of supported SRFIs. |
| 69 |
|
| 70 |
@item |
| 71 |
@ref{Library modules - Utilities} describes other modules |
| 72 |
---including database interface, filesystem utilities, |
| 73 |
network protocol utilities, and more. |
| 74 |
@end itemize |
| 75 |
|
| 76 |
@c JP |
| 77 |
この章に続く4つの章で、各ライブラリについて詳細に記述します。 |
| 78 |
各章は名前でグループ化されています。 |
| 79 |
|
| 80 |
@itemize |
| 81 |
@item |
| 82 |
@ref{Library modules - Gauche extensions}では@code{gauche.*}という |
| 83 |
名前を持つモジュールを説明します。これらはある意味Gaucheの基本的な |
| 84 |
機能なのですが、使われる頻度が少ないために別モジュールになったというものです。 |
| 85 |
(いくつかのモジュールはもっと付加的なものですが、歴史的理由からここにあります)。 |
| 86 |
|
| 87 |
@item |
| 88 |
@ref{Library modules - R7RS standard libraries}ではR7RSが既存のGaucheの |
| 89 |
構造にどのように統合されているかについて説明します。R7RS準拠のポータブルな |
| 90 |
プログラムを書く場合は、この章の最初の2節にはぜひ目を通してください。 |
| 91 |
その後には、R7RSで定義されているモジュールの説明が続きます。 |
| 92 |
R7RSの``small''と呼ばれる部分は既に制定されていますが、 |
| 93 |
``large''と呼ばれるライブラリは現在でも徐々に追加されています。 |
| 94 |
|
| 95 |
@item |
| 96 |
@ref{Library modules - SRFIs}ではSRFIの機能を提供するモジュールを |
| 97 |
扱います。@code{srfi.}で始まる名前を持ちます。 |
| 98 |
いくつかのSRFIについてはGaucheのコアに組み込みになっているため、 |
| 99 |
この章には現れないことに注意してください。サポートされているSRFIの |
| 100 |
完全なリストについては@ref{Standard conformance}を見て下さい。 |
| 101 |
|
| 102 |
@item |
| 103 |
@ref{Library modules - Utilities}では残りのモジュールに |
| 104 |
ついて説明します。データベースインタフェース、ファイルシステム、 |
| 105 |
ネットワークプロトコル、その他様々なライブラリがあります。 |
| 106 |
@end itemize |
| 107 |
@c COMMON |
| 108 |
|
| 109 |
@c EN |
| 110 |
There are a few procedures that help your program to check |
| 111 |
the existence of certain modules or libraries at run-time. |
| 112 |
See @ref{Operations on libraries}, for the details. |
| 113 |
@c JP |
| 114 |
実行時にプログラムが特定のモジュールやライブラリの存在を検査できる |
| 115 |
手続きがいくつか提供されています。 |
| 116 |
詳しくは@ref{Operations on libraries}を参照して下さい。 |
| 117 |
@c COMMON |
| 118 |
|
| 119 |
@menu |
| 120 |
* Finding libraries you need:: |
| 121 |
* Naming convention of libraries:: |
| 122 |
* Obsolete and superseded modules:: |
| 123 |
@end menu |
| 124 |
|
| 125 |
@node Finding libraries you need, Naming convention of libraries, Library modules - Overview, Library modules - Overview |
| 126 |
@section Finding libraries you need |
| 127 |
@c NODE 必要なライブラリの探し方 |
| 128 |
|
| 129 |
@c EN |
| 130 |
Each module is named more or less after what it implements |
| 131 |
rather than what it is implemented @emph{for}. If the module solves |
| 132 |
one problem, both are the same. However, sometimes there |
| 133 |
are multiple ways to solve a problem, or one implementation |
| 134 |
of an algorithm can solve multiple different problems; thus |
| 135 |
it is difficult to name the modules in problem-oriented |
| 136 |
(or purpose-oriented) way. |
| 137 |
@c JP |
| 138 |
各モジュール名は概ね何を実装しているかを示すような名前になっていて、 |
| 139 |
@emph{何のための}実装になっているかは示していません。モジュールがひと |
| 140 |
つの問題を解くためにあるのなら両方は一致しますが、問題の解法が複数ある |
| 141 |
こともありますし、ひとつのアルゴリズムの実装が複数の異る問題を解くのに |
| 142 |
役立つこともあります。したがって、モジュールに問題指向(あるいは目的指 |
| 143 |
向)の名前を付けることは困難です。 |
| 144 |
@c COMMON |
| 145 |
|
| 146 |
@c EN |
| 147 |
Because of this, it may not be straightforward for a newcomer |
| 148 |
to Gauche to find an appropriate Gauche module to solve her problem, |
| 149 |
since there may be multiple algorithms to do the job, |
| 150 |
and each algorithm can be implemented in different modules. |
| 151 |
@c JP |
| 152 |
というわけで、Gaucheにはじめてふれるプログラマにとって問題を解くのに適 |
| 153 |
切なGaucheモジュールを見つけるのは簡単ではないかもしれません。やるべきことに対 |
| 154 |
応するアルゴリズムは複数ありえますから、それぞれのアルゴリズムは別々の |
| 155 |
モジュールで実装されています。 |
| 156 |
@c COMMON |
| 157 |
|
| 158 |
@c EN |
| 159 |
The modules are also designed in layers; some low-level modules |
| 160 |
provide direct interface to the system calls, while some |
| 161 |
higher-level ones provide more abstract, easy-to-use interface, possibly |
| 162 |
built on top of more than one low-level modules. Which one |
| 163 |
should you use? Generally you want to use the highest level, |
| 164 |
for the very purpose of libraries are to provide easy, abstract |
| 165 |
interface. However there are times that you have to break |
| 166 |
the abstraction and to go down to tweak the machinery in |
| 167 |
the basement; then you need to use low-level modules directly. |
| 168 |
@c JP |
| 169 |
モジュールはまた、いくつもの層で実装されています。システムコールへの直接のインタフェース |
| 170 |
を提供する低レベルモジュールもあれば、複数の低レベルモジュールを使って |
| 171 |
構築された、より抽象化され使いやすい高レベルモジュールもあります。さて |
| 172 |
どれを使えばよいでしょう。通常もっとも高レベルのものを使うのがよいでしょ |
| 173 |
う。やさしく使える抽象度の高いインタフェースを提供するというのがまさに |
| 174 |
ライブラリの目的だからです。とはいうものの、場合によっては抽象の壁をや |
| 175 |
ぶってその下にあるメカニズムに触らなければ出来ないこともあります。そ |
| 176 |
ういうときには低レベルのモジュールを直接使う必要があります。 |
| 177 |
@c COMMON |
| 178 |
|
| 179 |
@c EN |
| 180 |
The purpose of this section is to group the libraries by |
| 181 |
their purposes. Each category lists relevant modules with |
| 182 |
brief descriptions. |
| 183 |
@c JP |
| 184 |
ここではライブラリをその目的にしたがってグループ分けします。各カテゴリ |
| 185 |
ごとに関連するモジュールをあげ、簡単な説明をしています。 |
| 186 |
@c COMMON |
| 187 |
|
| 188 |
@menu |
| 189 |
* Library directory - data containers:: |
| 190 |
* Library directory - strings and characters:: |
| 191 |
* Library directory - data exchange:: |
| 192 |
* Library directory - files:: |
| 193 |
* Library directory - processes and threads:: |
| 194 |
* Library directory - networking:: |
| 195 |
* Library directory - input and output:: |
| 196 |
* Library directory - time:: |
| 197 |
* Library directory - bits and bytes:: |
| 198 |
@end menu |
| 199 |
|
| 200 |
@node Library directory - data containers, Library directory - strings and characters, Finding libraries you need, Finding libraries you need |
| 201 |
@subsection Library directory - data containers |
| 202 |
@c NODE ライブラリディレクトリ - データコンテナ |
| 203 |
|
| 204 |
@c EN |
| 205 |
@subsubheading Generic container operations |
| 206 |
@c JP |
| 207 |
@subsubheading ジェネリックなコンテナ操作 |
| 208 |
@c COMMON |
| 209 |
|
| 210 |
@c EN |
| 211 |
Some data containers have similar properties; for example, |
| 212 |
lists, vectors and hash tables can be seen as a collection |
| 213 |
of data. So it is handy to have generic operators, such |
| 214 |
as applying a procedure to all the elements. |
| 215 |
@c JP |
| 216 |
似たような性質をもつデータコンテナがあります。たとえば、リスト、ベクタ、 |
| 217 |
ハッシュテーブルはデータのコレクションとして見ることができます。それゆ |
| 218 |
え、すべての要素に適用できるようなジェネリックな操作があれば便利です。 |
| 219 |
@c COMMON |
| 220 |
|
| 221 |
@c EN |
| 222 |
Gauche provides such mechanism to a certain degree, mainly using |
| 223 |
its object system. |
| 224 |
@c JP |
| 225 |
Gaucheでは主にオブジェクトシステムで使うためにこのような機構をある程度 |
| 226 |
用意されています。 |
| 227 |
@c COMMON |
| 228 |
|
| 229 |
@c EN |
| 230 |
@itemize @bullet |
| 231 |
@item |
| 232 |
@emph{Collection} - Generic functions applicable for unordered |
| 233 |
set of values. @xref{Collection framework}. |
| 234 |
@item |
| 235 |
@emph{Sequence} - Generic functions applicable for ordered set |
| 236 |
of values. @xref{Sequence framework}. |
| 237 |
@item |
| 238 |
@emph{Dictionary} - Generic functions to handle dictionary, that is, |
| 239 |
a mapping from keys to values. @xref{Dictionary framework}. |
| 240 |
@item |
| 241 |
@emph{Relation} - Generic functions to handle relations |
| 242 |
(in a sense of Codd's definition). @xref{Relation framework}. |
| 243 |
@item |
| 244 |
@emph{Comprehension} - This is a collection of macros very handy |
| 245 |
to construct and traverse collections/sequences in concise code. |
| 246 |
@xref{Eager comprehensions}. |
| 247 |
@end itemize |
| 248 |
@c JP |
| 249 |
@itemize @bullet |
| 250 |
@item |
| 251 |
@emph{コレクション} - 順序付けられていないデータの集合に対するジェネリッ |
| 252 |
ク関数。@ref{Collection framework}参照。 |
| 253 |
@item |
| 254 |
@emph{シーケンス} - 順序付けられたデータの集合に対するジェネリック関数。 |
| 255 |
@ref{Sequence framework}参照。 |
| 256 |
@item |
| 257 |
@emph{ディクショナリ} - 辞書、つまりキーから値への写像に対するジェネリック関数。 |
| 258 |
@ref{Dictionary framework}参照。 |
| 259 |
@item |
| 260 |
@emph{リレーション} - (Coddの定義による)リレーションを処理するためのジェ |
| 261 |
ネリック関数。@ref{Relation framework}参照。 |
| 262 |
@item |
| 263 |
@emph{内包表記} - コレクションやシーケンスの構築やトラバースを短く便利 |
| 264 |
に書くためのマクロ集。@ref{Eager comprehensions}参照。 |
| 265 |
@end itemize |
| 266 |
@c COMMON |
| 267 |
|
| 268 |
@c EN |
| 269 |
@subsubheading Container implementations |
| 270 |
@c JP |
| 271 |
@subsubheading コンテナの実装 |
| 272 |
@c COMMON |
| 273 |
|
| 274 |
@c EN |
| 275 |
@itemize @bullet |
| 276 |
@item |
| 277 |
@emph{List} - the universal data structure. You want to check |
| 278 |
@ref{Pairs and lists} and @ref{R7RS lists} |
| 279 |
@item |
| 280 |
@emph{Vector} - a one-dimensional array of arbitrary Scheme values. |
| 281 |
See @ref{Vectors} and @ref{R7RS vectors}. |
| 282 |
If you need a wide range of index, but the actual data |
| 283 |
is sparse, you might want to look at @ref{Sparse vectors}. |
| 284 |
@item |
| 285 |
@emph{Uniform vector} - a special kind of vectors that can hold |
| 286 |
limited types of values (e.g. integers representable in 8bits). |
| 287 |
It tends to be used in performance |
| 288 |
sensitive applications, such as graphics. See @ref{Uniform vectors}. |
| 289 |
@item |
| 290 |
@emph{Array} - multi-dimensional arrays that can hold |
| 291 |
arbitrary Scheme values. See @ref{Arrays}. |
| 292 |
@item |
| 293 |
@emph{Uniform array} - multi-dimensional arrays that can hold |
| 294 |
limited types of values. This is also supported by @ref{Arrays}. |
| 295 |
@item |
| 296 |
@emph{String} - a sequence of characters. See @ref{Strings} |
| 297 |
and @ref{String library}. Gauche handles multibyte strings--- |
| 298 |
see @ref{Multibyte strings} for the details. |
| 299 |
@item |
| 300 |
@emph{Character set} - a set of characters. See @ref{Character sets} |
| 301 |
and @ref{R7RS character sets}. |
| 302 |
@item |
| 303 |
@emph{Hash table} - hash tables. See @ref{Hashtables}. |
| 304 |
For very large hash tables (millions of entries), |
| 305 |
@ref{Sparse tables} may provide better memory footprint. |
| 306 |
@item |
| 307 |
@emph{Balanced tree} - If you need to order keys in a dictionary, |
| 308 |
you can use treemaps. See @ref{Treemaps}. |
| 309 |
@item |
| 310 |
@emph{Immutable map} - Sometimes immutable dictionary is handy. Internally |
| 311 |
it implements a functional balanced tree. See @ref{Immutable map}. |
| 312 |
@item |
| 313 |
@emph{Queue} - Both fast and thread-safe queues are provided in |
| 314 |
@ref{Queue}. Thread-safe queues can also be used as synchronized |
| 315 |
messaging channel. |
| 316 |
@item |
| 317 |
@emph{Heap} - See @ref{Heap}. |
| 318 |
@item |
| 319 |
@emph{Ring buffer} - Space-efficient ring buffer. See @ref{Ring buffer}. |
| 320 |
@item |
| 321 |
@emph{Cache} - Various cache algorithm implementations. |
| 322 |
See @ref{Cache}. |
| 323 |
@item |
| 324 |
@emph{Record} - a simple data structure. Although Gauche's object |
| 325 |
system can be used to define arbitrary data structures, you might |
| 326 |
want to look at @ref{Record types} and @ref{SLIB-compatible record type}, |
| 327 |
for they are more portable and potentially more efficient. |
| 328 |
@item |
| 329 |
@emph{Stream} - you can implement cool lazy algorithms with it. |
| 330 |
See @ref{Stream library}. |
| 331 |
@item |
| 332 |
@emph{Trie} - Another tree structure for efficient common-prefix |
| 333 |
search. See @ref{Trie}. |
| 334 |
@item |
| 335 |
@emph{Database interface} - dbm interface can be used as a |
| 336 |
persistent hash table; see @ref{Generic DBM interface}. |
| 337 |
For generic RDBMS interface, see @ref{Database independent access layer}. |
| 338 |
@end itemize |
| 339 |
@c JP |
| 340 |
@itemize @bullet |
| 341 |
@item |
| 342 |
@emph{リスト} - もっともよく使うデータ構造。 |
| 343 |
@ref{Pairs and lists}と@ref{R7RS lists}をチェックしましょう。 |
| 344 |
@item |
| 345 |
@emph{ベクタ} - 任意のSchemeの値を格納する一次元配列。@ref{Vectors}お |
| 346 |
よび@ref{R7RS vectors}を見ましょう。 |
| 347 |
広い範囲のインデックスが必要で、しかし実際に格納されるデータが疎である場合は |
| 348 |
@ref{Sparse vectors}が使えるかもしれません。 |
| 349 |
@item |
| 350 |
@emph{ユニフォームベクタ} - 制限された型の値(たとえば8ビット整数)を保 |
| 351 |
持する特別なベクタ。グラフィックなどパフォーマンスが要求されるアプリケー |
| 352 |
ション用。@ref{Uniform vectors}参照。 |
| 353 |
@item |
| 354 |
@emph{配列} - 任意のScheme値を保持できる多次元配列。@ref{Arrays}参照。 |
| 355 |
@item |
| 356 |
@emph{ユニフォーム配列} - 制限された型の値を保持する多次元配列。これも |
| 357 |
@ref{Arrays}でサポートされている。 |
| 358 |
@item |
| 359 |
@emph{文字列} - 文字のシーケンス。@ref{Strings}および |
| 360 |
@ref{String library}参照。Gaucheではマルチバイト文字列を扱えます。詳細 |
| 361 |
については@ref{Multibyte strings}を見てください。 |
| 362 |
@item |
| 363 |
@emph{文字集合} - 文字の集合。@ref{Character sets}および |
| 364 |
@ref{R7RS character sets}参照。 |
| 365 |
@item |
| 366 |
@emph{ハッシュテーブル} - ハッシュテーブル。 @ref{Hashtables}参照。 |
| 367 |
非常に大きなハッシュテーブル(数百万エントリ)の場合、 |
| 368 |
@ref{Sparse tables}の方がメモリ効率が良い可能性もあります。 |
| 369 |
@item |
| 370 |
@emph{平衡木} - 辞書のキーに順序づけが必要な場合はツリーマップがが利用できます。 |
| 371 |
@ref{Treemaps}参照。 |
| 372 |
@item |
| 373 |
@emph{不変なマップ} - しばしは、変更不可能な辞書が便利な場面があります。 |
| 374 |
内部では関数的な平衡木として実装されています。@ref{Immutable map}参照。 |
| 375 |
@item |
| 376 |
@emph{キュー} - 高速なキュー、およびスレッドセーフなキューが@ref{Queue}で用意されています。 |
| 377 |
スレッドセーフキューはまた、同期的なメッセージチャネルとしても使えます。 |
| 378 |
@item |
| 379 |
@emph{ヒープ} - @ref{Heap}参照。 |
| 380 |
@item |
| 381 |
@emph{リングバッファ} - 空間効率の良いリングバッファです。@ref{Ring buffer}参照。 |
| 382 |
@item |
| 383 |
@emph{キャッシュ} - 様々なキャッシュアルゴリズムの実装です。 |
| 384 |
@ref{Cache}参照。 |
| 385 |
@item |
| 386 |
@emph{レコード} - 単純なデータ構造。Gaucheのオブジェクトシステムをつかっ |
| 387 |
て任意のデータ構造を定義できますが、@ref{Record types}および |
| 388 |
@ref{SLIB-compatible record type}を検討するのもいいでしょう。こちらの |
| 389 |
方がポータブルで高効率です。 |
| 390 |
@item |
| 391 |
@emph{ストリーム} - これを使うと遅延アルゴリズムをスマートに実装できま |
| 392 |
す。@ref{Stream library}参照。 |
| 393 |
@item |
| 394 |
@emph{トライ} - 共通接頭辞検索用の効率のよい木構造です。@ref{Trie}参照。 |
| 395 |
@item |
| 396 |
@emph{データベースインタフェース} - dbmインタフェースが永続的ハッシュ |
| 397 |
テーブルとして利用できます。@ref{Generic DBM interface}参照。ジェネリッ |
| 398 |
クなRDBMSへのインタフェースについては、 |
| 399 |
@ref{Database independent access layer}を見てください。 |
| 400 |
@end itemize |
| 401 |
@c COMMON |
| 402 |
|
| 403 |
@node Library directory - strings and characters, Library directory - data exchange, Library directory - data containers, Finding libraries you need |
| 404 |
@subsection Library directory - string and character |
| 405 |
@c NODE ライブラリディレクトリ - 文字列と文字 |
| 406 |
|
| 407 |
@c EN |
| 408 |
Basic string operations are covered in |
| 409 |
@ref{Strings} and @ref{String library}. |
| 410 |
A string is also a sequence of characters, so you can |
| 411 |
apply methods in @ref{Collection framework} and |
| 412 |
@ref{Sequence framework}. |
| 413 |
@c JP |
| 414 |
文字列の基本操作は@ref{Strings}および@ref{String library}でカバーされ |
| 415 |
ています。文字列は文字のシーケンスでもありますので、 |
| 416 |
@ref{Collection framework}および@ref{Sequence framework}のメソッドを適 |
| 417 |
用可能です。 |
| 418 |
@c COMMON |
| 419 |
|
| 420 |
@c EN |
| 421 |
Character and character set operations are covered in |
| 422 |
@ref{Characters}, @ref{Character sets}, and @ref{R7RS character sets}. |
| 423 |
@c JP |
| 424 |
文字および文字集合の操作は |
| 425 |
@ref{Characters}、@ref{Character sets}、@ref{R7RS character sets}がカ |
| 426 |
バーしています。 |
| 427 |
@c COMMON |
| 428 |
|
| 429 |
@c EN |
| 430 |
If you scan or build strings sequentially, do not use index |
| 431 |
access. String ports (see @ref{String ports}) provides more efficient, |
| 432 |
and elegant way. |
| 433 |
@c JP |
| 434 |
文字列を先頭から順に操作したり構築したりする場合にはインデックスによる |
| 435 |
アクセスは行いません。文字列ポート(@ref{String ports}参照)はさらに |
| 436 |
効率のよいエレガントな方法を提供しています。 |
| 437 |
@c COMMON |
| 438 |
|
| 439 |
@c EN |
| 440 |
You can use regular expressions to search and extract |
| 441 |
character sequences from strings; see @ref{Regular expressions}. |
| 442 |
@c JP |
| 443 |
文字列から文字のならびを検索したり、とりだしたりするのに正規表現が使え |
| 444 |
ます。@ref{Regular expressions}参照。 |
| 445 |
@c COMMON |
| 446 |
|
| 447 |
@c EN |
| 448 |
If you need to deal with low-level (i.e. byte-level) |
| 449 |
representation of strings, @ref{Uniform vectors} has some |
| 450 |
tools to convert strings and byte vectors back and forth. |
| 451 |
@c JP |
| 452 |
文字列の低レベル(たとえばバイトレベル)表現を扱う必要があるなら |
| 453 |
@ref{Uniform vectors}に文字列とバイトベクタ相互の変換をおこなうツール |
| 454 |
があります。 |
| 455 |
@c COMMON |
| 456 |
|
| 457 |
@c EN |
| 458 |
Are you dealing with a structure higher than a mere sequence |
| 459 |
of characters? Then take a look at @code{text.*} modules. |
| 460 |
@ref{Parsing input stream} has some basic |
| 461 |
scanners. @ref{Transliterate characters} implements a |
| 462 |
feature similar to Unix's @code{tr(1)}. |
| 463 |
You can take @code{diff} of two texts; see |
| 464 |
@ref{Calculate difference of text streams}. |
| 465 |
And if you want to construct large text from string fragments, |
| 466 |
do not use @code{string-append}---see @ref{Lazy text construction}. |
| 467 |
@c JP |
| 468 |
文字の単なるシーケンスよりも高次の構造を扱いたいのですか。それなら |
| 469 |
@code{text.*}モジュールを見てください。@ref{Parsing input stream}には |
| 470 |
基本的なスキャナの実装が用意されています。 |
| 471 |
@ref{Transliterate characters}はUnixの@code{tr(1)}に似た機能を実装して |
| 472 |
います。2つのテキストの@code{diff}をとることもできます。これについては |
| 473 |
@ref{Calculate difference of text streams}を見てください。文字列の断片 |
| 474 |
から大きな文字列を構成したいのなら、@code{string-append}を使ってはいけ |
| 475 |
ません。@ref{Lazy text construction}参照。 |
| 476 |
@c COMMON |
| 477 |
|
| 478 |
@c EN |
| 479 |
Last but not least, Gauche has support of various character |
| 480 |
encoding schemes. See @ref{Character code conversion} for |
| 481 |
the basic utilities. Most higher-level functions such as |
| 482 |
@code{open-input-file} can take @code{:encoding} keyword argument |
| 483 |
to perform character conversion implicitly. Also see |
| 484 |
@ref{Multibyte scripts} if you write Scheme program in |
| 485 |
non-ASCII characters. If you want to process Gauche source code |
| 486 |
which may contain "encoding" magic comment, see @ref{Coding-aware ports}. |
| 487 |
Gauche also has GNU gettext compatible module (@ref{Localized messages}) |
| 488 |
if you need localization. |
| 489 |
@c JP |
| 490 |
大事なことを言い忘れました。Gaucheはさまざまな文字エンコーディングをサ |
| 491 |
ポートしています。基本的な関数については |
| 492 |
@ref{Character code conversion}を見てください。@code{open-input-file} |
| 493 |
のようなもっとも高次の関数のほとんどは、@code{:encoding}キーワード引数 |
| 494 |
をとり、文字の変換を暗黙におこないます。非ASCII文字でSchemeのプログラ |
| 495 |
ムを書きたい場合には@ref{Multibyte scripts}を見てください。encodingと |
| 496 |
いうマジックコメントを含むGaucheのソースコードを処理したいなら |
| 497 |
@ref{Coding-aware ports}を見てください。地域化が必要なら、Gaucheには |
| 498 |
GNU gettext互換のモジュール(@ref{Localized messages})もあります。 |
| 499 |
@c COMMON |
| 500 |
|
| 501 |
|
| 502 |
@node Library directory - data exchange, Library directory - files, Library directory - strings and characters, Finding libraries you need |
| 503 |
@subsection Library directory - data exchange |
| 504 |
@c NODE ライブラリディレクトリ - データ交換 |
| 505 |
|
| 506 |
@c EN |
| 507 |
Most useful programs need to communicate with outside world |
| 508 |
(other programs or humans). That involves reading the external data |
| 509 |
into your program understanding whatever format the data is in, and |
| 510 |
also writing the data in the format the others can understand. |
| 511 |
@c JP |
| 512 |
ほとんどのプログラムでは外界(他のプログラムや人間)とコミュニケーション |
| 513 |
する必要があります。ということは外部データを読み込んでそれがどのような |
| 514 |
フォーマットで書かれているかを判別したり、他のプログラムが理解できる |
| 515 |
フォーマットでデータを書き出したりするということです。 |
| 516 |
@c COMMON |
| 517 |
|
| 518 |
@c EN |
| 519 |
Lots of network-related external formats are defined in RFC, |
| 520 |
and there are corresponding @code{rfc.*} module that handle |
| 521 |
some of them. See @ref{RFC822 message parsing}, for example, |
| 522 |
to handle the pervasive RFC2822 message format. |
| 523 |
Or, JSON can be handled by @ref{JSON parsing and construction}. |
| 524 |
@c JP |
| 525 |
ネットワークに関連する外部フォーマットの多くはRFCで規定されており、そ |
| 526 |
れらのいくつかに対応するRFCモジュール(@code{rfc.*})があります。たとえ |
| 527 |
ばよく知られたRFC2822のメッセージフォーマットを処理するには |
| 528 |
@ref{RFC822 message parsing}を見てください。 |
| 529 |
@c COMMON |
| 530 |
|
| 531 |
@c EN |
| 532 |
When you exchange table-formatted data, one of the easiest way |
| 533 |
may be the plain text, one row per line, and columns are separated |
| 534 |
by some specific characters (e.g. comma). See @ref{CSV tables} for |
| 535 |
basic parser/writer for them. |
| 536 |
@c JP |
| 537 |
表形式のデータを交換するのにもっとも便利な方法は表の一行をプレーンテキ |
| 538 |
ストの一行に対応させることです。そしてカラムは特定の文字で区切ります。 |
| 539 |
たとえば、コンマで区切ります。これらの解析と書き出し用の基本手続につい |
| 540 |
ては@ref{CSV tables}を見てください。 |
| 541 |
@c COMMON |
| 542 |
|
| 543 |
@c EN |
| 544 |
Oh, and nowadays every business user wants XML, right? You know |
| 545 |
they are just S-expressions with extra redundancy and pointy |
| 546 |
parentheses. So why don't you read XML as if they're S-exprs, |
| 547 |
process them with familiar cars and cdrs and maps, then write them |
| 548 |
out with extra redundancy and pointy parens? |
| 549 |
Module @code{sxml.ssax} (@ref{Functional XML parser}) |
| 550 |
implements SAX XML parser, with which you |
| 551 |
can parse XML and process them on the fly, or convert it to |
| 552 |
SXML, S-expression XML. You can query SXML using |
| 553 |
SXPath, an XPath counterparts of S-expression (@ref{SXML query language}). |
| 554 |
You can output all kinds of XML and HTML using the SXML serializer |
| 555 |
(@ref{Serializing XML and HTML from SXML}). |
| 556 |
@c JP |
| 557 |
今どきのビジネスユーザはXMLを欲しがるというのですか。いいでしょう。まぁ |
| 558 |
彼らが欲しいのは尖った括弧のえらい冗長なS式なんですから、XMLをS式と |
| 559 |
して読み込んで、自家籠中の car とか cdr とか map でちょちょいと処理し |
| 560 |
てえらい冗長な尖った括弧で書き出せばいいですよね。 |
| 561 |
@code{sxml.ssax}モジュール(@ref{Functional XML parser})はSAX XMLパーザ |
| 562 |
の実装です。これを使えば、おてがるにXMLをパーズしたり処理したり、ある |
| 563 |
いはまた、SXML(S式XML)に変換することもできます。SXPath(XPathに対応する |
| 564 |
S式(@ref{SXML query language}))を使ってSXMLクエリを発行することもでき |
| 565 |
ます。SXMLシリアライザを使えば、すべての種類のXMLやHTMLをはきだすこと |
| 566 |
もできます(@ref{Serializing XML and HTML from SXML})。 |
| 567 |
@c COMMON |
| 568 |
|
| 569 |
@c EN |
| 570 |
(But you know most web services nowadays also talks JSON, |
| 571 |
and that's much lighter and handier than XML. |
| 572 |
See @ref{JSON parsing and construction}). |
| 573 |
@c JP |
| 574 |
(でもいまどきのwebサービスならたいていはJSONも話しますし、そっちの方が |
| 575 |
手軽だっていうなら、@ref{JSON parsing and construction}を見てみると良いかも |
| 576 |
しれません。) |
| 577 |
@c COMMON |
| 578 |
|
| 579 |
@c EN |
| 580 |
It is planned that various file format handling routines would |
| 581 |
be available as @code{file.*} modules, though we have none ready |
| 582 |
yet. If you plan to write one, please go ahead and let us know! |
| 583 |
@c JP |
| 584 |
さまざまなファイルフォーマットを処理するルーチンを@code{file.*}という |
| 585 |
モジュールで使えるようにしようという計画はあるのですが、まだなにも準備 |
| 586 |
できていません。ひとつ自分で書いてやろうという人がいたら是非おねがいし |
| 587 |
たいので、おしらせ下さい。 |
| 588 |
@c COMMON |
| 589 |
|
| 590 |
@node Library directory - files, Library directory - processes and threads, Library directory - data exchange, Finding libraries you need |
| 591 |
@subsection Library directory - files |
| 592 |
@c NODE ライブラリディレクトリ - ファイル |
| 593 |
|
| 594 |
@c EN |
| 595 |
Files and directories. Roughly speaking, there are two places |
| 596 |
you want to look at. |
| 597 |
@c JP |
| 598 |
ファイルおよびディレクトリ。おおざっぱに言うと見るべきところは2箇所で |
| 599 |
す。 |
| 600 |
@c COMMON |
| 601 |
|
| 602 |
@c EN |
| 603 |
@ref{Filesystems}, in the core, has |
| 604 |
routines close to the underlying OS provides. If you have |
| 605 |
experience with Unix system programming you'll find familiar |
| 606 |
function names there. The @code{fcntl} functionality is |
| 607 |
splitted to @code{gauche.fcntl} (@ref{Low-level file operations}), FYI. |
| 608 |
@c JP |
| 609 |
@ref{Filesystems}のコア部分には下位のOSが提供しているに近いルーチンが |
| 610 |
あります。Unixのシステムプログラミングの経験があれば、よく知っている関 |
| 611 |
数名がばかりだと思うでしょう。ちなみに@code{fcntl}の機能は |
| 612 |
@code{gauche.fcntl} (@ref{Low-level file operations})にあります。 |
| 613 |
@c COMMON |
| 614 |
|
| 615 |
@c EN |
| 616 |
Also you definitely want to look at @code{file.util} |
| 617 |
(@ref{Filesystem utilities}), which implements higher-level |
| 618 |
routines on top of system-level ones. |
| 619 |
@c JP |
| 620 |
まちがいなく@code{file.util}(@ref{Filesystem utilities})を使いたいこと |
| 621 |
でしょう。これはシステムレベル上で実装された高次レベルのルーチン群です。 |
| 622 |
@c COMMON |
| 623 |
|
| 624 |
|
| 625 |
@node Library directory - processes and threads, Library directory - networking, Library directory - files, Finding libraries you need |
| 626 |
@subsection Library directory - processes and threads |
| 627 |
@c NODE ライブラリディレクトリ - プロセスとスレッド |
| 628 |
|
| 629 |
@c EN |
| 630 |
Process-related routines also come in two levels. |
| 631 |
@c JP |
| 632 |
プロセス関連のルーチンも2つのレベルで提供されます。 |
| 633 |
@c COMMON |
| 634 |
|
| 635 |
@c EN |
| 636 |
The @code{gauche.process} module provides |
| 637 |
high-level routines (@ref{High-level process interface}); |
| 638 |
you can pipe the data into and out of child processes easily, for example. |
| 639 |
@c JP |
| 640 |
@code{gauche.process}モジュールは高レベルのルーチン |
| 641 |
(@ref{High-level process interface})を提供しています。これを使えば、た |
| 642 |
とえば、データを子プロセスとの間でパイプすることが簡単にできます。 |
| 643 |
@c COMMON |
| 644 |
|
| 645 |
@c EN |
| 646 |
Gauche core provides the primitive @code{fork} and @code{exec} interface |
| 647 |
as well as the convenient @code{system} call |
| 648 |
(see @ref{Process management}). Use them when you want a precise |
| 649 |
control over what you're doing. |
| 650 |
@c JP |
| 651 |
Gaucheコアはプリミティブな@code{fork}および@code{exec}のインタフェース |
| 652 |
を、便利な@code{system}コール(@ref{Process management}参照)同様提 |
| 653 |
供しています。やりたいことを細かくコントロールしたい場合に使うとよいで |
| 654 |
しょう。 |
| 655 |
@c COMMON |
| 656 |
|
| 657 |
@c EN |
| 658 |
Gauche has preemptive threads on most Unix platforms including OSX. |
| 659 |
Check out @ref{Threads} for the basic thread support, including |
| 660 |
primitive mutexes. The @code{data.queue} module (@pxref{Queue}) |
| 661 |
provides thread-safe queue that can also be handy for synchronization. |
| 662 |
Thread pool is available in @code{control.thread-pool} (@pxref{Thread pools}). |
| 663 |
@c JP |
| 664 |
GaucheはOSXを含む多くのUnixプラットフォームでプリエンプティブなスレッドを |
| 665 |
サポートしています。低レベルの排他制御を含む基本的なスレッドのサポートについては |
| 666 |
@ref{Threads}を参照してください。@code{data.queue}モジュール |
| 667 |
(@ref{Queue}参照)では、スレッド間同期にも使えるスレッドセーフなキューを |
| 668 |
提供しています。スレッドプールは@code{control.thread-pool} (@ref{Thread pools}参照) |
| 669 |
によって提供されます。 |
| 670 |
@c COMMON |
| 671 |
|
| 672 |
|
| 673 |
@node Library directory - networking, Library directory - input and output, Library directory - processes and threads, Finding libraries you need |
| 674 |
@subsection Library directory - networking |
| 675 |
@c NODE ライブラリディレクトリ - ネットワーク |
| 676 |
|
| 677 |
@c EN |
| 678 |
We have multi-layer abstraction here. At the bottom, we have |
| 679 |
APIs corresponding to socket-level system calls. In the middle, |
| 680 |
a convenience library that automates host name lookups, connection |
| 681 |
and shutdown, etc. On top of them we have several modules that |
| 682 |
handles specific protocols (e.g. http). |
| 683 |
@c JP |
| 684 |
これは抽象の層が複数あります。最下層ではソケットレベルのシステムコール |
| 685 |
に対応するAPIがあります。中間層ではホスト名の解決、コネクション、シャッ |
| 686 |
トダウンなどを自動でやるような便利なライブラリになっています。最上層で |
| 687 |
は、たとえばHTTPのような特定のプロトコルを扱うためのモジュールがいくつ |
| 688 |
か用意されています。 |
| 689 |
@c COMMON |
| 690 |
|
| 691 |
@c EN |
| 692 |
The @code{gauche.net} module (@ref{Networking}) provides the bottom |
| 693 |
and middle layer. For the top layer, look for @code{rfc.*} modules, |
| 694 |
e.g. @code{rfc.http} (@ref{HTTP client}). |
| 695 |
More protocol support is coming (there are @code{rfc.ftp} and |
| 696 |
@code{rfc.imap4} written by users, which are waiting for being |
| 697 |
integrated into Gauche---maybe in next release). |
| 698 |
@c JP |
| 699 |
@code{gauche.net}モジュール(@ref{Networking})は最下層と中間層を提供し |
| 700 |
ています。最上層については@code{rfc.*}モジュールを探してみて下さい。 |
| 701 |
たとえば @code{rfc.http} (@ref{HTTP client})です。 |
| 702 |
その他のプロトコルについてもまもなくサポートされる予定です。 |
| 703 |
@code{rfc.ftp}や@code{rfc.imap4}はすでにユーザの方々が書いてくれていて、 |
| 704 |
Gaucheにとりこまれるのを待っている状態にあります。おそらく次のリリース |
| 705 |
で統合されるでしょう。 |
| 706 |
@c COMMON |
| 707 |
|
| 708 |
@c EN |
| 709 |
There's a plan of even higher level of libraries, under the name |
| 710 |
@code{net.*}, which will abstract more than one network protocols. |
| 711 |
The planned ones include sending emails, or |
| 712 |
universal resource access by uri. Code contributions are welcome. |
| 713 |
@c JP |
| 714 |
さらに複数のプロトコルを抽象化して@code{net.*}という名前のさらに高次レ |
| 715 |
ベルのライブラリの計画もあります。emailの送信あるいはURIによるリソース |
| 716 |
アクセスなどの計画があります。コードの貢献は歓迎します。 |
| 717 |
@c COMMON |
| 718 |
|
| 719 |
@node Library directory - input and output, Library directory - time, Library directory - networking, Finding libraries you need |
| 720 |
@subsection Library directory - input and output |
| 721 |
@c NODE ライブラリディレクトリ - 入出力 |
| 722 |
|
| 723 |
@node Library directory - time, Library directory - bits and bytes, Library directory - input and output, Finding libraries you need |
| 724 |
@subsection Library directory - time |
| 725 |
@c NODE ライブラリディレクトリ - 時間 |
| 726 |
|
| 727 |
@node Library directory - bits and bytes, , Library directory - time, Finding libraries you need |
| 728 |
@subsection Library directory - bits and bytes |
| 729 |
@c NODE ライブラリディレクトリ - ビットとバイト |
| 730 |
|
| 731 |
@c EN |
| 732 |
@subsubheading Binary I/O |
| 733 |
@c JP |
| 734 |
@subsubheading バイナリ入出力 |
| 735 |
@c COMMON |
| 736 |
|
| 737 |
@c EN |
| 738 |
As the bottom level, |
| 739 |
Gauche includes primitive byte I/O (@code{read-byte}, @code{write-byte}) |
| 740 |
as well as block I/O (@code{read-uvector}, @code{read-uvector!}, @code{write-uvector}) in its core. |
| 741 |
(See @ref{Reading data}, @ref{Output}, and @ref{Uvector block I/O}). |
| 742 |
@c JP |
| 743 |
最下層としてGaucheはコアに含まれるブロック入出力(@code{read-uvector}, @code{read-uvector!} |
| 744 |
、@code{write-uvector})と同様、バイト入出力のプリミティブ |
| 745 |
(@code{read-byte}、@code{write-byte})も含んでいます |
| 746 |
(@ref{Reading data}、@ref{Output}、@ref{Uvector block I/O}参照)。 |
| 747 |
@c COMMON |
| 748 |
|
| 749 |
@c EN |
| 750 |
As the middle level, the module @code{binary.io} |
| 751 |
(@ref{Binary I/O}) has routines to retrieve specific datatype |
| 752 |
with optional endian specification. |
| 753 |
@c JP |
| 754 |
中間層としては、@code{binary.io}(@ref{Binary I/O})モジュールには |
| 755 |
オプションでエンディアンを指定できる特定のデータを取得するルーチンがあ |
| 756 |
ります。 |
| 757 |
@c COMMON |
| 758 |
|
| 759 |
@c EN |
| 760 |
And as the top level, the module @code{binary.pack} |
| 761 |
(@ref{Packing binary data}) allows packing and unpacking structured |
| 762 |
binary data, a la Perl's @code{pack}/@code{unpack}. |
| 763 |
@c JP |
| 764 |
そして最上層としては、@code{binary.pack}(@ref{Packing binary data}) |
| 765 |
モジュールがあって、構造をもつバイナリデータのパック、アンパックを可能 |
| 766 |
にしています。Perlでいう@code{pack}/@code{unpack}です。 |
| 767 |
@c COMMON |
| 768 |
|
| 769 |
@c EN |
| 770 |
@subsubheading Bit manipulation |
| 771 |
@c JP |
| 772 |
@subsubheading ビット操作 |
| 773 |
@c COMMON |
| 774 |
|
| 775 |
@c EN |
| 776 |
Gauche core provides basic bitshift and mask operations |
| 777 |
(@pxref{Basic bitwise operations}). |
| 778 |
SRFI-151 has comprehensive bitwise operations |
| 779 |
(@pxref{R7RS bitwise operations}). |
| 780 |
@c JP |
| 781 |
Gaucheコアは基本的なビットシフトおよびマスク操作を提供しています |
| 782 |
(@ref{Basic bitwise operations}参照)。 |
| 783 |
SRFI-151はより包括的なビット演算を提供します |
| 784 |
(@ref{R7RS bitwise operations}参照)。 |
| 785 |
@c COMMON |
| 786 |
|
| 787 |
@node Naming convention of libraries, Obsolete and superseded modules, Finding libraries you need, Library modules - Overview |
| 788 |
@section Naming convention of libraries |
| 789 |
@c NODE ライブラリの命名規則 |
| 790 |
|
| 791 |
@c EN |
| 792 |
The following table summarizes naming categories of the modules, |
| 793 |
including external ones and planned ones. |
| 794 |
@c JP |
| 795 |
下の表は、モジュールの名前付けの分類を示します。 |
| 796 |
外部モジュール、及び将来予定されているモジュールも含みます。 |
| 797 |
@c COMMON |
| 798 |
|
| 799 |
@table @code |
| 800 |
@item binary.* |
| 801 |
@c EN |
| 802 |
Utilities to treat binary data. |
| 803 |
@c JP |
| 804 |
バイナリデータを扱うためのユーティリティ。 |
| 805 |
@c COMMON |
| 806 |
|
| 807 |
@item compat.* |
| 808 |
@c EN |
| 809 |
Provides compatibility layers. |
| 810 |
@c JP |
| 811 |
互換性のためのレイヤを提供。 |
| 812 |
@c COMMON |
| 813 |
|
| 814 |
@item control.* |
| 815 |
@c EN |
| 816 |
Control structures, such as multithreading utilities |
| 817 |
@c JP |
| 818 |
マルチスレッドユーティリティなどの制御機構 |
| 819 |
@c COMMON |
| 820 |
|
| 821 |
@item data.* |
| 822 |
@c EN |
| 823 |
Implementations of various data structures. |
| 824 |
@c JP |
| 825 |
様々なデータ構造の実装 |
| 826 |
@c COMMON |
| 827 |
|
| 828 |
@item dbi.*, dbd.* |
| 829 |
@c EN |
| 830 |
Database independent interface layer and drivers. |
| 831 |
@c JP |
| 832 |
データベース独立インタフェース層とドライバー。 |
| 833 |
@c COMMON |
| 834 |
|
| 835 |
@item dbm.* |
| 836 |
@c EN |
| 837 |
DBM interface |
| 838 |
@c JP |
| 839 |
DBMインタフェース |
| 840 |
@c COMMON |
| 841 |
|
| 842 |
@item gauche.* |
| 843 |
@c EN |
| 844 |
Stuffs more or less considered as Gauche core features. |
| 845 |
@c JP |
| 846 |
Gauche本体の一部として考えられている機能。 |
| 847 |
@c COMMON |
| 848 |
|
| 849 |
@item gl.* |
| 850 |
@c EN |
| 851 |
OpenGL binding and related libraries (external package). |
| 852 |
@c JP |
| 853 |
OpenGLバインディングと関連するライブラリ (外部パッケージ)。 |
| 854 |
@c COMMON |
| 855 |
|
| 856 |
@item gtk.* |
| 857 |
@c EN |
| 858 |
GTk+ binding and related libraries (external package). |
| 859 |
@c JP |
| 860 |
GTk+バインディングと関連するライブラリ (外部パッケージ)。 |
| 861 |
@c COMMON |
| 862 |
|
| 863 |
@item file.* |
| 864 |
@c EN |
| 865 |
Manipulating files and directories. |
| 866 |
@c JP |
| 867 |
ファイルとディレクトリの操作。 |
| 868 |
@c COMMON |
| 869 |
|
| 870 |
@item lang.* |
| 871 |
@c EN |
| 872 |
Language-related libraries, artificial and/or natural (planned). |
| 873 |
@c JP |
| 874 |
言語に関するライブラリ(人工的なものも自然言語関連も)。(予定) |
| 875 |
@c COMMON |
| 876 |
|
| 877 |
@item math.* |
| 878 |
@c EN |
| 879 |
Mathematics. |
| 880 |
@c JP |
| 881 |
数学。 |
| 882 |
@c COMMON |
| 883 |
|
| 884 |
@item os.* |
| 885 |
@c EN |
| 886 |
Features for specific OSes. |
| 887 |
@c JP |
| 888 |
特定のOS向けの機能。 |
| 889 |
@c COMMON |
| 890 |
|
| 891 |
@item parser.* |
| 892 |
@c EN |
| 893 |
Parsers |
| 894 |
@c JP |
| 895 |
パーザ (構文解析) |
| 896 |
@c COMMON |
| 897 |
|
| 898 |
@item rfc.* |
| 899 |
@c EN |
| 900 |
Implementations of net protocols defined in RFC's. |
| 901 |
@c JP |
| 902 |
RFCで定義されているデータフォーマットやネットワークプロトコルの実装。 |
| 903 |
@c COMMON |
| 904 |
|
| 905 |
@item scheme.* |
| 906 |
@c EN |
| 907 |
R7RS libraries |
| 908 |
@c JP |
| 909 |
R7RSライブラリ |
| 910 |
@c COMMON |
| 911 |
|
| 912 |
@item srfi.* |
| 913 |
@c EN |
| 914 |
SRFI implementations. |
| 915 |
@c JP |
| 916 |
SRFIの実装 |
| 917 |
@c COMMON |
| 918 |
|
| 919 |
@item sxml.* |
| 920 |
@c EN |
| 921 |
SXML libraries. |
| 922 |
@c JP |
| 923 |
SXMLライブラリ。 |
| 924 |
@c COMMON |
| 925 |
|
| 926 |
@item text.* |
| 927 |
@c EN |
| 928 |
Libraries dealing with text data. |
| 929 |
@c JP |
| 930 |
テキストデータを扱うライブラリ |
| 931 |
@c COMMON |
| 932 |
|
| 933 |
@item util.* |
| 934 |
@c EN |
| 935 |
Generic implementations of various algorithms. |
| 936 |
@c JP |
| 937 |
汎用的なアルゴリズムの実装。 |
| 938 |
@c COMMON |
| 939 |
|
| 940 |
@item www.* |
| 941 |
@c EN |
| 942 |
Implementations of various protocols and formats mainly used in WWW. |
| 943 |
@c JP |
| 944 |
WWWで主として使われるプロトコルやデータフォーマットの実装。 |
| 945 |
@c COMMON |
| 946 |
@end table |
| 947 |
|
| 948 |
@node Obsolete and superseded modules, , Naming convention of libraries, Library modules - Overview |
| 949 |
@section Obsolete and superseded modules |
| 950 |
@c NODE 廃止あるいは置き換えられたモジュール |
| 951 |
|
| 952 |
@c EN |
| 953 |
During the course of development of Gauche, |
| 954 |
some modules have been renamed, merged, or dissolved into the core. |
| 955 |
Also, some SRFI libraries become standard and given a new name, |
| 956 |
or superseded with a newer SRFI library. |
| 957 |
@c JP |
| 958 |
Gaucheの開発の過程で、いくつかのモジュールは名前が変わったり、 |
| 959 |
合併したり、あるいはコアに取り込まれたりしてきました。 |
| 960 |
また、いくつかのSRFIライブラリは標準に取り込まれ新しい名前をつけられたり、 |
| 961 |
より新しいSRFIで置き換えられたりしています。 |
| 962 |
@c COMMON |
| 963 |
|
| 964 |
@c EN |
| 965 |
We list such modules here for the reference. |
| 966 |
New code shouldn't use these modules, although they are kept in |
| 967 |
the distribution so that legacy code can keep running. |
| 968 |
@c JP |
| 969 |
参考のため、それらのモジュールをここにリストしておきます。 |
| 970 |
新たなコードはこれらのモジュールを使うべきではありませんが、 |
| 971 |
古いコードがそのまま動きつづけるよう、Gaucheの配布物の中にはこれらの |
| 972 |
モジュールが含まれています。 |
| 973 |
@c COMMON |
| 974 |
|
| 975 |
@c EN |
| 976 |
@subheading Obsolete modules |
| 977 |
@c JP |
| 978 |
@subheading 廃止されたモジュール |
| 979 |
@c COMMON |
| 980 |
|
| 981 |
@deftp {Module} text.unicode |
| 982 |
@mdindex text.unicode |
| 983 |
@c EN |
| 984 |
Renamed to @code{gauche.unicode}. @xref{Unicode utilities}. |
| 985 |
@c JP |
| 986 |
@code{gauche.unicode}へと名前変更。@ref{Unicode utilities}参照。 |
| 987 |
@c COMMON |
| 988 |
@end deftp |
| 989 |
|
| 990 |
|
| 991 |
@deftp {Module} util.list |
| 992 |
@mdindex util.list |
| 993 |
@c EN |
| 994 |
Dissolved into the core. No longer needed. |
| 995 |
@c JP |
| 996 |
コアに吸収されました。もう必要ありません。 |
| 997 |
@c COMMON |
| 998 |
@end deftp |
| 999 |
|
| 1000 |
@deftp {Module} util.queue |
| 1001 |
@mdindex util.queue |
| 1002 |
@c EN |
| 1003 |
Renamed to @code{data.queue}. @xref{Queue}. |
| 1004 |
@c JP |
| 1005 |
@code{data.queue}へと名前変更。@ref{Queue}参照。 |
| 1006 |
@c COMMON |
| 1007 |
@end deftp |
| 1008 |
|
| 1009 |
@deftp {Module} util.rbtree |
| 1010 |
@mdindex util.rbtree |
| 1011 |
@clindex rbtree |
| 1012 |
@findex make-rbtree |
| 1013 |
@findex rbtree? |
| 1014 |
@findex rbtree-copy |
| 1015 |
@findex rbtree-empty? |
| 1016 |
@findex rbtree-num-entries |
| 1017 |
@findex rbtree-exists? |
| 1018 |
@findex rbtree-get |
| 1019 |
@findex rbtree-put! |
| 1020 |
@findex rbtree-delete! |
| 1021 |
@findex rbtree-update! |
| 1022 |
@findex rbtree-push! |
| 1023 |
@findex rbtree-pop! |
| 1024 |
@findex rbtree-min |
| 1025 |
@findex rbtree-max |
| 1026 |
@findex rbtree-extract-min! |
| 1027 |
@findex rbtree-extract-max! |
| 1028 |
@findex rbtree-fold |
| 1029 |
@findex rbtree-fold-right |
| 1030 |
@findex rbtree-keys |
| 1031 |
@findex rbtree-values |
| 1032 |
@findex rbtree->alist |
| 1033 |
@findex alist->rbtree |
| 1034 |
@c EN |
| 1035 |
Incorporated into the core as built-in object @code{<tree-map>}. |
| 1036 |
@xref{Treemaps}. |
| 1037 |
@c JP |
| 1038 |
コアに吸収され、組み込みオブジェクト@code{<tree-map>}になりました。 |
| 1039 |
@ref{Treemaps}参照。 |
| 1040 |
@c COMMON |
| 1041 |
|
| 1042 |
@c EN |
| 1043 |
The following procedures are aliases of the ones with replacing |
| 1044 |
@code{rbtree} for @code{tree-map}, e.g. @code{rbtree-get} is |
| 1045 |
the same as @code{tree-map-get}. |
| 1046 |
@c JP |
| 1047 |
以下の手続きは、@code{rbtree}を@code{tree-map}に変えた手続きの別名と |
| 1048 |
なっています。例えば@code{rbtree-get}は@code{tree-map-get}と同じです。 |
| 1049 |
@c COMMON |
| 1050 |
|
| 1051 |
@example |
| 1052 |
make-rbtree rbtree? rbtree-get rbtree-put! |
| 1053 |
rbtree-delete! rbtree-exists? rbtree-empty? rbtree-update! |
| 1054 |
rbtree-push! rbtree-pop! rbtree-num-entries rbtree->alist |
| 1055 |
alist->rbtree rbtree-keys rbtree-values rbtree-copy |
| 1056 |
rbtree-fold rbtree-fold-right |
| 1057 |
@end example |
| 1058 |
|
| 1059 |
@c EN |
| 1060 |
The following procedures are similar to @code{tree-map-min}, |
| 1061 |
@code{tree-map-max}, @code{tree-map-pop-min!} and @code{tree-map-pop-max!}, |
| 1062 |
respectively, except that the @code{rbtree-*} version takes an optional |
| 1063 |
default argument and returns it when the tree is empty, and raise an |
| 1064 |
error if no default argument is provided and tree is empty. (The tree-map |
| 1065 |
version just returns @code{#f} for the empty tree.) |
| 1066 |
@c JP |
| 1067 |
以下の手続きはそれぞれ@code{tree-map-min}、@code{tree-map-max}、 |
| 1068 |
@code{tree-map-pop-min!}、@code{tree-map-pop-max!}とほぼ同じですが、 |
| 1069 |
省略可能なデフォルト引数を取り、tree-mapが空の時にそれを返す点が異なります。 |
| 1070 |
デフォルト引数が与えられなければ空のtree-mapに対してはエラーを投げます。 |
| 1071 |
(@code{tree-map-min}等は、tree-mapが空の場合には@code{#f}を返します)。 |
| 1072 |
@c COMMON |
| 1073 |
|
| 1074 |
@example |
| 1075 |
rbtree-min rbtree-max |
| 1076 |
rbtree-extract-min! rbtree-extract-max! |
| 1077 |
@end example |
| 1078 |
|
| 1079 |
@c EN |
| 1080 |
The following procedure doesn't have corresponding API in tree-map. |
| 1081 |
It checks internal consistency of the given tree-map. |
| 1082 |
@c JP |
| 1083 |
以下の手続きはtree-mapに相当する手続きを持ちません。これは与えられたtree-mapの |
| 1084 |
内部整合性を検査する手続きです。 |
| 1085 |
@c COMMON |
| 1086 |
|
| 1087 |
@example |
| 1088 |
rbtree-check |
| 1089 |
@end example |
| 1090 |
@end deftp |
| 1091 |
|
| 1092 |
@deftp {Module} util.sparse |
| 1093 |
@mdindex util.sparse |
| 1094 |
@c EN |
| 1095 |
Renamed to @code{data.sparse}. @xref{Sparse data containers}. |
| 1096 |
@c JP |
| 1097 |
@code{data.sparse}へと名前変更。@ref{Sparse data containers}参照。 |
| 1098 |
@c COMMON |
| 1099 |
@end deftp |
| 1100 |
|
| 1101 |
@deftp {Module} util.trie |
| 1102 |
@mdindex util.trie |
| 1103 |
@c EN |
| 1104 |
Renamed to @code{data.trie}. @xref{Trie}. |
| 1105 |
@c JP |
| 1106 |
@code{data.trie}へと名前変更。@ref{Trie}参照。 |
| 1107 |
@c COMMON |
| 1108 |
@end deftp |
| 1109 |
|
| 1110 |
@c EN |
| 1111 |
@subheading Superseded modules |
| 1112 |
@c JP |
| 1113 |
@subheading 置き換えられたモジュール |
| 1114 |
@c COMMON |
| 1115 |
|
| 1116 |
@c Note: Don't use mdindex below, for the entries of these modules |
| 1117 |
@c are still in the modsrfi.texi. |
| 1118 |
|
| 1119 |
@deftp {Module} srfi.1 |
| 1120 |
@c EN |
| 1121 |
SRFI-1 (List library) has become a part of R7RS large, as @code{scheme.list}. |
| 1122 |
@xref{R7RS lists}. |
| 1123 |
@c JP |
| 1124 |
SRFI-1(リストライブラリ)はR7RS largeに採り入れられ、 |
| 1125 |
@code{scheme.list}モジュールになりました。 |
| 1126 |
@ref{R7RS lists}を参照してください。 |
| 1127 |
@c COMMON |
| 1128 |
@end deftp |
| 1129 |
|
| 1130 |
@deftp {Module} srfi.14 |
| 1131 |
@c EN |
| 1132 |
SRFI-14 (Character-set library) has become a part of R7RS large, |
| 1133 |
as @code{scheme.charset}. |
| 1134 |
@xref{R7RS character sets}. |
| 1135 |
@c JP |
| 1136 |
SRFI-14(文字集合ライブラリ)はR7RS largeに採り入れられ、 |
| 1137 |
@code{scheme.charset}モジュールになりました。 |
| 1138 |
@ref{R7RS character sets}を参照してください。 |
| 1139 |
@c COMMON |
| 1140 |
@end deftp |
| 1141 |
|
| 1142 |
@deftp {Module} srfi.43 |
| 1143 |
@c EN |
| 1144 |
Vector library (Legacy) - |
| 1145 |
this module is effectively superseded by R7RS and @code{srfi.133}. |
| 1146 |
@xref{Vectors}, and @pxref{R7RS vectors}. |
| 1147 |
@c JP |
| 1148 |
ベクタライブラリ(旧式) - |
| 1149 |
このモジュールは実効的に、R7RSと@code{srfi.133}に取って代わられています。 |
| 1150 |
@ref{Vectors}と@ref{R7RS vectors}参照。 |
| 1151 |
@c COMMON |
| 1152 |
@end deftp |
| 1153 |
|
| 1154 |
@deftp {Module} srfi.60 |
| 1155 |
@c EN |
| 1156 |
Integers as bits - this module is superseded by @code{srfi.151}. |
| 1157 |
@xref{R7RS bitwise operations}. |
| 1158 |
@c JP |
| 1159 |
整数に対するビット操作 - このモジュールは@code{srfi.151}に取って代わられています。 |
| 1160 |
@ref{R7RS bitwise operations}参照。 |
| 1161 |
@c COMMON |
| 1162 |
@end deftp |
| 1163 |
|
| 1164 |
@deftp {Module} srfi.69 |
| 1165 |
@c EN |
| 1166 |
Basic hash tables - this module is superseded by R7RS @code{scheme.hash-table}. |
| 1167 |
@xref{R7RS hash tables}. |
| 1168 |
@c JP |
| 1169 |
基本的なハッシュテーブル - このモジュールはR7RSの@code{scheme.hash-table}に |
| 1170 |
取って代わられています。 |
| 1171 |
@ref{R7RS hash tables}参照。 |
| 1172 |
@c COMMON |
| 1173 |
@end deftp |
| 1174 |
|
| 1175 |
@deftp {Module} srfi.111 |
| 1176 |
@c EN |
| 1177 |
SRFI-111 (Boxes) has become a part of R7RS @code{scheme.box} module. |
| 1178 |
@xref{R7RS boxes}. |
| 1179 |
@c JP |
| 1180 |
SRFI-111 (ボックス) はR7RS largeの@code{scheme.box}モジュールになりました。 |
| 1181 |
@ref{R7RS boxes}を参照してください。 |
| 1182 |
@c COMMON |
| 1183 |
@end deftp |
| 1184 |
|
| 1185 |
@deftp {Module} srfi.113 |
| 1186 |
@c EN |
| 1187 |
SRFI-113 (Sets and bags) has become a part of R7RS @code{scheme.set}. |
| 1188 |
@xref{R7RS sets}. |
| 1189 |
@c JP |
| 1190 |
SRFI-113(setとbag)はR7RS largeの@code{scheme.set}モジュールになりました。 |
| 1191 |
@ref{R7RS sets}を参照してください。 |
| 1192 |
@c COMMON |
| 1193 |
@end deftp |
| 1194 |
|
| 1195 |
@deftp {Module} srfi.114 |
| 1196 |
@c EN |
| 1197 |
Comparators - R7RS favored SRFI-128 over this srfi |
| 1198 |
to make @code{scheme.comparator} (@ref{R7RS comparators}), |
| 1199 |
so adoption of this srfi may not be as wide. |
| 1200 |
|
| 1201 |
Note that, in Gauche, a native comparator object can be used for |
| 1202 |
SRFI-114 procedures, and this module provides some useful additional |
| 1203 |
utilities. It's ok to use this module if portability isn't a big issue. |
| 1204 |
@c JP |
| 1205 |
比較器 - R7RSは@code{scheme.comparator} (@ref{R7RS comparators}参照) |
| 1206 |
としてこれではなくSRFI-128を採用したので、将来このsrfiが広く採用されることは |
| 1207 |
ないかもしれません。 |
| 1208 |
|
| 1209 |
ただ、Gaucheでは組み込みの比較器オブジェクトをそのままSRFI-114の手続きにも |
| 1210 |
使うことが出来るので、ポータビリティが重要でないコードではユーティリティライブラリとして |
| 1211 |
このsrfiを使っても良いでしょう。 |
| 1212 |
@c COMMON |
| 1213 |
@end deftp |
| 1214 |
|
| 1215 |
@deftp {Module} srfi.117 |
| 1216 |
@c EN |
| 1217 |
SRFI-117 has become R7RS's @code{scheme.list-queue}. |
| 1218 |
@xref{R7RS list queues}. |
| 1219 |
@c JP |
| 1220 |
SRFI-117はR7RSの@code{scheme.list-queue}モジュールになりました。 |
| 1221 |
@ref{R7RS list queues}を参照してください。 |
| 1222 |
@c COMMON |
| 1223 |
@end deftp |
| 1224 |
|
| 1225 |
@deftp {Module} srfi.127 |
| 1226 |
@c EN |
| 1227 |
SRFI-127 has become R7RS's @code{scheme.lseq}. |
| 1228 |
@xref{R7RS lazy sequences}. |
| 1229 |
@c JP |
| 1230 |
SRFI-127はR7RSの@code{scheme.lseq}モジュールになりました。 |
| 1231 |
@ref{R7RS lazy sequences}を参照してください。 |
| 1232 |
@c COMMON |
| 1233 |
@end deftp |
| 1234 |
|
| 1235 |
@deftp {Module} srfi.132 |
| 1236 |
@c EN |
| 1237 |
SRFI-132 has become R7RS's @code{scheme.sort}. |
| 1238 |
@xref{R7RS sort}. |
| 1239 |
@c JP |
| 1240 |
SRFI-132はR7RSの@code{scheme.sort}モジュールになりました。 |
| 1241 |
@ref{R7RS sort}を参照してください。 |
| 1242 |
@c COMMON |
| 1243 |
@end deftp |
| 1244 |
|
| 1245 |
@deftp {Module} srfi.133 |
| 1246 |
@c EN |
| 1247 |
SRFI-133 has become R7RS's @code{scheme.vector}. |
| 1248 |
@xref{R7RS vectors}. |
| 1249 |
@c JP |
| 1250 |
SRFI-133はR7RSの@code{scheme.vector}モジュールになりました。 |
| 1251 |
@ref{R7RS vectors}を参照してください。 |
| 1252 |
@c COMMON |
| 1253 |
@end deftp |
| 1254 |
|
| 1255 |
@c Local variables: |
| 1256 |
@c mode: texinfo |
| 1257 |
@c coding: utf-8 |
| 1258 |
@c end: |