summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2014-06-18 06:50:23 -0700
committerKaz Kylheku <kaz@kylheku.com>2014-06-18 06:50:23 -0700
commit990b739d9f20664aa62ec23fb9458953a5fb2cd4 (patch)
treefea47c123e464c74b121bf085c217cbdf26ec4b8
parenta3380a6ce354fc956635837d3fbca39b730d73aa (diff)
downloadtxr-990b739d9f20664aa62ec23fb9458953a5fb2cd4.tar.gz
txr-990b739d9f20664aa62ec23fb9458953a5fb2cd4.tar.bz2
txr-990b739d9f20664aa62ec23fb9458953a5fb2cd4.zip
* eval.c (eval_init): Register member and member_if as intrinsics.
* lib.c (member, member_if): New functions. * lib.h (member, member_if): Declared. * txr.1: Documented. * txr.vim: Regenerated.
-rw-r--r--ChangeLog12
-rw-r--r--eval.c2
-rw-r--r--lib.c35
-rw-r--r--lib.h2
-rw-r--r--txr.132
-rw-r--r--txr.vim276
6 files changed, 222 insertions, 137 deletions
diff --git a/ChangeLog b/ChangeLog
index 8125d80a..a736d4bb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2014-06-18 Kaz Kylheku <kaz@kylheku.com>
+
+ * eval.c (eval_init): Register member and member_if as intrinsics.
+
+ * lib.c (member, member_if): New functions.
+
+ * lib.h (member, member_if): Declared.
+
+ * txr.1: Documented.
+
+ * txr.vim: Regenerated.
+
2014-06-17 Kaz Kylheku <kaz@kylheku.com>
* lib.c (generic_funcall): Bugfixes: support symbols.
diff --git a/eval.c b/eval.c
index 7339281e..45c1c08a 100644
--- a/eval.c
+++ b/eval.c
@@ -3265,6 +3265,8 @@ void eval_init(void)
reg_fun(intern(lit("memq"), user_package), func_n2(memq));
reg_fun(intern(lit("memql"), user_package), func_n2(memql));
reg_fun(intern(lit("memqual"), user_package), func_n2(memqual));
+ reg_fun(intern(lit("member"), user_package), func_n4o(member, 2));
+ reg_fun(intern(lit("member-if"), user_package), func_n3o(member_if, 2));
reg_fun(intern(lit("remq"), user_package), func_n2(remq));
reg_fun(intern(lit("remql"), user_package), func_n2(remql));
reg_fun(intern(lit("remqual"), user_package), func_n2(remqual));
diff --git a/lib.c b/lib.c
index 96ede9f9..2507d8f6 100644
--- a/lib.c
+++ b/lib.c
@@ -914,6 +914,41 @@ val memqual(val obj, val list)
return make_like(list, list_orig);
}
+val member(val item, val list, val testfun, val keyfun)
+{
+ testfun = default_arg(testfun, equal_f);
+ keyfun = default_arg(keyfun, identity_f);
+
+ list = nullify(list);
+
+ for (; list; list = cdr(list)) {
+ val elem = car(list);
+ val key = funcall1(keyfun, elem);
+
+ if (funcall2(testfun, item, key))
+ return list;
+ }
+
+ return nil;
+}
+
+val member_if(val pred, val list, val key)
+{
+ key = default_arg(key, identity_f);
+ list = nullify(list);
+
+ for (; list; list = cdr(list)) {
+ val item = car(list);
+ val subj = funcall1(key, item);
+
+ if (funcall1(pred, subj))
+ return list;
+ }
+
+ return nil;
+}
+
+
val remq(val obj, val list)
{
list_collect_decl (out, ptail);
diff --git a/lib.h b/lib.h
index 1f25f623..bd50a3da 100644
--- a/lib.h
+++ b/lib.h
@@ -445,6 +445,8 @@ val tuples(val n, val seq, val fill);
val memq(val obj, val list);
val memql(val obj, val list);
val memqual(val obj, val list);
+val member(val item, val list, val testfun, val keyfun);
+val member_if(val pred, val list, val key);
val remq(val obj, val list);
val remql(val obj, val list);
val remqual(val obj, val list);
diff --git a/txr.1 b/txr.1
index 7fe43e00..d13bac52 100644
--- a/txr.1
+++ b/txr.1
@@ -7572,6 +7572,36 @@ If no such element found, nil is returned.
Otherwise, that tail of the list is returned whose first element
is the matching object.
+.SS Functions member and member-if
+
+.TP
+Syntax:
+
+ (member <key> <sequence> [<testfun> [<keyfun>]])
+ (member-if <predfun> <sequence> [<keyfun>])
+
+.TP
+Description:
+
+The find and find-if functions search through <sequence> for an item which
+matches a key, or satisfies a predicate function, respectively.
+
+The keyfun argument specifies a function which is applied to the elements
+of the sequence to produce the comparison key. If this argument is omitted,
+then the untransformed elements of the sequence themselves are examined.
+
+The member function's testfun argument specifies the test function which is
+used to compare the comparison keys taken from the sequence to the search key.
+If this argument is omitted, then the equal function is used.
+If member does not find a matching element, it returns nil. Otherwise it
+returns the suffix of <sequence> which begins with the matching element.
+
+The member-if function's predfun argument specifies a predicate function
+which is applied to the successive comparison keys pulled from the sequence
+by applying the key function to successive elements. If no match is found,
+then nil is returned, otherwise the suffix of <sequence> which begins
+with the matching element.
+
.SS Functions remq, remql and remqual
.TP
@@ -7752,7 +7782,7 @@ They return the zero based position of the matching item.
The keyfun argument specifies a function which is applied to the elements
of the list to produce the comparison key. If this argument is omitted,
-then the untransformed elements of the list themselves are searched.
+then the untransformed elements of the list themselves are examined.
The pos function's testfun argument specifies the test function which
is used to compare the comparison keys from the list to the search key.
diff --git a/txr.vim b/txr.vim
index 82e00871..5e9c9b62 100644
--- a/txr.vim
+++ b/txr.vim
@@ -37,142 +37,146 @@ syn keyword txr_keyword contained var
syn keyword txl_keyword contained * *args* *full-args* *gensym-counter*
syn keyword txl_keyword contained *keyword-package* *random-state* *self-path* *stddebug*
syn keyword txl_keyword contained *stderr* *stdin* *stdlog* *stdnull*
-syn keyword txl_keyword contained *stdout* *user-package* + -
-syn keyword txl_keyword contained / /= < <=
-syn keyword txl_keyword contained = > >= abs
-syn keyword txl_keyword contained acons acons-new aconsql-new acos
-syn keyword txl_keyword contained alist-nremove alist-remove all and
-syn keyword txl_keyword contained andf append append* append-each
-syn keyword txl_keyword contained append-each* apply ash asin
-syn keyword txl_keyword contained assoc assql atan atan2
-syn keyword txl_keyword contained atom bignump block boundp
-syn keyword txl_keyword contained break-str call car cat-str
-syn keyword txl_keyword contained cat-vec catch cdr ceil
-syn keyword txl_keyword contained chain chdir chr-isalnum chr-isalpha
-syn keyword txl_keyword contained chr-isascii chr-iscntrl chr-isdigit chr-isgraph
-syn keyword txl_keyword contained chr-islower chr-isprint chr-ispunct chr-isspace
-syn keyword txl_keyword contained chr-isupper chr-isxdigit chr-num chr-str
-syn keyword txl_keyword contained chr-str-set chr-tolower chr-toupper chrp
-syn keyword txl_keyword contained close-stream closelog cmp-str collect-each
-syn keyword txl_keyword contained collect-each* comb compl-span-str cond
-syn keyword txl_keyword contained cons conses conses* consp
-syn keyword txl_keyword contained copy copy-alist copy-cons copy-hash
-syn keyword txl_keyword contained copy-list copy-str copy-vec cos
-syn keyword txl_keyword contained count-if countq countql countqual
-syn keyword txl_keyword contained cum-norm-dist daemon dec defmacro
-syn keyword txl_keyword contained defsymacro defun defvar del
-syn keyword txl_keyword contained delay delete-package do dohash
-syn keyword txl_keyword contained downcase-str dwim each each*
-syn keyword txl_keyword contained empty env env-fbind env-hash
-syn keyword txl_keyword contained env-vbind eq eql equal
-syn keyword txl_keyword contained errno error eval evenp
-syn keyword txl_keyword contained exit exp expt exptmod
-syn keyword txl_keyword contained fboundp fifth filter-equal filter-string-tree
-syn keyword txl_keyword contained find find-if find-package first
-syn keyword txl_keyword contained fixnump flatten flatten* flip
-syn keyword txl_keyword contained flo-int flo-str floatp floor
-syn keyword txl_keyword contained flush-stream for for* force
-syn keyword txl_keyword contained format fourth fun func-get-env
-syn keyword txl_keyword contained func-get-form func-set-env functionp gcd
-syn keyword txl_keyword contained gen generate gensym get-byte
-syn keyword txl_keyword contained get-char get-hash-userdata get-line get-list-from-stream
-syn keyword txl_keyword contained get-sig-handler get-string-from-stream gethash group-by
-syn keyword txl_keyword contained gun hash hash-alist hash-construct
-syn keyword txl_keyword contained hash-count hash-diff hash-eql hash-equal
-syn keyword txl_keyword contained hash-isec hash-keys hash-pairs hash-uni
-syn keyword txl_keyword contained hash-update hash-update-1 hash-values hashp
-syn keyword txl_keyword contained html-decode html-encode identity if
-syn keyword txl_keyword contained iff iffi inc inhash
-syn keyword txl_keyword contained int-flo int-str integerp intern
-syn keyword txl_keyword contained interp-fun-p isqrt keep-if keep-if*
-syn keyword txl_keyword contained keywordp lambda last lazy-str
-syn keyword txl_keyword contained lazy-str-force lazy-str-force-upto lazy-str-get-trailing-list lazy-stream-cons
-syn keyword txl_keyword contained lazy-stringp lcons-fun ldiff length
-syn keyword txl_keyword contained length-list length-str length-str-< length-str-<=
-syn keyword txl_keyword contained length-str-> length-str->= length-vec let
-syn keyword txl_keyword contained let* link lisp-parse list
-syn keyword txl_keyword contained list* list-str list-vector listp
-syn keyword txl_keyword contained log log-alert log-auth log-authpriv
-syn keyword txl_keyword contained log-cons log-crit log-daemon log-debug
-syn keyword txl_keyword contained log-emerg log-err log-info log-ndelay
-syn keyword txl_keyword contained log-notice log-nowait log-odelay log-perror
-syn keyword txl_keyword contained log-pid log-user log-warning log10
-syn keyword txl_keyword contained logand logior lognot logtest
-syn keyword txl_keyword contained logtrunc logxor macro-form-p macro-time
-syn keyword txl_keyword contained macroexpand macroexpand-1 macrolet major
-syn keyword txl_keyword contained make-catenated-stream make-env make-hash make-lazy-cons
-syn keyword txl_keyword contained make-like make-package make-random-state make-similar-hash
-syn keyword txl_keyword contained make-string-byte-input-stream make-string-input-stream make-string-output-stream make-strlist-output-stream
-syn keyword txl_keyword contained make-sym make-time make-time-utc make-trie
-syn keyword txl_keyword contained makedev mapcar mapcar* maphash
-syn keyword txl_keyword contained mappend mappend* mask match-fun
-syn keyword txl_keyword contained match-regex match-regex-right match-str match-str-tree
-syn keyword txl_keyword contained max memq memql memqual
-syn keyword txl_keyword contained merge min minor mkdir
-syn keyword txl_keyword contained mknod mkstring mod multi-sort
-syn keyword txl_keyword contained n-choose-k n-perm-k none not
-syn keyword txl_keyword contained nreverse null nullify num-chr
-syn keyword txl_keyword contained num-str numberp oddp op
-syn keyword txl_keyword contained open-command open-directory open-file open-files
-syn keyword txl_keyword contained open-files* open-pipe open-process open-tail
-syn keyword txl_keyword contained openlog or orf packagep
-syn keyword txl_keyword contained perm pop pos pos-if
-syn keyword txl_keyword contained posq posql posqual pprinl
-syn keyword txl_keyword contained pprint pprof prinl print
-syn keyword txl_keyword contained prof prog1 progn prop
-syn keyword txl_keyword contained proper-listp push pushhash put-byte
-syn keyword txl_keyword contained put-char put-line put-string pwd
-syn keyword txl_keyword contained qquote quasi quasilist quote
-syn keyword txl_keyword contained rand random random-fixnum random-state-p
-syn keyword txl_keyword contained range range* rcomb read
-syn keyword txl_keyword contained readlink real-time-stream-p reduce-left reduce-right
-syn keyword txl_keyword contained ref refset regex-compile regex-parse
-syn keyword txl_keyword contained regexp regsub rehome-sym remhash
-syn keyword txl_keyword contained remove-if remove-if* remove-path remq
-syn keyword txl_keyword contained remq* remql remql* remqual
-syn keyword txl_keyword contained remqual* rename-path repeat replace
-syn keyword txl_keyword contained replace-list replace-str replace-vec rest
-syn keyword txl_keyword contained return return-from reverse rlcp
-syn keyword txl_keyword contained rperm rplaca rplacd run
-syn keyword txl_keyword contained s-ifblk s-ifchr s-ifdir s-ififo
-syn keyword txl_keyword contained s-iflnk s-ifmt s-ifreg s-ifsock
-syn keyword txl_keyword contained s-irgrp s-iroth s-irusr s-irwxg
-syn keyword txl_keyword contained s-irwxo s-irwxu s-isgid s-isuid
-syn keyword txl_keyword contained s-isvtx s-iwgrp s-iwoth s-iwusr
-syn keyword txl_keyword contained s-ixgrp s-ixoth s-ixusr search
-syn keyword txl_keyword contained search-regex search-str search-str-tree second
-syn keyword txl_keyword contained seek-stream set set-diff set-hash-userdata
-syn keyword txl_keyword contained set-sig-handler sethash setlogmask sh
-syn keyword txl_keyword contained sig-abrt sig-alrm sig-bus sig-check
-syn keyword txl_keyword contained sig-chld sig-cont sig-fpe sig-hup
-syn keyword txl_keyword contained sig-ill sig-int sig-io sig-iot
-syn keyword txl_keyword contained sig-kill sig-lost sig-pipe sig-poll
-syn keyword txl_keyword contained sig-prof sig-pwr sig-quit sig-segv
-syn keyword txl_keyword contained sig-stkflt sig-stop sig-sys sig-term
-syn keyword txl_keyword contained sig-trap sig-tstp sig-ttin sig-ttou
-syn keyword txl_keyword contained sig-urg sig-usr1 sig-usr2 sig-vtalrm
-syn keyword txl_keyword contained sig-winch sig-xcpu sig-xfsz sin
-syn keyword txl_keyword contained sixth size-vec some sort
-syn keyword txl_keyword contained source-loc source-loc-str span-str splice
-syn keyword txl_keyword contained split-str split-str-set sqrt stat
-syn keyword txl_keyword contained stdlib str< str<= str=
-syn keyword txl_keyword contained str> str>= stream-get-prop stream-set-prop
-syn keyword txl_keyword contained streamp string-extend string-lt stringp
-syn keyword txl_keyword contained sub sub-list sub-str sub-vec
-syn keyword txl_keyword contained symacrolet symbol-function symbol-name symbol-package
-syn keyword txl_keyword contained symbol-value symbolp symlink sys-qquote
-syn keyword txl_keyword contained sys-splice sys-unquote syslog tan
-syn keyword txl_keyword contained third throw throwf time
-syn keyword txl_keyword contained time-fields-local time-fields-utc time-string-local time-string-utc
-syn keyword txl_keyword contained time-usec tofloat toint tok-str
-syn keyword txl_keyword contained tostring tostringp tree-bind tree-case
-syn keyword txl_keyword contained tree-find trie-add trie-compress trim-str
-syn keyword txl_keyword contained trunc typeof unget-byte unget-char
-syn keyword txl_keyword contained unless unquote until upcase-str
-syn keyword txl_keyword contained update url-decode url-encode usleep
-syn keyword txl_keyword contained uw-protect vec vec-push vec-set-length
-syn keyword txl_keyword contained vecref vector vector-list vectorp
-syn keyword txl_keyword contained when while with-saved-vars zerop
+syn keyword txl_keyword contained *stdout* *txr-version* *user-package* +
+syn keyword txl_keyword contained - / /= <
+syn keyword txl_keyword contained <= = > >=
+syn keyword txl_keyword contained abs abs-path-p acons acons-new
+syn keyword txl_keyword contained aconsql-new acos alist-nremove alist-remove
+syn keyword txl_keyword contained all and andf append
+syn keyword txl_keyword contained append* append-each append-each* apply
+syn keyword txl_keyword contained ash asin assoc assql
+syn keyword txl_keyword contained atan atan2 atom bignump
+syn keyword txl_keyword contained block boundp break-str call
+syn keyword txl_keyword contained car cat-str cat-vec catch
+syn keyword txl_keyword contained cdr ceil chain chdir
+syn keyword txl_keyword contained chr-isalnum chr-isalpha chr-isascii chr-iscntrl
+syn keyword txl_keyword contained chr-isdigit chr-isgraph chr-islower chr-isprint
+syn keyword txl_keyword contained chr-ispunct chr-isspace chr-isupper chr-isxdigit
+syn keyword txl_keyword contained chr-num chr-str chr-str-set chr-tolower
+syn keyword txl_keyword contained chr-toupper chrp close-stream closelog
+syn keyword txl_keyword contained cmp-str collect-each collect-each* comb
+syn keyword txl_keyword contained compl-span-str cond cons conses
+syn keyword txl_keyword contained conses* consp copy copy-alist
+syn keyword txl_keyword contained copy-cons copy-hash copy-list copy-str
+syn keyword txl_keyword contained copy-vec cos count-if countq
+syn keyword txl_keyword contained countql countqual cum-norm-dist daemon
+syn keyword txl_keyword contained dec defmacro defsymacro defun
+syn keyword txl_keyword contained defvar del delay delete-package
+syn keyword txl_keyword contained do dohash downcase-str dwim
+syn keyword txl_keyword contained each each* empty env
+syn keyword txl_keyword contained env-fbind env-hash env-vbind eq
+syn keyword txl_keyword contained eql equal errno error
+syn keyword txl_keyword contained eval evenp exit exp
+syn keyword txl_keyword contained expt exptmod false fboundp
+syn keyword txl_keyword contained fifth filter-equal filter-string-tree find
+syn keyword txl_keyword contained find-if find-max find-min find-package
+syn keyword txl_keyword contained first fixnump flatten flatten*
+syn keyword txl_keyword contained flip flo-int flo-str floatp
+syn keyword txl_keyword contained floor flush-stream for for*
+syn keyword txl_keyword contained force format fourth fun
+syn keyword txl_keyword contained func-get-env func-get-form func-set-env functionp
+syn keyword txl_keyword contained gcd gen generate gensym
+syn keyword txl_keyword contained get-byte get-char get-hash-userdata get-line
+syn keyword txl_keyword contained get-list-from-stream get-sig-handler get-string-from-stream gethash
+syn keyword txl_keyword contained group-by gun hash hash-alist
+syn keyword txl_keyword contained hash-construct hash-count hash-diff hash-eql
+syn keyword txl_keyword contained hash-equal hash-isec hash-keys hash-pairs
+syn keyword txl_keyword contained hash-uni hash-update hash-update-1 hash-values
+syn keyword txl_keyword contained hashp html-decode html-encode identity
+syn keyword txl_keyword contained if iff iffi inc
+syn keyword txl_keyword contained inhash int-flo int-str integerp
+syn keyword txl_keyword contained intern interp-fun-p isqrt keep-if
+syn keyword txl_keyword contained keep-if* keywordp lambda last
+syn keyword txl_keyword contained lazy-str lazy-str-force lazy-str-force-upto lazy-str-get-trailing-list
+syn keyword txl_keyword contained lazy-stream-cons lazy-stringp lcons-fun ldiff
+syn keyword txl_keyword contained length length-list length-str length-str-<
+syn keyword txl_keyword contained length-str-<= length-str-> length-str->= length-vec
+syn keyword txl_keyword contained let let* link lisp-parse
+syn keyword txl_keyword contained list list* list-str list-vector
+syn keyword txl_keyword contained listp log log-alert log-auth
+syn keyword txl_keyword contained log-authpriv log-cons log-crit log-daemon
+syn keyword txl_keyword contained log-debug log-emerg log-err log-info
+syn keyword txl_keyword contained log-ndelay log-notice log-nowait log-odelay
+syn keyword txl_keyword contained log-perror log-pid log-user log-warning
+syn keyword txl_keyword contained log10 logand logior lognot
+syn keyword txl_keyword contained logtest logtrunc logxor macro-form-p
+syn keyword txl_keyword contained macro-time macroexpand macroexpand-1 macrolet
+syn keyword txl_keyword contained major make-catenated-stream make-env make-hash
+syn keyword txl_keyword contained make-lazy-cons make-like make-package make-random-state
+syn keyword txl_keyword contained make-similar-hash make-string-byte-input-stream make-string-input-stream make-string-output-stream
+syn keyword txl_keyword contained make-strlist-output-stream make-sym make-time make-time-utc
+syn keyword txl_keyword contained make-trie makedev mapcar mapcar*
+syn keyword txl_keyword contained maphash mappend mappend* mask
+syn keyword txl_keyword contained match-fun match-regex match-regex-right match-str
+syn keyword txl_keyword contained match-str-tree max member member-if
+syn keyword txl_keyword contained memq memql memqual merge
+syn keyword txl_keyword contained min minor mkdir mknod
+syn keyword txl_keyword contained mkstring mod multi-sort n-choose-k
+syn keyword txl_keyword contained n-perm-k none not nreverse
+syn keyword txl_keyword contained null nullify num-chr num-str
+syn keyword txl_keyword contained numberp oddp op open-command
+syn keyword txl_keyword contained open-directory open-file open-files open-files*
+syn keyword txl_keyword contained open-pipe open-process open-tail openlog
+syn keyword txl_keyword contained or orf packagep perm
+syn keyword txl_keyword contained pop pos pos-if pos-max
+syn keyword txl_keyword contained pos-min posq posql posqual
+syn keyword txl_keyword contained pprinl pprint pprof prinl
+syn keyword txl_keyword contained print prof prog1 progn
+syn keyword txl_keyword contained prop proper-listp push pushhash
+syn keyword txl_keyword contained put-byte put-char put-line put-string
+syn keyword txl_keyword contained pwd qquote quasi quasilist
+syn keyword txl_keyword contained quote rand random random-fixnum
+syn keyword txl_keyword contained random-state-p range range* rcomb
+syn keyword txl_keyword contained read readlink real-time-stream-p reduce-left
+syn keyword txl_keyword contained reduce-right ref refset regex-compile
+syn keyword txl_keyword contained regex-parse regexp regsub rehome-sym
+syn keyword txl_keyword contained remhash remove-if remove-if* remove-path
+syn keyword txl_keyword contained remq remq* remql remql*
+syn keyword txl_keyword contained remqual remqual* rename-path repeat
+syn keyword txl_keyword contained replace replace-list replace-str replace-vec
+syn keyword txl_keyword contained rest return return-from reverse
+syn keyword txl_keyword contained rlcp rperm rplaca rplacd
+syn keyword txl_keyword contained run s-ifblk s-ifchr s-ifdir
+syn keyword txl_keyword contained s-ififo s-iflnk s-ifmt s-ifreg
+syn keyword txl_keyword contained s-ifsock s-irgrp s-iroth s-irusr
+syn keyword txl_keyword contained s-irwxg s-irwxo s-irwxu s-isgid
+syn keyword txl_keyword contained s-isuid s-isvtx s-iwgrp s-iwoth
+syn keyword txl_keyword contained s-iwusr s-ixgrp s-ixoth s-ixusr
+syn keyword txl_keyword contained search search-regex search-str search-str-tree
+syn keyword txl_keyword contained second seek-stream select seqp
+syn keyword txl_keyword contained set set-diff set-hash-userdata set-sig-handler
+syn keyword txl_keyword contained sethash setlogmask sh sig-abrt
+syn keyword txl_keyword contained sig-alrm sig-bus sig-check sig-chld
+syn keyword txl_keyword contained sig-cont sig-fpe sig-hup sig-ill
+syn keyword txl_keyword contained sig-int sig-io sig-iot sig-kill
+syn keyword txl_keyword contained sig-lost sig-pipe sig-poll sig-prof
+syn keyword txl_keyword contained sig-pwr sig-quit sig-segv sig-stkflt
+syn keyword txl_keyword contained sig-stop sig-sys sig-term sig-trap
+syn keyword txl_keyword contained sig-tstp sig-ttin sig-ttou sig-urg
+syn keyword txl_keyword contained sig-usr1 sig-usr2 sig-vtalrm sig-winch
+syn keyword txl_keyword contained sig-xcpu sig-xfsz sin sixth
+syn keyword txl_keyword contained size-vec some sort source-loc
+syn keyword txl_keyword contained source-loc-str span-str splice split-str
+syn keyword txl_keyword contained split-str-set sqrt stat stdlib
+syn keyword txl_keyword contained str< str<= str= str>
+syn keyword txl_keyword contained str>= stream-get-prop stream-set-prop streamp
+syn keyword txl_keyword contained string-extend string-lt stringp sub
+syn keyword txl_keyword contained sub-list sub-str sub-vec symacrolet
+syn keyword txl_keyword contained symbol-function symbol-name symbol-package symbol-value
+syn keyword txl_keyword contained symbolp symlink sys-qquote sys-splice
+syn keyword txl_keyword contained sys-unquote syslog tan third
+syn keyword txl_keyword contained throw throwf time time-fields-local
+syn keyword txl_keyword contained time-fields-utc time-string-local time-string-utc time-usec
+syn keyword txl_keyword contained tofloat toint tok-str tostring
+syn keyword txl_keyword contained tostringp tree-bind tree-case tree-find
+syn keyword txl_keyword contained trie-add trie-compress trim-str true
+syn keyword txl_keyword contained trunc tuples typeof unget-byte
+syn keyword txl_keyword contained unget-char unless unquote until
+syn keyword txl_keyword contained upcase-str update url-decode url-encode
+syn keyword txl_keyword contained usleep uw-protect vec vec-push
+syn keyword txl_keyword contained vec-set-length vecref vector vector-list
+syn keyword txl_keyword contained vectorp when where while
+syn keyword txl_keyword contained with-saved-vars zerop
syn match txr_error "@[\t ]*[*]\?[\t ]*."
syn match txr_nested_error "[^\t `]\+" contained