📄 match.scm
字号:
;; | ($ struct-name pat_1 ... pat_n) a structure;; | (= field pat) a field of a structure;; | (and pat_1 ... pat_n) if all of pat_1 thru pat_n match;; | (or pat_1 ... pat_n) if any of pat_1 thru pat_n match;; | (not pat_1 ... pat_n) if all pat_1 thru pat_n don't match;; | (? predicate pat_1 ... pat_n) if predicate true and all of;; pat_1 thru pat_n match;; | (set! identifier) anything, and binds setter;; | (get! identifier) anything, and binds getter;; | `qp a quasi-pattern;;;; ooo ::= ... zero or more;; | ___ zero or more;; | ..k k or more;; | __k k or more;;;; quasi-patterns: matches:;;;; qp ::= () the empty list;; | #t #t;; | #f #f;; | string a string;; | number a number;; | character a character;; | identifier a symbol;; | (qp_1 ... qp_n) list of n elements;; | (qp_1 ... qp_n . qp_{n+1}) list of n or more;; | (qp_1 ... qp_n qp_n+1 ooo) list of n or more, each element;; of remainder must match qp_n+1;; | #(qp_1 ... qp_n) vector of n elements;; | #(qp_1 ... qp_n qp_n+1 ooo) vector of n or more, each element;; of remainder must match qp_n+1;; | #&qp box;; | ,pat a pattern;; | ,@pat a pattern;;;; The names (quote, quasiquote, unquote, unquote-splicing, ?, _, $,;; and, or, not, set!, get!, ..., ___) cannot be used as pattern variables.;;;;;; structure expressions:;;;; exp ::= ...;; | (define-structure (id_0 id_1 ... id_n));; | (define-structure (id_0 id_1 ... id_n);; ((id_{n+1} exp_1) ... (id_{n+m} exp_m)));; | (define-const-structure (id_0 arg_1 ... arg_n));; | (define-const-structure (id_0 arg_1 ... arg_n);; ((arg_{n+1} exp_1) ... (arg_{n+m} exp_m)));;;; arg ::= id | (! id) | (@ id);;;;;; match:error-control controls what code is generated for failed matches.;; Possible values:;; 'unspecified - do nothing, ie., evaluate (cond [#f #f])
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -