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

gauche/0.8.12/doc/modsrfi.texi

    1: @node Library modules - SRFIs, Library modules - Utilities, Library modules - Gauche extensions, Top
    2: @chapter Library modules - SRFIs
    3: @c NODE ?饤?֥??⥸?塼?? SRFI
    4: 
    5: @c EN
    6: This chapter lists modules that provides SRFI functionalities.
    7: Note that some of SRFI features are built in Gauche core and
    8: not listed here.  @xref{Standard conformance}, for entire list
    9: of supported SRFIs.
   10: @c JP
   11: ???ξϤǤ?RFI?ε?ǽ??????????塼???ꥹ?Ȥ??ޤ???
   12: ????RFI??auche?Υ?????Ȥ߹??ޤ????ꡢ
   13: ???ξϤˤϵ󤲤??Ƥ??ʤ????Ȥ?????Ʋ???????
   14: ???ݡ??Ȥ????????Ƥ?RFI?Υꥹ?Ȥ?ref{Standard conformance}?ˤ???????
   15: @c COMMON
   16: 
   17: @c ----------------------------------------------------------------------
   18: @menu
   19: * Feature conditional::         
   20: * List library::                
   21: * Homogeneous vectors::         
   22: * A compatible let form with signatures and rest arguments::  
   23: * Feature-based program configuration language::  
   24: * Record types::                
   25: * Let-values::                  
   26: * String library::              
   27: * Character-set library::       
   28: * Time data types and procedures::  
   29: * Sources of random bits::      
   30: * Localization::                
   31: * A program argument processor::  
   32: * Eager comprehensions::        
   33: * Vector library::              
   34: * Requiring extensions::        
   35: @end menu
   36: 
   37: @node Feature conditional, List library, Library modules - SRFIs, Library modules - SRFIs
   38: @section @code{srfi-0} - Feature conditional
   39: @c NODE ??ǽ???, @code{srfi-0} - ??ǽ???
   40: 
   41: @deftp {Module} srfi-0
   42: @mdindex srfi-0
   43: @c EN
   44: Provides SRFI-0 @code{cond-expand} macro form.
   45: Now this module is autoloaded when @code{cond-expand} is used,
   46: so you don't need to say @code{(use srfi-0)} explicitly.
   47: Portable programs can't use 'use' form anyway.
   48: @c JP
   49: ???Υ⥸?塼?? SRFI-0 ??@code{cond-expand} ?ޥ???????????ޤ???
   50: ???ß¡????Υ⥸?塼?? @code{cond-expand} ??Ѥ????Ȥ??Ë¡???ưŪ???í¡¼?ɤ??????Τǡ????Ū??@code{(use srfi-0)} ???ɬ??Ϥ????????Ý¡????Ö¥??×¥í¥°???ˤ????Ï¡?'use' ???????????????Ǥ??礦??
   51: @c COMMON
   52: @end deftp
   53: 
   54: @defmac cond-expand (feature-requirement command-or-definition @dots{}) @dots{}
   55: [SRFI-0]
   56: @c EN
   57: This macro expands to @var{command-or-definition} @dots{} if Gauche
   58: supports @var{feature-requirement}.
   59: In a way, it can be used to absorb the different feature sets supported by
   60: different Scheme implementations.
   61: 
   62: @var{feature-requirement} must be in the following syntax:
   63: @c JP
   64: Gauche ?? @var{feature-requirement} ?򥵥ݡ??Ȥ??Ƥ????????Υޥ???
   65: @var{command-or-definition} @dots{} ??????Þ¤???
   66: ?ۤ?heme ?μ?????ǽ?κ??ۤ??Τ˻Ȥ???????????礦??
   67: 
   68: @var{feature-requiremnt} ?ϰʲ??Τ褦?ʹ?ʸ?Ǥʤ????ʤ?????@c COMMON
   69: @example
   70: @var{feature-requirement}
   71:   : @var{feature-identifier}
   72:   | (and @var{feature-requirement} @dots{})
   73:   | (or  @var{feature-requirement} @dots{})
   74:   | (not @var{feature-requirement})
   75: @end example
   76: 
   77: @c EN
   78: @var{feature-identifier} is a symbol that indicates a feature.
   79: If such a feature is supported in Gauche, it satisfies the
   80: @var{feature-requirement}.  You can do boolean combination
   81: of @var{feature-requirement}s to compose more complex conditions.
   82: 
   83: The macro tests each @var{feature-requirement} in order, and
   84: if one is satisfied, the macro itself expands to the
   85: corresponding @var{command-or-definition} @dots{}.
   86: 
   87: The last clause may begin with a symbol @code{else} instead of
   88: @var{feature-requirement}.  If no condition is fulfilled before
   89: it, then the macro expands to the @var{command-or-definition}s
   90: of the else clause.  If there's no else clause and no condition
   91: is fulfilled, an error is signalled.
   92: 
   93: Currently, Gauche recognizes srfi names (e.g. @code{srfi-1})
   94: that it supports (@xref{Standard conformance}, for the list of
   95: supported SRFIs), and a symbol @code{gauche} as @var{feature-identifier}.
   96: 
   97: Suppose you are writing a program that requires srfi-13 (string library).
   98: In Gauche, the standard way to use srfi-13 is like this:
   99: @c JP
  100: @var{feature-identifier} ?ϵ?ǽ?򼨤?????????????뵡ǽ?? Gauche ?????ݡ??Ȥ????????顢??????@var{feature-requirement} ??????ޤ???
  101: ??ʣ???ʾ??????뤿????@var{feature-requirement} ?Υ֡??????
  102: ??߹???????뤳?Ȥ????????
  103: 
  104: ???Υޥ??? @var{feature-requirement} ??˥ƥ??Ȥ??????ΤҤȤĤ?
  105: ??????줿?顢???????var{command-or-definition} @dots{} ?????????????
  106: 
  107: ?Ǹ???ϡ?@var{feature-requirement} ?ǤϤʤ???@code{else} ?ǻϤ????Ȥ?Ǥ??ޤ????????????????줿????ʤ????ˤϡ????Υޥ??? else ???@var{command-or-definition} ??????????????⤷??else ????ʤ???
  108: ?????????᤬?ҤȤĤ??????????顼??ȯ????ޤ???
  109: 
  110: ???????Gauche ?Ǥϡ????ݡ??Ȥ???????RFI ?ε?ǽ?ϡ?srfi ̾
  111: (???Ȥ??С?@code{srfi-1})?Ǽ????????(???ݡ??Ȥ???????RFI ???Ĥ??Ƥ?@ref{Standard conformance} ?򻲾Ȥ??Ƥ??????)??
  112: ?ޤ????????code{gauche} ??var{feature-identifier} ?Ȥ??????????????
  113: 
  114: srfi-13 (ʸ?????Ö¥?)??פȤ????í¥°??????Ƥ??????Þ¤??礦??
  115: Gauche ?Ǥϡ?ɸ???ˤϡ??ʲ??Τ褦?ˤ??ޤ???
  116: @c COMMON
  117: 
  118: @example
  119: (use srfi-13)
  120: 
  121: @c EN
  122: ;; ... your program ...
  123: @c JP
  124: ;; ... ???ʤ??Î¥×¥í¥°?? ...
  125: @c COMMON
  126: @end example
  127: 
  128: @c EN
  129: However, the 'use' macro is Gauche specific and won't work
  130: on other Scheme implementations.  You can write instead:
  131: @c JP
  132: ????????????'use' ?ޥ??? Gauche ???ǡ?¾??Scheme ?μ???ư??ޤ?????˰ʲ??Τ褦?˽񤯤??Ȥ??Ǥ??ޤ???
  133: @c COMMON
  134: 
  135: @example
  136: (cond-expand
  137:   (srfi-13
  138: @c EN
  139:     ;; ... your program ...
  140: @c JP
  141:     ;; ... ???ʤ??Î¥×¥í¥°?? ...
  142: @c COMMON
  143:   ))
  144: @end example
  145: 
  146: @c EN
  147: If the implementation supports @code{srfi-13}, the form expands
  148: to your program.  Note that Gauche issues @code{(use srfi-13)}
  149: for you in this case.
  150: 
  151: The above form signals an error if the implementation doesn't support
  152: srfi-13.  However, you might want to run your program on such implementations
  153: as well, by providing alternative library definitions.
  154: @c JP
  155: ???μ??@code{srfi-13} ?ò¥µ¥Ý¡??Ȥ??Ƥ????????η???ϡ֤??ʤ????×¥í¥°???פ????????????Gauche ?Ǥϡ????ξ???????code{(use srfi-13)}??ӽФ??Þ¤???
  156: 
  157: ?嵭?Υե????????rfi-13?򥵥ݡ??Ȥ??Ƥ??ʤ??????顼?Ȥʤ?????
  158: ???Τ褦?ʼ??????í¥°????餻???????Ï¡?
  159: ???Ȥʤ????֥??????????????Ǥ??礦??
  160: @c COMMON
  161: 
  162: @example
  163: (cond-expand
  164:  (srfi-13
  165: @c EN
  166:    ;; ... your program ...
  167: @c JP
  168:    ;; ... ???ʤ??Î¥×¥í¥°?? ...
  169: @c COMMON
  170:  )
  171:  (else
  172:    (load "my-srfi-13-implementation")
  173: @c EN
  174:    ;; ... your program ...
  175: @c JP
  176:    ;; ... ???ʤ??Î¥×¥í¥°?? ...
  177: @c COMMON
  178:  ))
  179: @end example
  180: @end defmac
  181: 
  182: @c ----------------------------------------------------------------------
  183: @node List library, Homogeneous vectors, Feature conditional, Library modules - SRFIs
  184: @section @code{srfi-1} - List library
  185: 
  186: @deftp {Module} srfi-1
  187: @mdindex srfi-1
  188: @c EN
  189: SRFI-1 is a rich collection of list manipulation library
  190: (@ref{srfi-1,[SRFI-1],SRFI-1}).
  191: It is available by saying @code{(use srfi-1)}.
  192: The implementation is based on Olin Shivers's reference implementation.
  193: @c JP
  194: SRFI-1 ?ϡ??ꥹ????饤?֥??????ʥ??쥯?????Ǥ?
  195: (@ref{srfi-1,[SRFI-1],SRFI-1})??
  196: ???Υ饤?֥?????ˤϡ?@code{(use srfi-1)} ?Ȥ??Ʋ???????
  197: Olin Shivers????????????????Ƽ?õ¤µ¤????Þ¤???
  198: @c COMMON
  199: @end deftp
  200: 
  201: @menu
  202: * SRFI-1 List constructors::    
  203: * SRFI-1 List predicates::      
  204: * SRFI-1 List selectors::       
  205: * SRFI-1 List miscellaneous routines::  
  206: * SRFI-1 Fold::                 
  207: * SRFI-1 Filtering & Partitioning::  
  208: * SRFI-1 Searching::            
  209: * SRFI-1 Deletion::             
  210: * SRFI-1 Association lists::    
  211: * SRFI-1 Set operations::       
  212: @end menu
  213: 
  214: @node SRFI-1 List constructors, SRFI-1 List predicates, List library, List library
  215: @subsection List constructors
  216: @c NODE SRFI-1 ?ꥹ?ȹ???? ?ꥹ?Ȥι????
  217: @defun xcons cd ca
  218: @c EN
  219: [SRFI-1] Equivalent to @code{(cons ca cd)}.  Useful to pass to
  220: higher-order procedures.
  221: @c JP
  222: [SRFI-1] @code{(cons ca cd)} ?????Ǥ????ⳬ??????Ϥ??Τ?????
  223: @c COMMON
  224: @end defun
  225: 
  226: @defun cons* elt1 elt2 @dots{}
  227: @c EN
  228: [SRFI-1] Like @code{list}, but the last argument provides the tail of
  229: the constructed list.  This is just a synonym of Gauche built-in procedure
  230: @code{list*}.
  231: @c JP
  232: [SRFI-1] @code{list} ?Ȼ???ޤ??????Ǹ?????????줿?ꥹ?Ȥ????ˤʤ?????Gauche ??Ȥ߹??߼??? @code{list*} ????դǤ???
  233: @c COMMON
  234: @example
  235: (cons* 1 2 3 4) @result{} (1 2 3 . 4)
  236: (cons* 1) @result{} 1
  237: @end example
  238: @end defun
  239: 
  240: @defun list-tabulate n init-proc
  241: @c EN
  242: [SRFI-1] Constructs an @var{n}-element list, in which
  243: each element is generated by @code{(@var{init-proc} @i{i})}.
  244: @c JP
  245: [SRFI-1] @var{n}?Ĥ??Ǥ?ĥꥹ?Ȥ?ۤ??????줾??????ode{(@var{init-proc} @i{i})} ???????ޤ???
  246: @c COMMON
  247: @example
  248: (list-tabulate 4 values) @result{} (0 1 2 3)
  249: @end example
  250: @end defun
  251: 
  252: @defun circular-list elt1 elt2 @dots{}
  253: @c EN
  254: [SRFI-1] Constructs a circular list of the elements.
  255: @c JP
  256: [SRFI-1] ??ꤷ??????Ľ۴ĥꥹ?Ȥ?ۤ??ޤ???
  257: @c COMMON
  258: @example
  259: (circular-list 'z 'q) @result{} (z q z q z q @dots{})
  260: @end example
  261: @end defun
  262: 
  263: @defun iota count &optional (start 0) (step 1)
  264: @c EN
  265: [SRFI-1] Returns a list of numbers, starting from @var{start},
  266: increasing by @var{step}.
  267: @c JP
  268: [SRFI-1] @var{start}?????ޤꡢ@var{step}?????롢
  269: @var{count} ?Ĥ??Ǥ???????Υꥹ?Ȥ???ޤ???
  270: @c COMMON
  271: @example
  272: (iota 5) @result{} (0 1 2 3 4)
  273: (iota 5 0 -0.1) @result{} (0 -0.1 -0.2 -0.3 -0.4)
  274: @end example
  275: @end defun
  276: 
  277: @node SRFI-1 List predicates, SRFI-1 List selectors, SRFI-1 List constructors, List library
  278: @subsection List predicates
  279: @c NODE SRFI-1 ?ꥹ?ȤνҸ??ꥹ?ȤνҸ?@defun proper-list? x
  280: @c EN
  281: [SRFI-1] Returns @code{#t} if x is a proper list.
  282: @c JP
  283: [SRFI-1] @var{x} ??????ꥹ?ȤǤ??? @code{#t} ????ޤ???
  284: @c COMMON
  285: @end defun
  286: 
  287: @defun circular-list? x
  288: @c EN
  289: [SRFI-1] Returns @code{#t} if x is a circular list.
  290: @c JP
  291: [SRFI-1] @var{x} ???۴ĥꥹ?ȤǤ??? @code{#t} ????ޤ???
  292: @c COMMON
  293: @end defun
  294: 
  295: @defun dotted-list? x
  296: @c EN
  297: [SRFI-1] Returns @code{#t} if x is a finite, non-nil-terminated list.
  298: This includes non-pair, non-() values (e.g. symbols, numbers),
  299: which are considered to be dotted lists of length 0.
  300: @c JP
  301: [SRFI-1] @var{x} ??ͭ?¤?礭???ǡ?????Ȥǽ?ü???Ƥ??ʤ??ꥹ?Ȥʤ?code{#t} ????ޤ????????ϡ??ڥ??ǤϤʤ???????Ȥ????(???Ȥ???????????Τ褦?????0?Υɥåȥꥹ?Ȥȹͤ??????Τ?ߤޤ???
  302: @c COMMON
  303: @end defun
  304: 
  305: @defun null-list? list
  306: @c EN
  307: [SRFI-1] Returns @code{#t} if @var{list} is the empty list @code{()},
  308: and @var{#f} otherwise.
  309: @c JP
  310: [SRFI-1] @var{list} ???????@code{()} ?ʤ?code{#t} ????ޤ???
  311: ???????ΤȤ???@var{#f} ????ޤ???
  312: @c COMMON
  313: @end defun
  314: 
  315: @defun not-pair? x
  316: @c EN
  317: [SRFI-1] @code{(lambda (x) (not (pair? x)))}.
  318: 
  319: SRFI-1 says: Provided as a procedure as it can be useful as
  320: the termination condition for list-processing procedures that wish to
  321: handle all finite lists, both proper and dotted. 
  322: @c JP
  323: [SRFI-1] @code{(lambda (x) (not (pair? x)))}??????Ǥ???
  324: 
  325: SRFI-1 ?Ǥϡ??ֿ???ꥹ?Ȥ????ɥåȥꥹ?Ȥ????ǡ????٤Ƥ???¥ꥹ?Ȥ?????????ν?ü??Ȥ?????????Ѱդ????פȤ???????
  326: @c COMMON
  327: @end defun
  328: 
  329: @defun list= elt= list @dots{}
  330: @c EN
  331: [SRFI-1] Determines list equality by comparing every n-th element
  332: of given lists by the procedure @var{elt=}.
  333: 
  334: It is an error to apply @code{list=} to anything except proper lists.
  335: 
  336: The equality procedure must be consistent with @code{eq?}, i.e.
  337: @c JP
  338: [SRFI-1] @var{elt=} ????ơ?n?????Ǥ򤽤줾???Ӥ??뤳?Ȥǡ?
  339: Ϳ???????ꥹ?Ȥ??????ꤷ?ޤ???
  340: 
  341: @code{list=} ????ꥹ?Ȱʳ????????????顼?ˤʤ?????
  342: 
  343: Ʊ??Ƚ??μ?????@code{eq?} ????????ʤ????ʤ????󡣤??ʤ?
  344: @c COMMON
  345: @example
  346: (eq? x y) @result{} (elt= x y).
  347: @end example
  348: @end defun
  349: 
  350: @node SRFI-1 List selectors, SRFI-1 List miscellaneous routines, SRFI-1 List predicates, List library
  351: @subsection List selectors
  352: @c NODE SRFI-1 ?ꥹ?????? ?ꥹ??????
  353: @defun  first pair
  354: @defunx second pair
  355: @defunx third pair
  356: @defunx fourth pair
  357: @defunx fifth pair
  358: @defunx sixth pair
  359: @defunx seventh pair
  360: @defunx eighth pair
  361: @defunx ninth pair
  362: @defunx tenth pair
  363: @c EN
  364: [SRFI-1] Returns n-th element of the (maybe improper) list.
  365: @c JP
  366: [SRFI-1] ?ꥹ???????Ǥ?)???????Ǥ???ޤ???
  367: @c COMMON
  368: @end defun
  369: 
  370: @defun car+cdr pair
  371: @c EN
  372: [SRFI-1] Returns two values, @code{(car pair)} and @code{(cdr pair)}.
  373: @c JP
  374: [SRFI-1] @code{(car pair)} ???? @code{(cdr pair)} ????ͤ???ޤ???
  375: @c COMMON
  376: @end defun
  377: 
  378: @defun take x i
  379: @defunx drop x i
  380: @c EN
  381: [SRFI-1] @code{take} returns the first i elements of list x.
  382: @code{drop} returns all but the first i elements of list x. 
  383: @c JP
  384: [SRFI-1]
  385: @code{take} ?ϥꥹ??@var{x} ?κǽ?i?Ĥ??Ǥ???ޤ???
  386: @code{drop} ?ϥꥹ??@var{x} ?κǽ?i?Ĥ??Ǥ?????ꥹ?Ȥ???ޤ???
  387: @c COMMON
  388: @example
  389: (take '(a b c d e)  2) => (a b)
  390: (drop '(a b c d e)  2) => (c d e)
  391: @end example
  392: @c EN
  393: @var{x} may be any value:
  394: @c JP
  395: @var{x} ?Ϥ???????ꤨ?ޤ???
  396: @c COMMON
  397: @example
  398: (take '(1 2 3 . d) 2) => (1 2)
  399: (drop '(1 2 3 . d) 2) => (3 . d)
  400: (drop '(1 2 3 . d) 3) => d
  401: @end example
  402: @c EN
  403: @code{drop} is exactly equivalent to performing @var{i} cdr operations
  404: on @var{x}.  The returned value shares a common tail with @var{x}.
  405: On the other hand, take always allocates a new list 
  406: for result if the argument is a list of non-zero length.
  407: 
  408: An error is signalled if @var{i} is past the end of list @var{x}.
  409: @xref{Additional list library}, for more tolerant version
  410: of @code{take} and @code{drop}.
  411: 
  412: For generic subsequence extraction from any sequence, see @code{subseq}
  413: in @ref{Slicing sequence}.
  414: @c JP
  415: @code{drop} ??@var{x} ??@var{i} ??r ????????ʤ??Τ????
  416: Ʊ???Ǥ??????????ϡ?@var{x} ?ȶ??????????ޤ???????
  417: take ?ϡ????ꥹ?Ȥ?Ĺ??0?Ǥʤ??ꥹ?Ȥʤ??????????ꥹ?Ȥ??????ݤ??ޤ???
  418: 
  419: @var{i} ???ꥹ??@var{x} ?ν?ü??????饨?顼??ȯ????ޤ???
  420: ??????ʥС???????@code{take} ??@code{drop} ?ˤĤ??Ƥϡ?
  421: @xref{Additional list library} ?򻲾Ȥ??Ƥ????????
  422: 
  423: ???????Ӥ????ʬ??Ӥ?Ф????Ū???ؤ??Ƥϡ?
  424: @ref{Slicing sequence} ?ˤ???code{subseq} ?򻲾Ȥ??Ƥ????????
  425: @c COMMON
  426: @end defun
  427: 
  428: @defun take-right flist i
  429: @defunx drop-right flist i
  430: @c EN
  431: [SRFI-1] @code{take-right} returns the last @var{i} elements of @var{flist}.
  432: @code{drop-right} returns all but the last @var{i} elements of @var{flist}. 
  433: @c JP
  434: [SRFI-1] @code{take-right} ??@var{flist} ?κǸ? @var{i}?Ĥ????????????Ȥ???ޤ???
  435: @code{drop-right} ??@var{flist} ?κǸ? @var{i}?Ĥ??Ǥ??????ꥹ??֤??ޤ???
  436: @c COMMON
  437: @example
  438: (take-right '(a b c d e) 2) => (d e)
  439: (drop-right '(a b c d e) 2) => (a b c)
  440: @end example
  441: @c EN
  442: @var{flist} may be any finite list.
  443: @c JP
  444: @var{flist} ????¥ꥹ?ȤǤ???OK?Ǥ???
  445: @c COMMON
  446: @example
  447: (take-right '(1 2 3 . d) 2) => (2 3 . d)
  448: (drop-right '(1 2 3 . d) 2) => (1)
  449: (take-right '(1 2 3 . d) 0) => d
  450: (drop-right '(1 2 3 . d) 0) => (1 2 3)
  451: @end example
  452: @c EN
  453: @code{take-right}'s return value always shares a common
  454: tail with @var{flist}.
  455: @code{drop-right} always allocates a new list
  456: if the argument is a list of non-zero length.
  457: 
  458: An error is signalled if @var{i} is larger than the length of @var{flist}.
  459: @xref{Additional list library}, for more tolerant version
  460: of @code{take-right} and @code{drop-right}.
  461: @c JP
  462: @code{take-right} ??֤???Ϥ??ĤǤ?var{first} ?ζ??????????ޤ???
  463: @code{drop-right} ?ϡ???Ĺ????0?Ǥʤ??ꥹ?Ȥʤ顢ɬ?????????ꥹ?Ȥ??????ݤ??ޤ???
  464: 
  465: @var{i} ???ꥹ??@var{flist} ?????????????????顼??ȯ????ޤ???
  466: ??????ʥС???????@code{take-right} ??@code{drop-right} ?ˤĤ??Ƥϡ?
  467: @xref{Additional list library} ?򻲾Ȥ??Ƥ????????
  468: @c COMMON
  469: @end defun
  470: 
  471: @defun take! x i
  472: @defunx drop-right! x i
  473: @c EN
  474: [SRFI-1]  Linear update variants of @var{take} and @var{drop-right}.
  475: Those procedures may destructively modifies @var{x}.
  476: 
  477: If @var{x} is circular, @code{take!} may return a list
  478: shorter than expected.
  479: @c JP
  480: [SRFI-1] @var{take} ???? @var{drop-right} ?????ξ??????????С??????Ǥ???????????????@var{x} ????ѹ????뤫?⤷??????
  481: @var{x} ???۴ĥꥹ?Ȥʤ顢@code{take!} ?ϴ??????û???ꥹ?Ȥ??
  482: ??????????????
  483: @c COMMON
  484: @end defun
  485: 
  486: @defun split-at x i
  487: @defunx split-at! x i
  488: @c EN
  489: [SRFI-1] @code{split-at} splits the list @var{x} at index @var{i},
  490: returning a list of the first @var{i} elements, and the remaining tail.
  491: @c JP
  492: [SRFI-1] @code{split-at} ?ϥꥹ??@var{x} ?򥤥?å??? @var{i} ????֤???䤷???ǽ? @var{i} ?Ĥ??Ǥ????????Ȥȡ??Ĥ????Ȥ????ޤ???
  493: @c COMMON
  494: @example
  495: (split-at '(a b c d e) 2) @result{} (a b) (c d e)
  496: @end example
  497: @c EN
  498: @code{split-at!} is the linear-update variant. It may destructively
  499: modifies @var{x} to produce the result. 
  500: @c JP
  501: @code{split-at!} ?Ϥ??ξ??????????С??????Ǥ???
  502: ???? @var{x} ???˹??????뤫?⤷??????@c COMMON
  503: @end defun
  504: 
  505: @defun last pair
  506: @c EN
  507: [SRFI-1] Returns the last element of the non-empty, finite list @var{pair}.
  508: It is equivalent to @code{(car (last-pair pair))}.
  509: Note that @code{last-pair} is Gauche built-in procedure.
  510: @c JP
  511: [SRFI-1] ??Ϥʤ?ͭ?¥ꥹ??@var{pair} ?κǸ???????ޤ???
  512: ??????@code{(car (last-pair pair))} ?????Ǥ???
  513: 
  514: ?: @code{last-pair} ??Gauche ??Ȥ߹??߼????Ǥ???
  515: @c COMMON
  516: @end defun
  517: 
  518: @node SRFI-1 List miscellaneous routines, SRFI-1 Fold, SRFI-1 List selectors, List library
  519: @subsection List miscellaneous routines
  520: @c NODE ??Υꥹ?Ƚ??롼???defun length+ x
  521: @ EN
  522: [SRFI-1] If @var{x} is a proper list, returns its length.
  523: Otherwise, returns @code{#f}.
  524: @c JP
  525: [SRFI-1] @var{x} ??????ꥹ?Ȥʤ顢???????????ޤ?????????????
  526: @code{#f} ????Þ¤???
  527: @c COMMON
  528: @end defun
  529: 
  530: @defun concatenate list-of-lists
  531: @defunx concatenate! list-of-lists!
  532: @c EN
  533: [SRFI-1] Equivalent to @code{(apply append @var{list-of-lists})} and
  534: @code{(apply append! @var{list-of-lists})}, respectively.
  535: @c JP
  536: [SRFI-1] ???줾?졢@code{(apply append @var{list-of-lists})} ????
  537: @code{(apply append! @var{list-of-lists})} ?????Ǥ???
  538: @c COMMON
  539: @end defun
  540: 
  541: @defun append-reverse rev-head tail
  542: @defunx append-reverse! rev-head tail
  543: @c EN
  544: [SRFI-1] @code{append-reverse} returns @code{(append (reverse rev-head) tail)}.
  545: @code{append-reverse!} is the linear-update variant.
  546: @c JP
  547: [SRFI-1] @code{append-reverse} ??@code{(append (reverse rev-head) tail)} ?????ޤ???@code{append-reverse!} ?Ϥ??ξ??????????С??????Ǥ???
  548: @c COMMON
  549: @end defun
  550: 
  551: @defun zip clist1 clist2 @dots{}
  552: @c EN
  553: [SRFI-1] Equivalent to @code{(map list clist1 clist2 @dots{})}.
  554: If @code{zip} is passed @var{n} lists, it returns a list as long as
  555: the shortest of these lists, each element of which is an @var{n}-element list
  556: comprised of the corresponding elements from the parameter lists. 
  557: @c JP
  558: [SRFI-1] @code{(map list clist1 clist2 @dots{})} ?????Ǥ???
  559: @var{n} ??Υꥹ?Ȥ? @code{zip} ??Ϥ??줿???ˤϡ????Τʤ??ǰ?û??????Ʊ??Ĺ???Υꥹ?Ȥ???ޤ???????줿?ꥹ?Ȥϡ????? @var{n} ???Υꥹ?Ȥǡ?
  560: ???Τ??줾?줬????????Ϥäƥꥹ?Ȥ?б???????ˤʤäƤ??ޤ???
  561: @c COMMON
  562: @example
  563: (zip '(one two three) 
  564:      '(1 2 3)
  565:      '(odd even odd even odd even odd even))
  566:      @result{} ((one 1 odd) (two 2 even) (three 3 odd))
  567: 
  568: (zip '(1 2 3)) @result{} ((1) (2) (3))
  569: @end example
  570: @c EN
  571: At least one of the argument lists must be finite: 
  572: @c JP
  573: ???ꥹ?ȤΤ?????????Ȥ??ȤĤ???¤Υꥹ?ȤǤʤ????ʤ?????@c COMMON
  574: @example
  575: (zip '(3 1 4 1) (circular-list #f #t)) 
  576:      @result{} ((3 #f) (1 #t) (4 #f) (1 #t))
  577: @end example
  578: @end defun
  579: 
  580: @defun unzip1 list
  581: @defunx unzip2 list
  582: @defunx unzip3 list
  583: @defunx unzip4 list
  584: @defunx unzip5 list
  585: @c EN
  586: [SRFI-1] @code{unzip1} takes a list of lists, where every list must
  587: contain at least one element, and returns a list containing the
  588: initial element of each such list.
  589: @code{unzip2} takes a list of lists, where every list
  590: must contain at least two elements, and returns two values:
  591: a list of the first elements, and a list of the second
  592: elements. @code{unzip3} does the same for the first
  593: three elements of the lists, and so on.
  594: @c JP
  595: [SRFI-1] @code{unzip1} ?ϥꥹ?ȤΥꥹ?Ȥ????ƤȤ????????줾??
  596: ?ꥹ?ȤϾ????Ȥ??Ĥ??Ǥ???ΤǤʤ??ƤϤʤ????󡣷??Ȥ??????줾???ꥹ?Ȥκǽ????Υꥹ?Ȥ???ޤ???
  597: @code{unzip2} ?ϥꥹ?ȤΥꥹ?Ȥ????ƤȤ????????줾???ꥹ?Ȥ??????Ȥ??Ĥ??Ǥ???ΤǤʤ??ƤϤʤ????󡣷??Ȥ?????ͤ????ޤ????ǽ????Υꥹ?Ȥ??ܤ??ǤΥꥹ?ȤǤ???@code{unzip3} ??3???ޤǤ??ǤˤĤ??????Ǥ????ʲ?????Ǥ???
  598: @c COMMON
  599: @example
  600: (unzip2 '((1 one) (2 two) (3 three))) @result{}
  601:    (1 2 3) @r{and}
  602:    (one two three)
  603: @end example
  604: @end defun
  605: 
  606: @defun count pred clist1 clist2 @dots{}
  607: @c EN
  608: [SRFI-1] A procedure @var{pred} is applied to the @var{n}-th element
  609: of given lists, from @var{n} is zero to the length of the
  610: the shortest finite list in the given lists,
  611: and the count of times @var{pred} returned true is returned.
  612: @c JP
  613: [SRFI-1] @var{n} ?ò¥¼¥í¤«?????????ꥹ?ȤΤ???Ǥ????ꥹ?Ȥ?Ĺ???ޤǤȤ??Æ¡?@var{pred} ????????????ꥹ?Ȥ?@var{n} ?????Ǥ????줾??????Þ¤???
  614: @var{pred} ???????????Ö¤?????
  615: @c COMMON
  616: @example
  617: (count even? '(3 1 4 1 5 9 2 5 6)) @result{} 3
  618: (count < '(1 2 4 8) '(2 4 6 8 10 12 14 16)) @result{} 3
  619: @end example
  620: @c EN
  621: At least one of the argument lists must be finite: 
  622: @c JP
  623: ??Ϳ?????????Ȥξ????Ȥ??ȤĤ???¤Ǥʤ????ʤ?????@c COMMON
  624: @example
  625: (count < '(3 1 4 1) (circular-list 1 10)) @result{} 2
  626: @end example
  627: @end defun
  628: 
  629: @node SRFI-1 Fold, SRFI-1 Filtering & Partitioning, SRFI-1 List miscellaneous routines, List library
  630: @subsection List fold, unfold & map
  631: @c NODE ?ꥹ?Ȥξ????fold)???򤭤ۤ???(unfold)?????????
  632: 
  633: @defun fold kons knil clist1 clist2 @dots{}
  634: @c EN
  635: [SRFI-1] The fundamental list iterator.
  636: When it is given a single list
  637: @var{clist1} = (@var{e1} @var{e2} @dots{} @var{en}),
  638: then this procedure returns
  639: @c JP
  640: [SRFI-1] ??ꥹ?????黻?ҤǤ???ñ???ꥹ??@var{clist1} = (@var{e1} @var{e2} @dots{} @var{en}) 
  641: ????????Ȥ??ˤϡ??ʲ?????ޤ???
  642: @c COMMON
  643: @example
  644: (@var{kons} @var{en} @dots{} (@var{kons} @var{e2} (@var{kons} @var{e1} @var{knil})) @dots{} ) 
  645: @end example
  646: 
  647: @c EN
  648: If @var{n} list arguments are provided, then the @var{kons}
  649: function must take @var{n}+1 parameters: one element from each list, and
  650: the "seed" or fold state, which is initially @var{knil}.
  651: The fold operation terminates when the shortest list runs out of values.
  652: At least one of the list arguments must be finite. 
  653: 
  654: Examples:
  655: @c JP
  656: @var{n} ??Υꥹ?Ȥ?Ϳ?????????ˤϡ?@var{kons} ?ؿ?@var{n}+1 ?Ĥΰ?????ʤ????ʤ????󡣤??줾???ꥹ?Ȥ??????ȤĤ??Ĥȡ?
  657: ??? @var{knil} ?Ǥ????????뤤?Ͼ???߾?Ȥ??????Ǥ???
  658: ???ξ???߱黻?ϡ????Ȥ????ꥹ?Ȥ??Ǥ??ʤ??ʤä??Ȥ?????λ???ޤ???
  659: Ϳ?????????Ȥξ????Ȥ??ȤĤ???¤Ǥʤ????ʤ?????
  660: ?:
  661: @c COMMON
  662: @example
  663: (fold + 0 '(3 1 4 1 5 9)) @result{} 23 ;@r{sum up the elements}
  664: (fold cons '() '(a b c d e)) @result{} (e d c b a) ;@r{reverse}
  665: (fold cons* '() '(a b c) '(1 2 3 4 5))
  666:     @result{} (c 3 b 2 a 1) ;@r{n-ary case}
  667: @end example
  668: @end defun
  669: 
  670: @defun fold-right kons knil clist1 clist2 @dots{}
  671: @c EN
  672: [SRFI-1] The fundamental list recursion operator.
  673: When it is given a single list
  674: @var{clist1} = (@var{e1} @var{e2} @dots{} @var{en}),
  675: then this procedure returns
  676: @c JP
  677: [SRFI-1] ??ꥹ?ȺƵ??黻?ҤǤ???ñ???ꥹ??@var{clist1} = (@var{e1} @var{e2} @dots{} @var{en}) 
  678: ????????Ȥ??ˤϡ??ʲ?????ޤ???
  679: @c COMMON
  680: @example
  681: (@var{kons} @var{e1} (@var{kons} @var{e2} @dots{} (@var{kons} @var{en} @var{knil})))
  682: @end example
  683: 
  684: @c EN
  685: If @var{n} list arguments are provided, then the @var{kons} function
  686: must take @var{n}+1 parameters: one element from each list, and
  687: the "seed" or fold state, which is initially @var{knil}.
  688: The fold operation terminates when the shortest list runs out of values.
  689: At least one of the list arguments must be finite. 
  690: 
  691: Examples: 
  692: @c JP
  693: @var{n} ??Υꥹ?Ȥ?Ϳ?????????ˤϡ?@var{kons} ?ؿ?@var{n}+1 ?Ĥΰ?????ʤ????ʤ????󡣤??줾???ꥹ?Ȥ??????ȤĤ??Ĥȡ?
  694: ??? @var{knil} ?Ǥ????????뤤?Ͼ???߾?Ȥ????ΤǤ???
  695: ???ξ???߱黻?ϡ????Ȥ????ꥹ?Ȥ??Ǥ??ʤ??ʤä??Ȥ?????λ???ޤ???
  696: Ϳ?????????Ȥξ????Ȥ??ȤĤ???¤Ǥʤ????ʤ?????
  697: ?:
  698: @c COMMON
  699: @example
  700: (fold-right cons '() '(a b c d e))
  701:    @result{} (a b c d e) ;@r{copy list}
  702: (fold-right cons* '() '(a b c) '(1 2 3 4 5))
  703:    @result{} (a 1 b 2 c 3) ;@r{n-ary case}
  704: @end example
  705: @end defun
  706: 
  707: @defun pair-fold kons knil clist1 clist2 @dots{}
  708: @defunx pair-fold-right kons knil clist1 clist2 @dots{}
  709: @c EN
  710: [SRFI-1] 
  711: Like @code{fold} and @code{fold-right}, but the procedure @var{kons}
  712: gets each @code{cdr} of the given @var{clist}s, instead of @code{car}.
  713: @c JP
  714: [SRFI-1]
  715: @code{fold} ???? @code{fold-right} ?????Ǥ?????@var{kons} ????
  716: ????????? @var{clist} ??@code{car} ?ǤϤʤ???@code{cdr} ???????
  717: @c COMMON
  718: @end defun
  719: 
  720: @defun reduce f ridentity list
  721: @defunx reduce-right f ridentity list
  722: @c EN
  723: [SRFI-1]
  724: Variant of @code{fold} and @code{fold-right}.   @var{f} must be a
  725: binary operator, and @var{ridentity} is the value such that for
  726: any value @var{x} that is valid as @var{f}'s input,
  727: @c JP
  728: [SRFI-1]
  729: @code{fold} ???? @code{fold-right} ??ѷ?С??????Ǥ???
  730: @var{f} ???é»»?ҤǤʤ????ʤ??????Þ¤???@var{ridentity} ??@var{f} ?????Ȥ??Ƶö¤µ¤?
  731: ?????? @var{x} ?ˤĤ??ưʲ?????Ƥ??ʤ????ʤ?????@c COMMON
  732: @example
  733:  (f x ridentity) @equiv{} x
  734: @end example
  735: 
  736: @c EN
  737: These functions effectively do the same thing as @code{fold} or
  738: @code{fold-right}, respectively, but omit the first 
  739: application of @var{f} to @var{ridentity}, using the above nature.
  740: So @var{ridentity} is used only when @var{list} is empty.
  741: @c JP
  742: ?????δؿ?¼????@code{fold} ??code{fold-right} ????????Ȥ????ޤ?????@var{ridentity}?ˤϾ嵭?????????뤿?ᡢ
  743: @var{f}??var{ridentity}?ˤ???????????@var{ridentity}???Ȥ?????var{list}?????????Ǥ???
  744: @c COMMON
  745: @end defun
  746: 
  747: @defun unfold p f g seed &optional tail-gen
  748: @c EN
  749: [SRFI-1]
  750: Fundamental recursive list constructor.
  751: Defined by the following recursion.
  752: @c JP
  753: [SRFI-1]
  754: ??ꥹ?ȺƵ?????ҤǤ???
  755: ?ʲ??Τ褦?˺Ƶ?Ū??????????ޤ???
  756: @c COMMON
  757: 
  758: @example
  759: (unfold p f g seed tail-gen) @equiv{}
  760:    (if (p seed)
  761:        (tail-gen seed)
  762:        (cons (f seed)
  763:              (unfold p f g (g seed))))
  764: @end example
  765: @c EN
  766: That is, @var{p} determines where to stop, @var{g} is used to generate
  767: successive seed value from the current seed value, and @var{f} is used
  768: to map each seed value to a list element.
  769: @c JP
  770: ?????Ǥϡ?@var{p} ?Ͻ?λ??֤?????@var{g} ?ϸ??ߤΡּ????鼡?Ρּ?
  771: ?????????Ѥ???@var{f} ?Ϥ??줾???ּ?????Ȥ??Ǥ?Ѵ?????Τ?Ѥ????ޤ???
  772: @c COMMON
  773: @end defun
  774: 
  775: @defun unfold-right p f g seed &optional tail
  776: @c EN
  777: [SRFI-1]
  778: Fundamental iterative list constructor.
  779: Defined by the following recursion.
  780: @c JP
  781: [SRFI-1]
  782: ??ꥹ????????ҤǤ???
  783: ?ʲ??Τ褦?˺Ƶ?Ū??????????ޤ???
  784: @c COMMON
  785: 
  786: @example
  787: (unfold-right p f g seed tail) @equiv{}
  788:   (let lp ((seed seed) (lis tail))
  789:     (if (p seed)
  790:         lis
  791:         (lp (g seed) (cons (f seed) lis))))
  792: @end example
  793: @end defun
  794: 
  795: @defun append-map f clist1 clist2 @dots{}
  796: @defunx append-map! f clist1 clist2 @dots{}
  797: @c EN
  798: [SRFI-1]
  799: Equivalent to
  800: @c JP
  801: [SRFI-1]
  802: ?ʲ??????Ǥ???
  803: @c COMMON
  804: 
  805: @example
  806:   (apply append (map @var{f} @var{clist1} @var{clist2} @dots{}))
  807:   (apply append! (map @var{f} @var{clist1} @var{clist2} @dots{}))
  808: @end example
  809: @c EN
  810: At least one of the list arguments must be finite. 
  811: @c JP
  812: ???ꥹ?ȤΤ???????Ȥ??ȤĤ???¤Ǥʤ????ʤ?????@c COMMON
  813: @end defun
  814: 
  815: @defun map! f clist1 clist2 @dots{}
  816: @c EN
  817: [SRFI-1]
  818: The procedure @var{f} is applied to each element of @var{clist1} and
  819: corresponding elements of @var{clist2}s, and the result is collected
  820: to a list.  Cells in @var{clist1} is reused to construct the result list.
  821: @c JP
  822: [SRFI-1]
  823: ???? @var{f} ??@var{clist1} ?γ??Ǥ?@var{clist2} ??б??????
  824: ???????졢???ϤҤȤĤΥꥹ?Ȥˤʤ?????@var{clist1} ?Υ???
  825: ???Υꥹ?Ȥ?ۤ????˺????????
  826: @c COMMON
  827: @end defun
  828: 
  829: @defun map-in-order f clist1 clist2 @dots{}
  830: @c EN
  831: [SRFI-1] A variant of @code{map}, but it guarantees to apply @var{f}
  832: on each elements of arguments in a left-to-right order.
  833: Since Gauche's @code{map} implementation follows the same order,
  834: this function is just a synonym of @code{map}.
  835: @c JP
  836: [SRFI-1] @code{map} ??ѷ?С??????Ǥ?????@var{f} ????????????????Ϳ???????ꥹ?Ȥ??Ǥκ????鱦?ؤν????뤳?Ȥ?ڤ??ޤ???
  837: Gauche ?Ǥ?@code{map} ?μ????ν??ʤäƤ????ǡ?@code{map} ??Ʊ?դǤ???
  838: @c COMMON
  839: @end defun
  840: 
  841: @defun pair-for-each f clist1 clist2 @dots{}
  842: @c EN
  843: [SRFI-1]
  844: Like @code{for-each}, but the procedure @var{f} is applied on each @code{cdr}
  845: of @var{clist}s.
  846: @c JP
  847: @code{for-each} ?Ȼ???ޤ????????? @var{f} ?ϳƥꥹ??@var{clist} ??@code{cdr} ????????????
  848: @c COMMON
  849: @end defun
  850: 
  851: @defun filter-map  f clist1 clist2 @dots{}
  852: @c EN
  853: [SRFI-1]
  854: Like @code{map}, but only true values are saved.
  855: At least one of the list arguments must be finite. 
  856: @c JP
  857: @code{map} ?Ȼ???ޤ????????ˤʤ?????Τߤ??¸????????
  858: ????????????????Ȥξ????Ȥ??ȤĤ???¤Ǥʤ????ʤ?????@c COMMON
  859: @example
  860: (filter-map (lambda (x) (and (number? x) (* x x)))
  861:             '(a 1 b 3 c 7))
  862:   @result{} (1 9 49)
  863: @end example
  864: @end defun
  865: 
  866: @node SRFI-1 Filtering & Partitioning, SRFI-1 Searching, SRFI-1 Fold, List library
  867: @subsection List filtering & partitioning
  868: @c NODE ?ꥹ?ȤΥե??륿????ʬ??@defun filter pred list
  869: @defunx filter! pred list
  870: @c EN
  871: [SRFI-1] A procedure @var{pred} is applied on each element of @var{list},
  872: and a list of elements that @var{pred} returned true on it is returned.
  873: @c JP
  874: [SRFI-1] ???? @var{pred} ?? @var{list} ?γ??Ǥ??????졢
  875: @var{pred} ??????????Υꥹ?Ȥ??????????
  876: @c COMMON
  877: @example
  878: (filter odd? '(3 1 4 5 9 2 6)) @result{} (3 1 5 9)
  879: @end example
  880: @c EN
  881: @code{filter!} is the linear-update variant.  It may destructively
  882: modifies @var{list} to produce the result.
  883: @c JP
  884: @code{filter!} ?Ϥ??ξ??????????С??????Ǥ???????????뤿??
  885: @var{list} ????ѹ????뤫?⤷??????@c COMMON
  886: @end defun
  887: 
  888: @defun remove pred list
  889: @defunx remove! pred list
  890: @c EN
  891: [SRFI-1] A procedure @var{pred} is applied on each element of @var{list},
  892: and a list of elements that @var{pred} returned false on it is returned.
  893: @c JP
  894: [SRFI-1] ???? @var{pred} ?? @var{list} ?γ??Ǥ??????졢
  895: @var{pred} ??????????Υꥹ?Ȥ??????????
  896: @c COMMON
  897: @example
  898: (remove odd? '(3 1 4 5 9 2 6)) @result{} (4 2 6)
  899: @end example
  900: @c EN
  901: @code{remove!} is the linear-update variant.  It may destructively
  902: modifies @var{list} to produce the result.
  903: @c JP
  904: @code{remove!} ?Ϥ??ξ??????????С??????Ǥ???????????뤿??
  905: @var{list} ???˹??????뤫?⤷??????@c COMMON
  906: @end defun
  907: 
  908: @defun partition pred list
  909: @defunx partition! pred list
  910: @c EN
  911: [SRFI-1] @code{filter} and @code{remove} simultaneously, i.e. 
  912: returns two lists, the first is the result of filtering elements of
  913: @var{list} by @var{pred}, and the second is the result of
  914: removing elements of @var{list} by @var{pred}.
  915: @c JP
  916: [SRFI-1] @code{filter} ??@code{remove} ??????ˡ????ʤ?2?ĤΥꥹ?Ȥ????ޤ??????????@var{pred} ?ˤ? @var{list} ???Ǥ???륿????
  917: ???????Ç¡????ܤ?@var{pred} ?ˤ? @var{list} ???Ǥ?ü¤·¤¿·?
  918: ?Ǥ??? 
  919: @c COMMON
  920: @example
  921: (partition odd? '(3 1 4 5 9 2 6))
  922:   @result{} (3 1 5 9) (4 2 6)
  923: @end example
  924: @c EN
  925: @code{partition!} is the linear-update variant.  It may destructively
  926: modifies @var{list} to produce the result.
  927: @c JP
  928: @code{partition!} ?Ϥ??ξ??????????С??????Ǥ???????????뤿??
  929: @var{list} ???˹??????뤫?⤷??????@c COMMON
  930: @end defun
  931: 
  932: @node SRFI-1 Searching, SRFI-1 Deletion, SRFI-1 Filtering & Partitioning, List library
  933: @subsection List searching
  934: @c NODE ?ꥹ?Ȥ????defun find pred clist
  935: @c EN
  936: [SRFI-1] Applies @var{pred} for each element of @var{clist}, from 
  937: left to right, and returns the first element that @var{pred} returns
  938: true on.  If no element satisfies @var{pred}, @code{#f} is returned.
  939: @c JP
  940: [SRFI-1] @var{clist} ?γ??Ǥ?Ф??ƺ????鱦??@var{pred} ??Ѥ???
  941: @var{pred} ????????ǽ???????ޤ???@var{pred}?????????
  942: ̵??????code{#f}????ޤ???
  943: @c COMMON
  944: @end defun
  945: 
  946: @defun find-tail pred clist
  947: @c EN
  948: [SRFI-1]
  949: Applies @var{pred} for each element of @var{clist}, from left to right,
  950: and when @var{pred} returns a true value, returns the pair whose car
  951: is the element.  If no element satisfies @var{pred}, @code{#f} is returned.
  952: @c JP
  953: [SRFI-1]
  954: @var{clist} ?γ??Ǥ?Ф??ƺ????鱦??@var{pred} ??Ѥ???@var{pred} ??
  955: ?????????????car ???????ǤǤ?????????ޤ???
  956: @var{pred}?????????̵??????code{#f}????ޤ???
  957: @c COMMON
  958: @end defun
  959: 
  960: @defun take-while pred clist
  961: @defunx take-while! pred list
  962: @c EN
  963: [SRFI-1]
  964: Returns the longest initial prefix of @var{clist} whose elements all
  965: satisfy @var{pred}.
  966: @c JP
  967: [SRFI-1]
  968: @var{clist} ?κǽ餫?顢@var{pred} ?????????????ʬ??????ޤ???
  969: @c COMMON
  970: @end defun
  971: 
  972: @defun drop-while pred clist
  973: @c EN
  974: [SRFI-1]
  975: Drops the longest initial prefix of @var{clist} whose elements all
  976: satisfy @var{pred}, and returns the rest.
  977: @c JP
  978: [SRFI-1]
  979: @var{clist} ?κǽ餫?顢@var{pred} ?????????????ʬ??????Ĥ?????ޤ???
  980: @c COMMON
  981: @end defun
  982: 
  983: @defun span pred clist
  984: @defunx span! pred list
  985: @defunx break pred clist
  986: @defunx break! pred list
  987: @c EN
  988: [SRFI-1]
  989: @code{span} is equivalent to
  990: @code{(values (take-while pred clist) (drop-while pred clist))}.
  991: @code{break} inverts the sense of @var{pred}.
  992: @c JP
  993: [SRFI-1]
  994: @code{span} ??@code{(values (take-while pred clist) (drop-while pred clist))} 
  995: ???????@code{break} ??@var{pred} ?ΰ????????ޤ???
  996: @c COMMON
  997: @end defun
  998: 
  999: @defun any pred clist1 clist2 @dots{}
 1000: @c EN
1 2 3 4 5 10
Syntax (Markdown)