(linenum→info "unix/slp.c:2238")

gauche/0.8.12/doc/intro.texi

    1: @node Introduction, Concepts, Top, Top
    2: @chapter Introduction
    3: @c NODE ?Ϥ???
    4: 
    5: @c EN
    6: This is a users' guide and reference manual of
    7: the Gauche Scheme system.
    8: Here I tried to describe the implementation precisely,
    9: sometimes referring to background design choices.
   10: @c JP
   11: ???auche Scheme system?˴ؤ??롢?桼???Τ????????ɤ??????????Ǥ????ʤ???Gauche?μ????Τ˵??Ҥ??뤳?Ȥ?Ū?Ȥ??ơ????ˤ?طʤȤʤ??׾????????????Ƥ??ޤ???
   12: @c COMMON
   13: 
   14: @c EN
   15: The target readers are those who already know Scheme and
   16: want to write useful programs in Gauche.
   17: For those who are new to Scheme, it'll be easier to start
   18: from some kind of tutorial.  I'm planning to write one.
   19: @c JP
   20: ???????äơ???heme??äƤ???auche?????ǽ??Ѥ????×¥í¥°??????????Ȥ?????Ô¤?ݤˤ??Ƥ??Þ¤???
   21: Scheme?˿????Τ????Ƥ?ɼԤϡ????餫?Υ?塼?ȥꥢ??ʻ?????
   22: ????Ǥ??礦???????????塼?ȥꥢ????????????Ĥ??Ǥ???
   23: @c COMMON
   24: 
   25: @c EN
   26: This manual only deals with Scheme side of things.  Gauche has
   27: another face, a C interface.   Details of it will be discussed
   28: in a separate document to be written.
   29: Those who wants to use Gauche as an embedded language, or wants
   30: to write an extension, need that volume.
   31: @c JP
   32: ???Υޥ˥奢???ϡ?Gauche??cheme??????Ƥ?̤Τߤ򰷤??ޤ???
   33: Gauche????줫???٤???ꥹ?Ƚ??饤?֥??Ȥ??Ƥ??????äƤ??ޤ?????
   34: ??????ɥ?????Dz??????Ǥ???Gauche??߹??߸?????ƻȤ???????
   35: ?⤷????auche??????????????Ȥ?????ԤϤ??Υɥ??????ɬ??Ȥʤ?????
   36: @c COMMON
   37: 
   38: @c EN
   39: For the Scheme side, I tried to make this manual self-contained
   40: for the reader's convenience, i.e. as far as you want to look up
   41: Gauche's features you don't need to refer to other documents.
   42: For example, description of functions defined in the standard
   43: documents are included in this manual, instead of saying
   44: ``see the standard document''.   However, this document is not a verbatim
   45: copy of the standard documents; sometimes I omit detailed
   46: discussions for brevity.
   47: I put pointers to the original documents, so please consult them if you
   48: need to refer to the standards.
   49: @c JP
   50: Scheme??????Ƥ????˴ؤ??Ƥϡ??ʤ??????Υޥ˥奢????ե??????Ȥ??Ƥ????­???褦?˵??Ҥ??ޤ?????ɸ?????????????⡢??????ޥ˥奢???????Ȥ??Τ????ʻ??뤳?Ȥ??Ǥ??ޤ???â???????Υޥ˥奢??ɸ????ؤ??ˤ??ʤ????󡣵??Ҥ?????뤿????Ū??طʤʤɤϾ?????Ƥ???????
   51: ???ꥸ?ʥ??ɥ?????ؤΥݥ??󥿤򻲹?????ι??夲?Ƥ????ޤ????Τǡ?
   52: ɬ??˱????ƻ??Ȥ??Ʋ???????
   53: @c COMMON
   54: 
   55: @c EN
   56: If you're reading this document off-line, you may find the most
   57: recent version on the web:
   58: @c JP
   59: ?⤷???ʤ??????Υޥ˥奢?????ե饤??ɤ?????顢
   60: ??????????RL????å????ƤߤƲ????????????????뤫?⤷??????@c COMMON
   61: @example
   62: @uref{http://practical-scheme.net/gauche/}.
   63: @end example
   64: 
   65: @c JP
   66: ?ʤ?????ޥ˥奢??????????ϡ?
   67: ??Æ£ ? ?á¡¢???? ??? ?????????Þ¤?????
   68: @c COMMON
   69: 
   70: @menu
   71: * Overview of Gauche::          
   72: * Notations::                   
   73: @end menu
   74: 
   75: @node Overview of Gauche, Notations, Introduction, Introduction
   76: @section Overview of Gauche
   77: @c NODE  Gauche?γ??
   78: 
   79: @c EN
   80: Gauche is a script interpreter based on Scheme.
   81: Gauche conforms the language standard
   82: "Revised^5 Report on the Algorithmic Language Scheme"
   83: (@ref{r5rs,[R5RS],R5RS}),
   84: and supports various common libraries defined in SRFIs
   85: (@uref{http://srfi.schemers.org}).
   86: @c JP
   87: Gauche??cheme?????????????ȥ??󥿥ץ꥿?Ǥ???
   88: Scheme???ɸ?????롢"Revised^5 Report on the Algorithmic Language Scheme"
   89: (@ref{r5rs,[R5RS],R5RS})?˽????Ƥ??ޤ????ޤ???SRFI
   90: (@uref{http://srfi.schemers.org}) ?˵??????????¿???Υ饤?֥????ݡ??Ȥ??Ƥ??ޤ???
   91: @c COMMON
   92: 
   93: @c EN
   94: The goal of Gauche is to provide a handy tool for
   95: programmers and system administrators to handle
   96: daily works conveniently and efficiently in the production environment.
   97: @c JP
   98: Gauche?Ï¡??×¥í¥°???䥷???Æ¥???Ô¤????ʤ????????????Scheme?ǽñ¤±¤????ˤ??뤳?Ȥ???Ȥ???߷פ??????Þ¤???
   99: @c COMMON
  100: 
  101: @c EN
  102: There are lots of Scheme implementations available, and each
  103: of them has its design emphasis and weaknesses.  Gauche is
  104: designed with emphasis on the following criteria.
  105: @c JP
  106: ???????????cheme?μ?õ¤¬¤?????????
  107: ???줾?????????û?꤬????????
  108: Gauche??Ĺ??????????????Ƥ????ϼ??Τ褦?ʥݥ???Ǥ???
  109: @c COMMON
  110: 
  111: @table @b
  112: @c EN
  113: @item Quick startup
  114: @c JP
  115: @item Ω?????®??????@c COMMON
  116: @c EN
  117: One of the situation Gauche is aiming at is in the production
  118: environment, where you write ten-lines throw-away script that
  119: may invoked very frequently.  This includes CGI scripts as well.
  120: Gauche includes a set of most common features in its executable,
  121: while splits less common stuffs into libraries which are to be loaded
  122: on demand, to make itself start quickly.
  123: @c JP
  124: Gauche???????Ƥ?????ΤҤȤĤϡ??ץ????????Ķ??Ǥ???ä?10?ԥ??????Ȥ?ä?????ơ????줬??????˸ƤФ??褦?ʥ??????Ǥ???
  125: CGI???????Ȥʤɤ⤽???Ǥ???
  126: Gauche?Ǥϡ?????????ȥ??????ȤȤ???ɤ??Ȥ??????ʵ?ǽ?˹ʤä??¹ԥե???????????륤?󤷡??Ȥ?ʬ???????????ǽ?????˱???????߹??????ˤ??Ƥ??ޤ???
  127: @c COMMON
  128: 
  129: @c EN
  130: @item Multibyte strings
  131: @c JP
  132: @item ?Þ¥??Ð¥??????c COMMON
  133: @c EN
  134: We can no longer live happily in ASCII-only or 1-byte-per-character world.
  135: The practical language implementations are required to handle
  136: multibyte (wide) characters.
  137: Gauche supports multibyte strings natively, providing robust and
  138: consistent support than @i{ad hoc} library-level implementation.
  139: @xref{Multibyte Strings}, for details.
  140: @c JP
  141: ʸ??1?Х??ȥ????????Τߤ򰷤äƤ???????ä?????ϲ᤮???ޤ?????
  142: ????Î¥×¥í¥°???ó¥°¥????Æ¥???????Ê¥??󥳡??Ç¥??󥰤ˤ??Þ¥??Ð¥????????
  143: ????˰????????????????
  144: Gauche???Ū???????ơ???????????????????󥳡??ǥ??󥰤??ޥ??Х?????????ư????ޤ????夫????­?????饤?֥????????ޥ??Х?????????ݡ??Ȥ??⡢??????????Х??Ȥ?????????ˤʤäƤ??ޤ???
  145: ?ܤ?????ref{Multibyte Strings}?򻲾Ȥ??Ƥ????????
  146: @c COMMON
  147: 
  148: @c EN
  149: @item Modular development
  150: @c JP
  151: @item ?⥸??????ȯ
  152: @c COMMON
  153: @c EN
  154: Gauche has a simple module system to separate namespaces,
  155: which allows the developers to work in parallel without
  156: worrying name collision.  
  157: @c JP
  158: Gauche???????????????⥸?塼?륷???ƥ?????Ƥ??ꡢ
  159: ̾??ξ?ͤ?ۤ?????????ȯ?Ԥ???Ԥ??ƺ??򤹤뤳?Ȥ??Ǥ??ޤ???
  160: @c COMMON
  161: 
  162: @c EN
  163: @item Integrated object system
  164: @c JP
  165: @item ??礵?줿???֥??????ȥ????ƥ?c COMMON
  166: @c EN
  167: A powerful CLOS-like object system with MetaObject protocol
  168: (mostly compatible with STklos and Guile) is provided.
  169: @c JP
  170: CLOS?饤???ʥ᥿???֥??????ȥץ??????????????ʥ??֥??????ȥ????ƥ????߹??????????STklos??ile?Υ??֥??????ȥ????ƥ????ʤ??????????????
  171: @c COMMON
  172: 
  173: @c EN
  174: @item System interface
  175: @c JP
  176: @item ?????ƥ।?󥿥ե?????
  177: @c COMMON
  178: @c EN
  179: Although Scheme abstracts lots of details of the machine,
  180: sometimes you have to bypass these high-level layers and
  181: go down to the basement to make things work.
  182: Gauche has built-in support of most of POSIX.1 system calls.
  183: Other modules, such as networking module, usually provide
  184: both high-level abstract interface and low-level interface
  185: close to system calls.
  186: @c JP
  187: Scheme?Ï·×»????ξܺ٤??????ݲ????Þ¤??????×¥í¥°??????Ƥ?????
  188: ?????ι??٥?????ѥ?????ϲ????˹ߤ??????ʤ????ʤ????褦?ʻ???
  189: ????????Gauche??OSIX.1?????ƥॳ?????ۤȤ??߹??ߤǥ??ݡ??Ȥ??ޤ???
  190: ?ޤ????ͥåȥ???󥰥⥸?塼??????Υ????ƥ?Ϣ?⥸?塼????
  191: ???٥??????ʥ??󥿥ե?????????٥??????ƥॳ?????ᤤ???󥿥ե??????????????ޤ???
  192: @c COMMON
  193: 
  194: @c EN
  195: @item Enhanced I/O
  196: @c JP
  197: @item ???????줿????@c COMMON
  198: @c EN
  199: No real application can be written without dealing with I/O.
  200: Scheme neatly abstracts I/O as a port, but defines least operations on it.
  201: Gauche uses a port object as a unified abstraction, providing
  202: utility functions to operate on the underlying I/O system.
  203: @xref{Input and output}, for the basic I/O support.
  204: @c JP
  205: ?ʪ?Υ??ץꥱ????????/O̵???Ǥ??????ޤ???Scheme??/O????ȤȤ??ƴʷ???ݲ????Ƥ??ޤ?????
  206: ɸ??Scheme?ˤϺ??????????????????ޤ???Gauche?ϥݡ??ȥ??֥??????Ȥ??ϤΤ?????礵?줿??ݲ????֥??????Ȥȹͤ???
  207: ????????Ʋ??̤?/O?????ƥ??˥??????????????ƥ??????ؿ?󶡤??Ƥ??ޤ???
  208: @ref{Input and output}?򻲾Ȥ??Ʋ???????
  209: @c COMMON
  210: @end table
  211: 
  212: @c EN
  213: On the other hand, Gauche is @emph{not} designed for 
  214: applications such like high-performance number cruncher or
  215: very large scale database handling.  It is an interpreter, after all.
  216: 
  217: You can still use Gauche as a "glue" language for such applications,
  218: however.  For example, you can write a performance-critical part 
  219: in another language that compiles to native code, and use Gauche to set up.
  220: @c JP
  221: ????Gauche?Ͻ????󥿥ץ꥿?Ǥ????顢??????η׻??򤳤ʤ??????ʥǡ??????åȤ򰷤ä??ꤹ???϶??Ǥ???
  222: 
  223: â???????Τ褦?ʾ??Ǥ⡢Gauche???????ͥ??ʤ??ָҡ׸???????Ȥ????Ȥϲ???Ǥ?????????ǽ??׵????????ʬ?ϥͥ??ƥ??֥????ɤ˥?????뤹????
  224: ?񤤤Ƥ????????åȥ??åפ?auche????Ȥ??ä??ˡ??????????
  225: @c COMMON
  226: 
  227: 
  228: @node Notations,  , Overview of Gauche, Introduction
  229: @section Notations
  230: @c NODE ɽ???ˤĤ???
  231: @c EN
  232: In this manual, each entry is represented like this:
  233: 
  234: @deftp {Category} foo arg1 arg2
  235: [spec] Description of foo @dots{}
  236: @end deftp
  237: @c JP
  238: ???Υޥ˥奢???ϡ??ƹ??ϼ??Τ褦?ʥե????ޥåȤ???????????ޤ???
  239: 
  240: @deftp {???Æ¥???foo arg1 arg2
  241: [spec] foo???
  242: @end deftp
  243: @c COMMON
  244: 
  245: @c EN
  246: @var{Category} denotes the category of the entry @b{foo}.
  247: The following category will appear in this manual:
  248: @c JP
  249: @var{???ƥ????Ϲ?@b{foo}?μ??򼨤??ޤ???
  250: ???Τ褦?ʥ??ƥ??꤬????????
  251: @c COMMON
  252: 
  253: @multitable @columnfractions .4 .6
  254: @item Function
  255: @c EN
  256: @tab A Scheme function.
  257: @c JP
  258: @tab Scheme????
  259: @c COMMON
  260: @item Special Form
  261: @c EN
  262: @tab A special form (in the R5RS term, ``syntax'').
  263: @c JP
  264: @tab ????? (R5RS?Ǥϡֹ?ʸ??
  265: @c COMMON
  266: @item Macro
  267: @c EN
  268: @tab A macro.
  269: @c JP
  270: @tab ?Þ¥???c COMMON
  271: @item Module
  272: @c EN
  273: @tab A module
  274: @c JP
  275: @tab ?⥸?塼??c COMMON
  276: @item Class
  277: @c EN
  278: @tab A class.
  279: @c JP
  280: @tab ???饹
  281: @c COMMON
  282: @item Generic Function
  283: @c EN
  284: @tab A generic function
  285: @c JP
  286: @tab ?????ͥ????ե??󥯥???
  287: @c COMMON
  288: @item Method
  289: @c EN
  290: @tab A method
  291: @c JP
  292: @tab ?᥽?å?@c COMMON
  293: @item Reader Syntax
  294: @c EN
  295: @tab A lexical syntax that is interpreted by the reader.
  296: @c JP
  297: @tab ?꡼??ˤ??Ʋ??????ʸ??
  298: @c COMMON
  299: @end multitable
  300: 
  301: @c EN
  302: For functions, special forms and macros, the entry may followed
  303: by one or more arguments.  In the argument list, the following notations
  304: may appear:
  305: @c JP
  306: ??????????????ޥ????ؤ??Ƥϡ????????????ͤ???????????
  307: ?????Ȥ???ϼ??Τ褦??????????????Ȥ?????????
  308: @c COMMON
  309: 
  310: @table @var
  311: @item arg @dots{}
  312: @c EN
  313: Indicates zero or more arguments.
  314: @c JP
  315: ?????ʾ???ѸĤΰ?
  316: @c COMMON
  317: @item &optional x y z
  318: @itemx &optional (x x-default) (y y-default) z
  319: @c EN
  320: Indicates it may take up to three optional arguments.
  321: The second form specifies default values.
  322: Note that Gauche doesn't really support Common-Lisp style
  323: @code{&optional} argument specifier in the lambda list.
  324: I use this notation since it is useful to indicate valid pattern of arguments.
  325: @c JP
  326: ???????ʰ?ɽ????????????ĤޤǤξ??????ʰ????????Ȥ򼨤??ޤ???
  327: 2???η???ǤϾ?????줿???δ??⼨???Ƥ??ޤ???
  328: ?????????ommonLisp?Υ????????ʤ??Ƥ??ޤ?????Gauche???Ȥ?????ꥹ?Ȥ?@code{&optional}?Τ褦????????????????ǤϤʤ????Ȥ?????Ƥ????????
  329: ?ޥ˥奢??ɽ????????뤿?????Τ褦?????????Ƥ??????Ǥ???
  330: @c COMMON
  331: @item &keyword x y z
  332: @itemx &keyword (x x-default) (y y-default) z
  333: @c EN
  334: Indicates it may take keyword arguments @var{x}, @var{y} and @var{z.}
  335: Note that Gauche doesn't really support Common-Lisp style
  336: @code{&keyword} argument specifier in the lambda list.
  337: I use this notation since it is useful to indicate valid pattern of arguments.
  338: @c JP
  339: ??????ɰ?ɽ???????????var{x}??@var{y}??@var{z}???ĤΥ?????ɰ?
  340: ?????Ȥ???????????2???η???ǤϾ?????줿???δ??⼨????????
  341: ?????????ommonLisp?Υ????????ʤ??Ƥ??ޤ?????Gauche???Ȥ?????ꥹ?Ȥ?@code{&keyword}?Τ褦????????????????ǤϤʤ????Ȥ?????Ƥ????????
  342: ?ޥ˥奢??ɽ????????뤿?????Τ褦?????????Ƥ??????Ǥ???
  343: @c COMMON
  344: @item &rest args
  345: @c EN
  346: Indicates it may take rest arguments.
  347: Note that Gauche doesn't really support Common-Lisp style
  348: @code{&rest} argument specifier in the lambda list.
  349: I use this notation since it is useful to indicate valid pattern of arguments.
  350: @c JP
  351: ?Ĥ????Ƥ??ꥹ?Ȥˤʤä?var{args}???????????Ȥ򼨤??ޤ???
  352: ?????????ommonLisp?Υ????????ʤ??Ƥ??ޤ?????Gauche???Ȥ?????ꥹ?Ȥ?@code{&rest}?Τ褦????????????????ǤϤʤ????Ȥ?????Ƥ????????
  353: ?ޥ˥奢??ɽ????????뤿?????Τ褦?????????Ƥ??????Ǥ???
  354: @c COMMON
  355: @end table
  356: 
  357: @c EN
  358: The description of the entry follows the entry line.
  359: If the specification of the entry comes from some standard or
  360: implementation, its origin is noted in the bracket at the beginning
  361: of the description.  The following origins are noted:
  362: @c JP
  363: ???????ιԤ?????ޤ????⤷????????????????Ƥ???????
  364: ???Ȥʤä?ɸ?ब???Τ褦?ʷ???Ǽ?????????
  365: @c COMMON
  366: 
  367: @table @asis
  368: @item [R5RS]
  369: @itemx [R5RS+]
  370: @c EN
  371: The entry works as specified in ``Revised^5 Report of Algorithmic Language
  372: Scheme.''.  If it is marked as "[R5RS+]", the entry has additional
  373: functionality.
  374: @c JP
  375: ???ι???5RS????????褦?????ޤ???"[R5RS+]"?ȥޡ?????????????
  376: R5RS?λ?ͤ˾??ß´??Ê·??ɲäε?ǽ????õ¤µ¤????뤳?Ȥò¼¨¤??Þ¤???
  377: @c COMMON
  378: @item [SRFI-@var{n}]
  379: @itemx [SRFI-@var{n}+]
  380: @c EN
  381: The entry works as specified in SRFI-@var{n}.  If it is marked as
  382: "[SRFI-@var{n}+]", the entry has additional functionality.
  383: @c JP
  384: ???ι???RFI-@var{n}????????褦?????ޤ???"[SRFI-@var{n}+]"?ȥޡ?????????????
  385: SRFI-@var{n}?λ?ͤ˾??ß´??Ê·??ɲäε?ǽ????õ¤µ¤????뤳?Ȥò¼¨¤??Þ¤???
  386: @c COMMON
  387: @item [POSIX]
  388: @c EN
  389: The API of the entry reflects the API specified in POSIX.
  390: @c JP
  391: ???ι???OSIX??PI??Ǥ??Ƥ??뤳?Ȥ򼨤??ޤ???
  392: @c COMMON
  393: @end table
  394: 
  395: @c @node Structure of this document,  , Notations, Introduction
  396: @c @section Structure of this document
  397: @c @c NODE ?????
  398: 
  399: @c @c EN
  400: @c @c JP
  401: @c @c COMMON
  402: 
Syntax (Markdown)