📄 guile-procedures.txt
字号:
The return value of this procedure is not specified. remove-hook! - Scheme Procedure: remove-hook! hook proc Remove the procedure PROC from the hook HOOK. The return value of this procedure is not specified. reset-hook! - Scheme Procedure: reset-hook! hook Remove all procedures from the hook HOOK. The return value of this procedure is not specified. run-hook - Scheme Procedure: run-hook hook . args Apply all procedures from the hook HOOK to the arguments ARGS. The order of the procedure application is first to last. The return value of this procedure is not specified. hook->list - Scheme Procedure: hook->list hook Convert the procedure list of HOOK to a list. ftell - Scheme Procedure: ftell fd_port Return an integer representing the current position of FD/PORT, measured from the beginning. Equivalent to: (seek port 0 SEEK_CUR) redirect-port - Scheme Procedure: redirect-port old new This procedure takes two ports and duplicates the underlying file descriptor from OLD-PORT into NEW-PORT. The current file descriptor in NEW-PORT will be closed. After the redirection the two ports will share a file position and file status flags. The return value is unspecified. Unexpected behaviour can result if both ports are subsequently used and the original and/or duplicate ports are buffered. This procedure does not have any side effects on other ports or revealed counts. dup->fdes - Scheme Procedure: dup->fdes fd_or_port [fd] Return a new integer file descriptor referring to the open file designated by FD_OR_PORT, which must be either an open file port or a file descriptor. dup2 - Scheme Procedure: dup2 oldfd newfd A simple wrapper for the `dup2' system call. Copies the file descriptor OLDFD to descriptor number NEWFD, replacing the previous meaning of NEWFD. Both OLDFD and NEWFD must be integers. Unlike for dup->fdes or primitive-move->fdes, no attempt is made to move away ports which are using NEWFD. The return value is unspecified. fileno - Scheme Procedure: fileno port Return the integer file descriptor underlying PORT. Does not change its revealed count. isatty? - Scheme Procedure: isatty? port Return `#t' if PORT is using a serial non-file device, otherwise `#f'. fdopen - Scheme Procedure: fdopen fdes modes Return a new port based on the file descriptor FDES. Modes are given by the string MODES. The revealed count of the port is initialized to zero. The modes string is the same as that accepted by *Note open-file: File Ports. primitive-move->fdes - Scheme Procedure: primitive-move->fdes port fd Moves the underlying file descriptor for PORT to the integer value FDES without changing the revealed count of PORT. Any other ports already using this descriptor will be automatically shifted to new descriptors and their revealed counts reset to zero. The return value is `#f' if the file descriptor already had the required value or `#t' if it was moved. fdes->ports - Scheme Procedure: fdes->ports fd Return a list of existing ports which have FDES as an underlying file descriptor, without changing their revealed counts. make-keyword-from-dash-symbol - Scheme Procedure: make-keyword-from-dash-symbol symbol Make a keyword object from a SYMBOL that starts with a dash. keyword? - Scheme Procedure: keyword? obj Return `#t' if the argument OBJ is a keyword, else `#f'. keyword-dash-symbol - Scheme Procedure: keyword-dash-symbol keyword Return the dash symbol for KEYWORD. This is the inverse of `make-keyword-from-dash-symbol'. nil-cons - Scheme Procedure: nil-cons x y Create a new cons cell with X as the car and Y as the cdr, but convert Y to Scheme's end-of-list if it is a LISP nil. nil-car - Scheme Procedure: nil-car x Return the car of X, but convert it to LISP nil if it is Scheme's end-of-list. nil-cdr - Scheme Procedure: nil-cdr x Return the cdr of X, but convert it to LISP nil if it is Scheme's end-of-list. null - Scheme Procedure: null x Return LISP's `t' if X is nil in the LISP sense, return LISP's nil otherwise. nil-eq - Scheme Procedure: nil-eq x y Compare X and Y and return LISP's t if they are `eq?', return LISP's nil otherwise. list - Scheme Procedure: list . objs Return a list containing OBJS, the arguments to `list'. list* - Scheme Procedure: list* implemented by the C function "scm_cons_star" cons* - Scheme Procedure: cons* arg . rest Like `list', but the last arg provides the tail of the constructed list, returning `(cons ARG1 (cons ARG2 (cons ... ARGN)))'. Requires at least one argument. If given one argument, that argument is returned as result. This function is called `list*' in some other Schemes and in Common LISP. null? - Scheme Procedure: null? x Return `#t' iff X is the empty list, else `#f'. list? - Scheme Procedure: list? x Return `#t' iff X is a proper list, else `#f'. length - Scheme Procedure: length lst Return the number of elements in list LST. append - Scheme Procedure: append . args Return a list consisting of the elements the lists passed as arguments. (append '(x) '(y)) => (x y) (append '(a) '(b c d)) => (a b c d) (append '(a (b)) '((c))) => (a (b) (c)) The resulting list is always newly allocated, except that it shares structure with the last list argument. The last argument may actually be any object; an improper list results if the last argument is not a proper list. (append '(a b) '(c . d)) => (a b c . d) (append '() 'a) => a append! - Scheme Procedure: append! . lists A destructive version of `append' (*note Pairs and Lists: (r5rs)Pairs and Lists.). The cdr field of each list's final pair is changed to point to the head of the next list, so no consing is performed. Return a pointer to the mutated list. last-pair - Scheme Procedure: last-pair lst Return a pointer to the last pair in LST, signalling an error if LST is circular. reverse - Scheme Procedure: reverse lst Return a new list that contains the elements of LST but in reverse order. reverse! - Scheme Procedure: reverse! lst [new_tail] A destructive version of `reverse' (*note Pairs and Lists: (r5rs)Pairs and Lists.). The cdr of each cell in LST is modified to point to the previous list element. Return a pointer to the head of the reversed list. Caveat: because the list is modified in place, the tail of the original list now becomes its head, and the head of the original list now becomes the tail. Therefore, the LST symbol to which the head of the original list was bound now points to the tail. To ensure that the head of the modified list is not lost, it is wise to save the return value of `reverse!' list-ref - Scheme Procedure: list-ref list k Return the Kth element from LIST. list-set! - Scheme Procedure: list-set! list k val Set the Kth element of LIST to VAL. list-cdr-ref - Scheme Procedure: list-cdr-ref implemented by the C function "scm_list_tail" list-tail - Scheme Procedure: list-tail lst k - Scheme Procedure: list-cdr-ref lst k Return the "tail" of LST beginning with its Kth element. The first element of the list is considered to be element 0. `list-tail' and `list-cdr-ref' are identical. It may help to think of `list-cdr-ref' as accessing the Kth cdr of the list, or returning the results of cdring K times down LST. list-cdr-set! - Scheme Procedure: list-cdr-set! list k val Set the Kth cdr of LIST to VAL. list-head - Scheme Procedure: list-head lst k Copy the first K elements from LST into a new list, and return it. list-copy - Scheme Procedure: list-copy lst Return a (newly-created) copy of LST. sloppy-memq - Scheme Procedure: sloppy-memq x lst This procedure behaves like `memq', but does no type or error checking. Its use is recommended only in writing Guile internals, not for high-level Scheme programs. sloppy-memv - Scheme Procedure: sloppy-memv x lst This procedure behaves like `memv', but does no type or error checking. Its use is recommended only in writing Guile internals, not for high-level Scheme programs. sloppy-member - Scheme Procedure: sloppy-member x lst This procedure behaves like `member', but does no type or error checking. Its use is recommended only in writing Guile internals, not for high-level Scheme programs. memq - Scheme Procedure: memq x lst Return the first sublist of LST whose car is `eq?' to X where the sublists of LST are the non-empty lists returned by `(list-tail LST K)' for K less than the length of LST. If X does not occur in LST, then `#f' (not the empty list) is returned. memv - Scheme Procedure: memv x lst Return the first sublist of LST whose car is `eqv?' to X where the sublists of LST are the non-empty lists returned by `(list-tail LST K)' for K less than the length of LST. If X does not occur in LST, then `#f' (not the empty list) is returned. member - Scheme Procedure: member x lst Return the first sublist of LST whose car is `equal?' to X where the sublists of LST are the non-empty lists returned by `(list-tail LST K)' for K less than the length of LST. If X does not occur in LST, then `#f' (not the empty list) is returned. delq! - Scheme Procedure: delq! item lst - Scheme Procedure: delv! item lst - Scheme Procedure: delete! item lst These procedures are destructive versions of `delq', `delv' and `delete': they modify the pointers in the existing LST rather than creating a new list. Caveat evaluator: Like other destructive list functions, these functions cannot modify the binding of LST, and so cannot be used to delete the first element of LST destructively. delv! - Scheme Procedure: delv! item lst Destructively remove all elements from LST that are `eqv?' to ITEM. delete! - Scheme Procedure: delete! item lst Destructively remove all elements from LST that are `equal?' to ITEM. delq - Scheme Procedure: delq item lst Return a newly-created copy of LST with elements `eq?' to ITEM removed. This procedure mirrors `memq': `delq' compares elements of LST against ITEM with `eq?'. delv - Scheme Procedure: delv item lst Return a newly-created copy of LST with elements `eqv?' to ITEM removed. This procedure mirrors `memv': `delv' compares elements of LST against ITEM with `eqv?'. delete - Scheme Procedure: delete item lst Return a newly-created copy of LST with elements `equal?' to ITEM removed. This procedure mirrors `member': `delete' compares elements of LST against ITEM with `equal?'. delq1! - Scheme Procedure: delq1! item lst Like `delq!', but only deletes the first occurrence of ITEM from LST. Tests for equality using `eq?'. See also `delv1!' and `delete1!'. delv1! - Scheme Procedure: delv1! item lst Like `delv!', but only deletes the first occurrence of ITEM from LST. Tests for equality using `eqv?'. See also `delq1!' and `delete1!'. delete1! - Scheme Procedure: delete1! item lst Like `delete!', but only deletes the first occurrence of ITEM from LST. Tests for equality using `equal?'. See also `delq1!' and `delv1!'. primitive-load - Scheme Procedure: primitive-load filename Load the file named FILENAME and evaluate its contents in the top-level environment. The load paths are not searched; FILENAME must either be a full pathname or be a pathname relative to the current directory. If the variable `%load-hook' is defined, it should be bound to a procedure that will be cal
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -