
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: ?⥸?塼???í¡¼?ɤ???mport???뤳?Ȥ?ɬ??Ǥ? 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: ???ξ??Ï¡????Υ⥸?塼???Ȥ??ˤ????äƤ??餫???????塼???í¡¼?ɤ?????code{use}???Ƥ???ɬ??Ϥ??????󡣤??Υ⥸?塼??«????Ȥ???????Ç¡? 26: ?⥸?塼?뤬??ưŪ?Ë¥í¡¼?ɤ??쥤????Ȥ????????????È¥í¡¼?ɤ??ܺ٤ˤĤ??Ƥ?ref{Autoload}?ò»²¾È¤??Ƥ???????? 27: @c COMMON 28: 29: @c EN 30: As the number of bundled libraries grows, it becomes harder 31: to find the one you need. If you feel lost, check 32: out the section @ref{Finding libraries you need}, in which 33: we categorized libraries by their purposes. 34: @c JP 35: ?°?饤?Ö¥??ο??ˤĤ졢ɬ??ʥ饤?Ö¥?????Τ?????? 36: ?ʤ??Ĥ?????????ä??é¡¢@ref{Finding libraries you need}???ƤߤƲ????????Ū?˹????ƥ饤?Ö¥??ò¥«¥Æ¥??饤?????Ƥ??Þ¤??? 37: @c COMMON 38: 39: @c EN 40: The following three chapters describe bundled modules, 41: grouped by their names. 42: @ref{Library modules - Gauche extensions} contains a description of 43: @code{gauche.*} modules, which are more or less considered 44: the core features of Gauche but separated since less frequently used. 45: (Some modules are rather ad-hoc, but here for historical reasons). 46: @ref{Library modules - SRFIs} describes the modules which 47: provide SRFI functionalities. They have the names beginning 48: with @code{srfi-}. 49: Note that some of SRFI features are built in Gauche core and 50: not listed here. @xref{Standard conformance}, for the entire list 51: of supported SRFIs. 52: @ref{Library modules - Utilities} describes other modules 53: ---including database interface, filesystem utilities, 54: network protocol utilities, and more. 55: @c JP 56: ???ξϤ????3?ĤξϤǡ??ƥ饤?Ö¥??ˤĤ??ƾܺ٤˵??Ò¤??Þ¤??? 57: ?ƾϤ????Ç¥??롼?ײ????????Þ¤??? 58: @ref{Library modules - Gauche extensions}?Ǥ?code{gauche.*}?Ȥ??? 59: ̾???ĥ⥸?塼???????Þ¤????????Ϥ???Ì£Gauche?δ??????ǽ?ʤΤǤ??????Ȥ?????????ʤ???????⥸?塼???ʤä??Ȥ??????Ǥ??? 60: (?????Ĥ??Υ⥸?塼??????Õ²???ʤ??Ǥ??????????ͳ???餳???ˤ?????)?? 61: @ref{Library modules - SRFIs}?Ǥ?RFI?ε?ǽ??????????塼?? 62: ?????Þ¤???@code{srfi-}?ǻϤޤ?????Þ¤??? 63: ?????Ĥ???RFI?ˤĤ??Ƥ?auche?Î¥?????Ȥ߹??ߤˤʤäƤ??뤿?á¡¢ 64: ???ξϤˤϸ????????Ȥ?????Ƥ???????????Ý¡??Ȥ???????FI??????ʥꥹ?ȤˤĤ??Ƥ?ref{Standard conformance}?ò¸«¤Æ²??????? 65: @ref{Library modules - Utilities}?ǤϻĤ??⥸?塼?? 66: ?Ĥ???????Þ¤????Ç¡????Ù¡??????󥿥ե????????Õ¥????륷???ƥࡢ 67: ?ͥåȥ???×¥????ë¡¢?????????ʥ饤?Ö¥??????????? 68: @c COMMON 69: 70: @c EN 71: There are a few procedures that help your program to check 72: the existence of certain modules or libraries at run-time. 73: See @ref{Operations on libraries}, for the details. 74: @c JP 75: ?¹Ի??Ë¥×¥í¥°???????Υ⥸?塼???饤?Ö¥?????ߤò¸¡º??Ǥ?????????????Ĥ???????????Þ¤??? 76: ?ܤ?????ref{Operations on libraries}?ò»²¾È¤??Ʋ??????? 77: @c COMMON 78: 79: @menu 80: * Finding libraries you need:: 81: * Naming convention of libraries:: 82: @end menu 83: 84: @node Finding libraries you need, Naming convention of libraries, Library modules - Overview, Library modules - Overview 85: @section Finding libraries you need 86: @c NODE ɬ??ʥ饤?Ö¥??????? 87: 88: @c EN 89: Each module is named more or less after what it implements 90: rather than what it is implemented @emph{for}. If the module solves 91: one problem, both are the same. However, sometimes there 92: are multiple ways to solve a problem, or one implementation 93: of an algorithm can solve multiple different problems; thus 94: it is difficult to name the modules in problem-oriented 95: (or purpose-oriented) way. 96: @c JP 97: ?ƥ⥸?塼???ϳ??Ͳ???õ¤·¤Æ¤??뤫?ò¼¨¤??褦?????ˤʤäƤ??Æ¡? 98: @emph{???Τ???}???ʤäƤ??뤫?ϼ????Ƥ??Þ¤??󡣥⥸?塼?뤬?Ò¤??Ĥ??????????????ʤ???ϰ????Þ¤????????β??Ê£?ô¤¢¤???Ȥ⤢?????????ҤȤĤΥ??르?ꥺ????????Û¤??????Τ??Ω?Ĥ??Ȥ⤢?????????????äơ??⥸?塼?????ظ?(???뤤????????)????????뤳?ȤϺ???Ǥ??? 99: @c COMMON 100: 101: @c EN 102: Because of this, it may not be straightforward for a newcomer 103: to Gauche to find an appropriate Gauche module to solve your problem. 104: Since there may be multiple algorithms to do the job, 105: and each algorithm can be implemented in different modules. 106: @c JP 107: ?Ȥ????櫓?Ç¡?Gauche?ˤϤ????Õ¤??×¥í¥°???ˤȤä??????Τ?? 108: ???auche?⥸?塼?????Ĥ??????Ù£?ǤϤ??????󡣤??Ù¤????Ȥ???????륢?르?ꥺ??Ê£?ô¤¢¤ê¤¨?Þ¤????é¡¢???줾?????르?ꥺ????????⥸?塼????õ¤µ¤????Þ¤??? 109: @c COMMON 110: 111: @c EN 112: The modules are also designed in layers; some low-level modules 113: provide direct interface to the system calls, while some 114: higher-level ones provide more abstract, easy-to-use interface, possibly 115: built on top of more than one low-level modules. Which one 116: should you use? Generally you want to use the highest level, 117: for the very purpose of libraries are to provide easy, abstract 118: interface. However there are times that you have to break 119: the abstraction and to go down to tweak the machinery in 120: the basement; then you need to use low-level modules directly. 121: @c JP 122: ?⥸?塼??????????????Þ¤????????ƥॳ?????????Î¥??󥿥ե????? 123: ??????????????塼????????Ê£????Ù¥????塼???Ȥä???????줿??????ݲ????????䤹?????Ù¥????塼???????????????ɤ??Ȥ??Ф褤?Ǥ??礦??????äȤ???????????Τ??褤?Ǥ???????䤵?????Ȥ?????٤ι⤤???󥿥ե?????????????????Τ??Þ¤????饤?Ö¥???????????????ȤϤ??????Ρ????ˤ??Ƥ????ɤ??֤äƤ??β??ˤ??뵡???????ǹߤ??????Ǥ??ʤ????Ȥ⤢???????? 124: ???????Ȥ??ˤ???Ù¥??⥸?塼??ľ??Ȥ?ɬ??????????? 125: @c COMMON 126: 127: @c EN 128: The purpose of this section is to group the libraries by 129: their purposes. Each category lists relevant modules with 130: brief descriptions. 131: @c JP 132: ?????Ǥϥ饤?Ö¥??ò¤½¤????ˤ??????äƥ??롼????????Þ¤????Æ¥??Æ¥?????Ȥ˴?????????塼???????????????ò¤·¤Æ¤??Þ¤??? 133: @c COMMON 134: 135: @menu 136: * Library directory - data containers:: 137: * Library directory - strings and characters:: 138: * Library directory - data exchange:: 139: * Library directory - files:: 140: * Library directory - processes:: 141: * Library directory - networking:: 142: * Library directory - input and output:: 143: * Library directory - time:: 144: * Library directory - bits and bytes:: 145: @end menu 146: 147: @node Library directory - data containers, Library directory - strings and characters, Finding libraries you need, Finding libraries you need 148: @subsection Library directory - data containers 149: @c NODE ?饤?Ö¥??Ç¥??쥯?È¥? ?Ç¡???????? 150: @c EN 151: @subsubheading Generic container operations 152: @c JP 153: @subsubheading ?????Í¥????Ê¥????? 154: @c COMMON 155: 156: @c EN 157: Some data containers have similar properties; for example, 158: lists, vectors and hash tables can be seen as a collection 159: of data. So it is handy to have generic operators, such 160: as applying a procedure to all the elements. 161: @c JP 162: ?÷¤¿¤è¤¦??????ĥǡ???????ʤ????????????Ȥ??С??ꥹ?È¡??Ù¥????? 163: ?ϥå??????Ö¥??Ç¡????Î¥??쥯?????Ȥ??Ƹ??뤳?Ȥ??Ǥ??Þ¤??????? 164: ???????٤Ƥ??Ǥ????Ǥ??????Ê¥????Í¥???????????????Ǥ??? 165: @c COMMON 166: 167: @c EN 168: Gauche provides such mechanism to a certain degree, mainly using 169: its object system. 170: @c JP 171: Gauche?Ǥϼ????Ö¥??????È¥????Æ¥??Ȥ????????Τ褦?ʵ????ò¤¢¤?? 172: ??Õ¤??????Þ¤??? 173: @c COMMON 174: 175: @c EN 176: @itemize @bullet 177: @item 178: @emph{Collection} - Generic functions applicable for unordered 179: set of values. @xref{Collection framework}. 180: @item 181: @emph{Sequence} - Generic functions applicable for ordered set 182: of values. @xref{Sequence framework}. 183: @item 184: @emph{Relation} - Generic functions to handle relations 185: (in a sense of Codd's definition). @xref{Relation framework}. 186: @item 187: @emph{Comprehension} - This is a collection of macros very handy 188: to construct and traverse collections/sequences in concise code. 189: @xref{Eager comprehensions}. 190: @end itemize 191: @c JP 192: @itemize @bullet 193: @item 194: @emph{???쥯????} - ????????Ƥ??ʤ??Ç¡????ν???????른???Í¥? 195: ???Ø¿?ref{Collection framework}???È¡? 196: @item 197: @emph{???????? - ??????????Ç¡????ν???????른???Í¥????Ø¿?@ref{Sequence framework}???È¡? 198: @item 199: @emph{????????} - (Codd????ˤ?)?????????????????? 200: ?Í¥????Ø¿?ref{Relation framework}???È¡? 201: @item 202: @emph{??ɽ??} - ???쥯?????䥷?????󥹤ι??????????????? 203: ?˽ñ¤¯¤????Þ¥??í½¸??@ref{Eager comprehensions}???È¡? 204: @end itemize 205: @c COMMON 206: 207: @c EN 208: @subsubheading Container implementations 209: @c JP 210: @subsubheading ????ʤμ?? COMMENT 211: 212: @c EN 213: @itemize @bullet 214: @item 215: @emph{List} - the universal data structure. You want to check 216: @ref{Pairs and Lists}, @ref{List library}, 217: and @ref{Additional list library}. 218: @item 219: @emph{Vector} - a one-dimensional array of arbitrary Scheme values. 220: See @ref{Vectors} and @ref{Vector library}. 221: @item 222: @emph{Uniform vector} - a special kind of vectors that can hold 223: limited types of values (e.g. integers representable in 8bits). 224: It tends to be used in performance 225: sensitive applications, such as graphics. See @ref{Uniform vectors}. 226: @item 227: @emph{Array} - multi-dimensional arrays that can hold 228: arbitrary Scheme values. See @ref{Arrays}. 229: @item 230: @emph{Uniform array} - multi-dimensional arrays that can hold 231: limited types of values. This is also supported by @ref{Arrays}. 232: @item 233: @emph{String} - a sequence of characters. See @ref{Strings} 234: and @ref{String library}. Gauche handles multibyte strings--- 235: see @ref{Multibyte Strings} for the defatils. 236: @item 237: @emph{Character set} - a set of characters. See @ref{Character set} 238: and @ref{Character-set library}. 239: @item 240: @emph{Hash table} - hash tables. See @ref{Hashtables}. There are 241: also some conversion functions in @ref{Additional list library}. 242: @item 243: @emph{Queue} - a simple queue is provided in @ref{Queue}. 244: @item 245: @emph{Record} - a simple data structure. Although Gauche's object 246: system can be used to define arbitrary data structures, you might 247: want to look at @ref{Record types} and @ref{SLIB-compatible record type}, 248: for they are more portable and potentially more efficient. 249: @item 250: @emph{Stream} - you can implement cool lazy algorithms with it. 251: See @ref{Stream library}. 252: @item 253: @emph{Balanced tree} - Red-black tree implementation is available. 254: See @ref{Red black tree}. 255: @item 256: @emph{Trie} - Another tree structure for efficient common-prefix 257: search. See @ref{Trie}. 258: @item 259: @emph{Database interface} - dbm interface can be used as a 260: persistent hash table; see @ref{Generic DBM interface}. 261: For generic RDBMS interface, see @ref{Database independent access layer}. 262: @end itemize 263: @c JP 264: @itemize @bullet 265: @item 266: @emph{?ꥹ?? - ???Ȥ????Ȥ??Ç¡?????¤?? 267: @ref{Pairs and Lists}??@ref{List library}?? 268: @ref{Additional list library}????Ã¥????Þ¤??礦?? 269: @item 270: @emph{?Ù¥???} - Ǥ?Õ¤?cheme??ͤ??????????????@ref{Vectors}?? 271: ??@ref{Vector library}?ò¸«¤Þ¤??礦?? 272: @item 273: @emph{???Õ¥?????????} - ??¤??줿????????Ȥ????ӥå????? 274: ???̤ʥ٥????????????Ã¥??ʤɥѥե????ޥ󥹤???ᤵ?????ץꥱ?? 275: ???????@ref{Uniform vectors}???È¡? 276: @item 277: @emph{??} - Ǥ?Õ¤?cheme?????????????@ref{Arrays}???È¡? 278: @item 279: @emph{???Õ¥??????} - ??¤??줿????ͤ??????????????? 280: @ref{Arrays}?Ç¥??Ý¡??Ȥ??????ë¡£ 281: @item 282: @emph{ʸ??- ʸ???????󥹡?@ref{Strings}???? 283: @ref{String library}???È¡?Gauche?Ǥϥޥ??Ð¥???????????Þ¤????ܺ??ˤĤ??Ƥ?ref{Multibyte Strings}?ò¸«¤Æ¤???????? 284: @item 285: @emph{ʸ??} - ʸ???ç¡£@ref{Character set}???? 286: @ref{Character-set library}???È¡? 287: @item 288: @emph{?ϥå??????Ö¥?- ?ϥå??????֥롣 @ref{Hashtables}???È¡??? 289: ???Ĥ???Ñ´??Ø¿?ref{Additional list library}?ˤ⤢?????? 290: @item 291: @emph{???塼} - ñ?????塼??ref{Queue}??Ѱդ??????Þ¤??? 292: @item 293: @emph{?쥳???? - ñ???Ç¡?????¤??Gauche?Î¥??Ö¥??????È¥????Æ¥??Ĥ???????դΥǡ?????¤???Ǥ??Þ¤?????@ref{Record types}???? 294: @ref{SLIB-compatible record type}????????⤤???Ǥ??礦??????? 295: ????Ý¡????Ö¥???Ψ?Ǥ??? 296: @item 297: @emph{???ȥ꡼??- ?????Ȥ???ٱ䥢?르?ꥺ?????Þ¡??Ȥ˼?????????@ref{Stream library}???È¡? 298: @item 299: @emph{Ê¿??? - ???????Ǥ??Þ¤???@ref{Red black tree}???È¡? 300: @item 301: @emph{?ȥ饤} - ????Ƭ??????θ??褤???¤?Ǥ???@ref{Trie}???È¡? 302: @item 303: @emph{?Ç¡????Ù¡??????󥿥ե?????} - dbm???󥿥ե??????????Ū?ϥå???Æ¡??Ö¥?????????Þ¤???@ref{Generic DBM interface}???È¡??????Í¥? 304: ????DBMS?ؤΥ??󥿥ե??????ˤĤ??Ƥϡ? 305: @ref{Database independent access layer}?ò¸«¤Æ¤???????? 306: @end itemize 307: @c COMMON 308: 309: @node Library directory - strings and characters, Library directory - data exchange, Library directory - data containers, Finding libraries you need 310: @subsection Library directory - string and character 311: @c NODE ?饤?Ö¥??Ç¥??쥯?È¥? ʸ??ʸ?? EN 312: Basic string operations are covered in 313: @ref{Strings} and @ref{String library}. 314: A string is also a sequence of characters, so you can 315: apply methods in @ref{Collection framework} and 316: @ref{Sequence framework}. 317: @c JP 318: ʸ???????ref{Strings}????@ref{String library}?Ç¥??С?????Ƥ??Þ¤???ʸ??ʸ???????󥹤Ǥ⤢?????Τǡ? 319: @ref{Collection framework}????@ref{Sequence framework}?Υ᥽?åɤ??????Ǥ??? 320: @c COMMON 321: 322: @c EN 323: Character and character set operations are covered in 324: @ref{Characters}, @ref{Character set}, and @ref{Character-set library}. 325: @c JP 326: ʸ????????????@ref{Characters}??@ref{Character set}??@ref{Character-set library}???? 327: ?С????Ƥ??Þ¤??? 328: @c COMMON 329: 330: @c EN 331: If you scan or build strings sequentially, do not use index 332: access. String ports (see @ref{String ports}) provides more efficient, 333: and elegant way. 334: @c JP 335: ʸ???Ƭ????????????ê¹½??????ꤹ?????Ï¥???Ã¥????ˤ? 336: ?????????Ϥ????ʤ??Þ¤??????????@ref{String ports}?????Ϥ??? 337: ???褤???쥬????󶡤??Ƥ??Þ¤??? 338: @c COMMON 339: 340: @c EN 341: You can use regular expressions to search and extract 342: character sequences from strings; see @ref{Regular expression}. 343: @c JP 344: ʸ?????????ò¸¡º÷¤·¤??ê¡¢?Ȥ??????ꤹ???????ɽ?????Ȥ? 345: ?Þ¤???@ref{Regular expression}???È¡? 346: @c COMMON 347: 348: @c EN 349: If you need to deal with low-level (i.e. byte-level) 350: representation of strings, @ref{Uniform vectors} has some 351: tools to convert strings and byte vectors back and forth. 352: @c JP 353: ʸ?????????Ȥ??ХХ??È¥???????ò°·¤?ɬ?????????ref{Uniform vectors}??????Ð¥??È¥Ù¥?????ߤ?Ñ´??ò¤ª¤??ʤ??Ä¡???????????? 354: @c COMMON 355: 356: @c EN 357: Are you dealing with a structure higher than a mere sequence 358: of characters? Then take a look at @code{text.*} modules. 359: @ref{Parsing input stream} has some basic 360: scanners. @ref{Transliterate characters} implements a 361: feature similar to Unix's @code{tr(1)}. 362: You can take @code{diff} of two texts; see 363: @ref{Calculate difference of text streams}. 364: And if you want to construct large text from string fragments, 365: do not use @code{string-append}---see @ref{Lazy text construction}. 366: @c JP 367: ʸ???ʤ륷?????󥹤??????ι?¤?ò°·¤??????ΤǤ???????????code{text.*}?⥸?塼?????Ƥ????????@ref{Parsing input stream}?ˤ?????Ê¥??????μ??Ѱդ??????Þ¤??? 368: @ref{Transliterate characters}??nix??code{tr(1)}?Ë»÷¤¿µ?ǽ??õ¤·¤????Þ¤???2?ĤΥƥ????Ȥ?code{diff}??뤳?Ȥ????Þ¤????????Ĥ??Ƥ?@ref{Calculate difference of text streams}?ò¸«¤Æ¤????????ʸ???? 369: ?????????????????????Τʤ顢@code{string-append}??äƤϤ??? 370: ?Þ¤???ref{Lazy text construction}???È¡? 371: @c COMMON 372: 373: @c EN 374: Last but not least, Gauche has support of various character 375: encoding schemes. See @ref{Character code conversion} for 376: the basic utilities. Most higher-level functions such as 377: @code{open-input-file} can take @code{:encoding} keyword argument 378: to perform character conversion implicitly. Also see 379: @ref{Multibyte scripts} if you write Scheme program in 380: non-ASCII characters. If you want to process Gauche source code 381: which may contain "encoding" magic comment, see @ref{Coding-aware ports}. 382: Gauche also has GNU gettext compatible module (@ref{Localized messages}) 383: if you need localization. 384: @c JP 385: ?????Ȥ??˺????????Gauche?Ϥ??Þ¤??Þ¤?????????Ç¥??ó¥°¤??Ý¡??Ȥ??Ƥ??Þ¤???????Ê´Ø¿?Ĥ??Ƥ?@ref{Character code conversion}?ò¸«¤Æ¤????????@code{open-input-file} 386: ?Τ褦?ʤ??Ȥ????δؿ?ۤȤ?Ï¡?@code{:encoding}??????ɰ??ꡢʸ??????ۤˤ????ʤ??Þ¤????ASCIIʸ??heme?Î¥×¥í¥°????ñ¤¤??????ˤ?ref{Multibyte scripts}?ò¸«¤Æ¤????????encoding???????Þ¥??Ã¥??????Ȥ??uche?Î¥??????????ɤ?ý¤·¤¿¤??ʤ?ref{Coding-aware ports}?ò¸«¤Æ¤??????????è²½??ɬ??ʤ顢Gaucne?ˤ?GNU gettext?ß´??Υ⥸?塼??ref{Localized messages})?⤢?????? 387: @c COMMON 388: 389: 390: @node Library directory - data exchange, Library directory - files, Library directory - strings and characters, Finding libraries you need 391: @subsection Library directory - data exchange 392: @c NODE ?饤?Ö¥??Ç¥??쥯?È¥? ?Ç¡????? 393: @c EN 394: Most useful programs need to communicate with outside world 395: (other programs or humans). That involves reading the external data 396: into your program understanding whatever format the data is in, and 397: also writing the data in the format the others can understand. 398: @c JP 399: ?ۤȤ?Î¥×¥í¥°???Ǥϳ???(¾?Î¥×¥í¥°???????È¥??ߥ????????? 400: ????????????????Ȥ??????Ȥϳ???Ç¡?????ß¹?????줬?ɤΤ褦???Õ¥????ޥåȤǽñ¤«¤????뤫??̤????ꡢ¾?Î¥×¥í¥°??????????Õ¥????ޥåȤǥǡ???????Ф????ꤹ?????????ȤǤ??? 401: @c COMMON 402: 403: @c EN 404: Lots of network-related external formats are defined in RFC, 405: and there are corresponding @code{rfc.*} module that handle 406: some of them. See @ref{RFC822 message parsing}, for example, 407: to handle the pervasive RFC2822 message format. 408: @c JP 409: ?ͥåȥ???Ë´?????ë³°??Õ¥????ޥåȤ??????FC?ǵ?????????ê¡¢?? 410: ???Τ????Ĥ???б?????C?⥸?塼??code{rfc.*})?????????????Ȥ? 411: ?Ф褯?????RFC2822?Î¥????????Õ¥????ޥåȤ??ˤ?@ref{RFC822 message parsing}?ò¸«¤Æ¤???????? 412: @c COMMON 413: 414: @c EN 415: When you exchange table-formatted data, one of the easiest way 416: may be the plain text, one row per line, and columns are separeted 417: by some specific characters (e.g. comma). See @ref{CSV tables} for 418: basic parser/writer for them. 419: @c JP 420: ɽ????Υǡ???????????ˤ??Ȥ???????ΰ???졼??? 421: ???Ȥΰ???б??????뤳?ȤǤ????????Æ¥???????ʸ????????? 422: ???Ȥ??С?????Ƕ????????????β?Ƚñ¤½Ð¤???δ???ˤĤ? 423: ?Ƥ?ref{CSV tables}?ò¸«¤Æ¤???????? 424: @c COMMON 425: 426: @c EN 427: Oh, and nowadays every business user wants XML, right? You know 428: they are just S-expressions with extra redundancy and pointy 429: parentheses. So why don't you read XML as if they're S-exprs, 430: process them with familiar cars and cdrs and maps, then write them 431: out with extra redundancy and pointy parens? 432: Module @code{sxml.ssax} (@ref{Functional XML parser}) 433: implements SAX XML parser, with which you 434: can parse XML and process them on the fly, or convert it to 435: SXML, S-expression XML. You can query SXML using 436: SXPath, an XPath counterparts of S-expression (@ref{SXML Query Language}). 437: You can output all kinds of XML and HTML using the SXML serializer 438: (@ref{Serializing XML and HTML from SXML}). 439: @c JP 440: ???ɤ??Î¥Ó¥??Í¥??桼????ML????????????ΤǤ??????????Ǥ??礦???Þ¤? 441: ??餬??????Τ???????Τ??餤???????ʤ?????é¡¢XML????????ɤ߹?????????? car ?Ȥ? cdr ?Ȥ? map ?Ǥ???礤?Ƚ??? 442: ?Ƥ??餤??????????ǽñ¤½Ð¤??Ф????Ǥ????? 443: @code{sxml.ssax}?⥸?塼??ref{Functional XML parser})??AX XML?Ñ¡??? 444: ?μ??????????Ȥ??С????Ƥ???XML?????????????????ê¡¢??????Ϥޤ???SXML(S??XML)??Ñ´????뤳?Ȥ????Þ¤???SXPath(XPath??б???????(@ref{SXML Query Language}))??ä?XML??????ȯ?Ô¤??뤳?Ȥ??? 445: ?Þ¤???SXML???ꥢ?饤??????С????٤Ƥμ???ML??ML???????????????Þ¤?(@ref{Serializing XML and HTML from SXML})?? 446: @c COMMON 447: 448: @c EN 449: It is planned that various file format handling routines would 450: be available as @code{file.*} modules, though we have none ready 451: yet. If you plan to write one, please go ahead and let us know! 452: @c JP 453: ???Þ¤??ޤʥե??????????ޥåȤ??롼???code{file.*}?Ȥ??? 454: ?⥸?塼???Ȥ??????ˤ??褦?Ȥ????ײ??????Ǥ??????Þ¤?ʤˤ?? 455: ?Ǥ??Ƥ??Þ¤??󡣤ҤȤļ?ʬ?ǽñ¤¤¤Æ¤????Ȥ????ͤ???????????ͤ????? 456: ?????Τǡ??????餻???????? 457: @c COMMON 458: 459: @node Library directory - files, Library directory - processes, Library directory - data exchange, Finding libraries you need 460: @subsection Library directory - files 461: @c NODE ?饤?Ö¥??Ç¥??쥯?È¥? ?Õ¥?????@c EN 462: Files and directories. Roughly speaking, there are two places 463: you want to look at. 464: @c JP 465: ?Õ¥????뤪???Ç¥??쥯?ȥꡣ???????äѤ˸???ȸ??????Ȥ???2?Õ½? 466: ???? 467: @c COMMON 468: 469: @c EN 470: @ref{Filesystems}, in the core, has 471: routines close to the underlying OS provides. If you have 472: experience with Unix system programming you'll find familiar 473: function names there. The @code{fcntl} functionality is 474: splitted to @code{gauche.fcntl} (@ref{Low-level file operations}), FYI. 475: @c JP 476: @ref{Filesystems}?Î¥????ʬ?ˤϲ??̤?S????????Ƥ????ᤤ?롼???????????Unix?Î¥????Æ¥??í¥°???󥰤ηи??????????褯??äƤ??? 477: ????Ф????Ȼפ??Ǥ??礦????ʤߤ?code{fcntl}?ε?ǽ??@code{gauche.fcntl} (@ref{Low-level file operations})?ˤ??????? 478: @c COMMON 479: 480: @c EN 481: Also you definitely want to look at @code{file.util} 482: (@ref{Filesystem utilities}), which implements higher-level 483: routines on top of system-level ones. 484: @c JP 485: ?Þ¤?????ʤ?@code{file.util}(@ref{Filesystem utilities})????????????Ǥ??礦???????????Æ¥??Ù¥??Ǽ?õ¤µ¤ì¤¿?⼡?????롼??󷲤Ǥ??? 486: @c COMMON 487: 488: 489: @node Library directory - processes, Library directory - networking, Library directory - files, Finding libraries you need 490: @subsection Library directory - processes 491: @c NODE ?饤?Ö¥??Ç¥??쥯?È¥? ?×¥í¥»?? 492: 493: @c EN 494: Process-related routines also come in two levels. 495: @c JP 496: ?×¥í¥»??????Υ롼????ĤΥ?????????????? 497: @c COMMON 498: 499: @c EN 500: The @code{gauche.process} module provides 501: high-level routines (@ref{High Level Process Interface}); 502: you can pipe the data into and out of child processes easily, for example. 503: @c JP 504: @code{gauche.process}?⥸?塼?????Ù¥??롼???ref{High Level Process Interface})??????Ƥ??Þ¤????????Ȥ??С??? 505: ?Ȥ??С??Ç¡?????×¥í¥»???Ȥδ֤ǥѥ??פ??뤳?Ȥ?????ˤǤ??Þ¤??? 506: @c COMMON 507: 508: @c EN 509: Gauche core provides the primitive @code{fork} and @code{exec} interface 510: as well as the convenient @code{system} call 511: (see @ref{Unix process management}). Use them when you want a precise 512: control over what you're doing. 513: @c JP 514: Gauche?????Ï¥×¥??Æ¥??Ö¤?code{fork}????@code{exec}?Î¥??󥿥ե????? 515: ????ode{system}??????ref{Unix process management}????Ʊ?? 516: ?????Ƥ??Þ¤????????????Ȥ????????í¡¼?뤷???????˻Ȥ??Ȥ褤?????礦?? 517: @c COMMON 518: 519: @node Library directory - networking, Library directory - input and output, Library directory - processes, Finding libraries you need 520: @subsection Library directory - networking 521: @c NODE ?饤?Ö¥??Ç¥??쥯?È¥? ?ͥåȥ?? 522: 523: @c EN 524: We have multi-layer abstraction here. At the bottom, we have 525: APIs corresponding to socket-level system calls. In the middle, 526: a convenience library that automates host name lookups, connection 527: and shutdown, etc. On top of them we have several modules that 528: handles specific protocols (e.g. http). 529: @c JP 530: ??????ݤ?ؤ?Ê£?ô¤¢¤??????Dz???Ǥϥ????åȥ????????ƥॳ?????б?????I?????????????ؤǤϥۥ?????β?????Í¥??????????? 531: ?È¥????ɤ???Ǥ??褦???????Ö¥??ˤʤäƤ??Þ¤????Ǿ????Ï¡????Ȥ???TTP?Τ褦?????×¥??????????????⥸?塼?뤬??????????Õ¤??????Þ¤??? 532: @c COMMON 533: 534: @c EN 535: The @code{gauche.net} module (@ref{Networking}) provides the bottom 536: and middle layer. For the top layer, look for @code{rfc.*} modules, 537: e.g. @code{rfc.http} (@ref{HTTP}). 538: More protocol support is coming (there are @code{rfc.ftp} and 539: @code{rfc.imap4} written by users, which are waiting for being 540: integrated into Gauche---maybe in next release). 541: @c JP 542: @code{gauche.net}?⥸?塼??ref{Networking})?ϺDz??????????? 543: ?Ƥ??Þ¤????Ǿ??ˤĤ??Ƥ?code{rfc.*}?⥸?塼??õ???ƤߤƲ??????? 544: ???Ȥ???@code{rfc.http} (@ref{HTTP})?Ǥ??? 545: ??????Î¥×¥??????Ĥ??Ƥ????????Ý¡??Ȥ???ͽ??Ǥ??? 546: @code{rfc.ftp}??ode{rfc.imap4}?Ϥ??Ǥ˥桼????ý¡¹¤¬½ñ¤¤¤Æ¤??????Æ¡? 547: Gauche?ˤȤꤳ?Þ¤??Τ?äƤ?????ˤ????????????餯???Î¥????? 548: ?????Ǥ??礦?? 549: @c COMMON 550: 551: @c EN 552: There's a plan of even higher level of libraries, under the name 553: @code{net.*}, which will abstract more than one network protocols. 554: The planned ones include sending emails, or 555: universal resource access by uri. Code contributions are welcome. 556: @c JP 557: ????Ê£??×¥???????ݲ?????code{net.*}?Ȥ???̾??Τ????⼡??Ù¥??饤?Ö¥??ηײ?????????email??÷¿®¤??뤤??RI?ˤ??꥽???? 558: ?????????ʤɤηײ褬?????????????ɤι׸??Ï´??Þ¤??Þ¤??? 559: @c COMMON 560: 561: @node Library directory - input and output, Library directory - time, Library directory - networking, Finding libraries you need 562: @subsection Library directory - input and output 563: @c NODE ?饤?Ö¥??Ç¥??쥯?È¥? ???? 564: @node Library directory - time, Library directory - bits and bytes, Library directory - input and output, Finding libraries you need 565: @subsection Library directory - time 566: @c NODE ?饤?Ö¥??Ç¥??쥯?È¥? ???? 567: @node Library directory - bits and bytes, , Library directory - time, Finding libraries you need 568: @subsection Library directory - bits and bytes 569: @c NODE ?饤?Ö¥??Ç¥??쥯?È¥? ?ӥåȤȥХ??? 570: @c EN 571: @subsubheading Binary I/O 572: @c JP 573: @subsubheading ?Ð¥??Ê¥????@c COMMON 574: 575: @c EN 576: As the bottom level, 577: Gauche includes primitive byte I/O (@code{read-byte}, @code{write-byte}) 578: as well as block I/O (@code{read-block!}, @code{write-block}) in its core. 579: (See @ref{Reading data}, @ref{Output}, and @ref{Uvector block I/O}). 580: @c JP 581: ?Dz???Ȥ???auche?Ï¥????Ë´Þ¤Þ¤??Ö¥???????@code{read-block!} 582: ??@code{write-block})???????Ð¥??????ϤΥץ??Æ¥???(@code{read-byte}??@code{write-byte})??????Þ¤? 583: (@ref{Reading data}??@ref{Output}??@ref{Uvector block I/O}?????? 584: @c COMMON 585: 586: @c EN 587: As the middle level, the module @code{binary.io} 588: (@ref{Binary I/O}) has routines to retrieve specific datatype 589: with optional endian specification. 590: @c JP 591: ???ؤȤ??Ƥϡ?@code{binary.io}(@ref{Binary I/O})?⥸?塼???????×¥????Ç¥????????????????Υǡ?????????????󤬤? 592: ?????? 593: @c COMMON 594: 595: @c EN 596: And as the top level, the module @code{binary.pack} 597: (@ref{Packing Binary Data}) allows packing and unpacking structured 598: binary data, a la Perl's @code{pack}/@code{unpack}. 599: @c JP 600: ?????ƺǾ??Ȥ??Ƥϡ?@code{binary.pack}(@ref{Packing Binary Data}) 601: ?⥸?塼?뤬???äơ???¤??ĥХ??Ê¥??????Υѥå???????Ã¥???? 602: ?ˤ??Ƥ??Þ¤???Perl?Ǥ???@code{pack}/@code{unpack}?Ǥ??? 603: @c COMMON 604: 605: @c EN 606: @subsubheading Bit manipulation 607: @c JP 608: @subsubheading ?ӥå?? 609: @c COMMON 610: 611: @c EN 612: Gauche core provides bitshift and mask operations. 613: See @ref{Bitwise operations}. 614: @c JP 615: Gauche?????ϥӥåȥ??եȤ????Þ¥????????????Ƥ??Þ¤??? 616: @ref{Bitwise operations}?ò¸«¤Æ¤???????? 617: @c COMMON 618: 619: @node Naming convention of libraries, ,Finding libraries you need, Library modules - Overview 620: @section Naming convention of libraries 621: @c NODE ?饤?Ö¥????̾??§ 622: 623: @c EN 624: The following table summarizes naming categories of the modules, 625: including external ones and planned ones. 626: @c JP 627: ??????Ï¡??⥸?塼??̾?????????ò¼¨¤??Þ¤??? 628: ????⥸?塼?ë¡¢?Ú¤Ó¾??ͽ????????????塼???ޤߤޤ??? 629: @c COMMON 630: 631: @table @code 632: @item binary.* 633: @c EN 634: Utilities to treat binary data. 635: @c JP 636: ?Ð¥??Ê¥??????ò°·¤??????桼?Æ¥??????? 637: @c COMMON 638: 639: @item compat.* 640: @c EN 641: Provides compatibility layers. 642: @c JP 643: ?ß´???Τ????쥤??????? 644: @c COMMON 645: 646: @item dbi.*, dbd.* 647: @c EN 648: Database independent interface layer and drivers. 649: @c JP 650: ?Ç¡????Ù¡????Ω???󥿥ե???????ȥɥ饤?С??? 651: @c COMMON 652: 653: @item dbm.* 654: @c EN 655: DBM interface 656: @c JP 657: DBM???󥿥ե????? 658: @c COMMON 659: 660: @item gauche.* 661: @c EN 662: Stuffs more or less considered as Gauche core features. 663: @c JP 664: Gauche???ΰ??Ȥ??ƹͤ????Ƥ??뵡ǽ?? 665: @c COMMON 666: 667: @item gl.* 668: @c EN 669: OpenGL binding and related libraries (external package). 670: @c JP 671: OpenGL?Ð¥?????󥰤ȴ?????????Ö¥? (????ѥå?????)?? 672: @c COMMON 673: 674: @item gtk.* 675: @c EN 676: GTk+ binding and related libraries (external package). 677: @c JP 678: GTk+?Ð¥?????󥰤ȴ?????????Ö¥? (????ѥå?????)?? 679: @c COMMON 680: 681: @item file.* 682: @c EN 683: Manipulating files and directories. 684: @c JP 685: ?Õ¥??????Ç¥??쥯?È¥???î¡£ 686: @c COMMON 687: 688: @item lang.* 689: @c EN 690: Language-related libraries, artificial and/or natural (planned). 691: @c JP 692: ????ؤ??????Ö¥?(?͹?Ū?ʤ??⼫????Ï¢???(ͽ?) 693: @c COMMON 694: 695: @item math.* 696: @c EN 697: Mathematics. 698: @c JP 699: ??? 700: @c COMMON 701: 702: @item compat.* 703: @c EN 704: Compatibility libraries 705: @c JP 706: ¾?μ??Î¥????Ó¥????˴ؤ??????Ö¥??? (ͽ?) 707: @c COMMON 708: 709: @item rfc.* 710: @c EN 711: Implementations of net protocols defined in RFC's. 712: @c JP 713: RFC????????????????Õ¥????ޥåȤ??åȥ???×¥????????@c COMMON 714: 715: @item srfi-* 716: @c EN 717: SRFI implementations. 718: @c JP 719: SRFI?μ?? COMMON 720: 721: @item sxml.* 722: @c EN 723: SXML libraries. 724: @c JP 725: SXML?饤?Ö¥??? 726: @c COMMON 727: 728: @item text.* 729: @c EN 730: Libraries dealing with text data. 731: @c JP 732: ?Æ¥????ȥǡ????ò°·¤??饤?Ö¥? 733: @c COMMON 734: 735: @item util.* 736: @c EN 737: Generic implementations of various algorithms. 738: @c JP 739: ??Ū?Ê¥??르?ꥺ?????@c COMMON 740: 741: @item www.* 742: @c EN 743: Implementations of various protocols and formats mainly used in WWW. 744: @c JP 745: WWW?Ǽ????ƻȤ??????????Ç¡????Õ¥????ޥåȤμ??@c COMMON 746: @end table