You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
4 lines
162 KiB
HTML
4 lines
162 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
|
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"/><title>txexpr: Tagged X-expressions</title><link rel="stylesheet" type="text/css" href="scribble.css" title="default"/><link rel="stylesheet" type="text/css" href="racket.css" title="default"/><link rel="stylesheet" type="text/css" href="manual-style.css" title="default"/><link rel="stylesheet" type="text/css" href="manual-racket.css" title="default"/><script type="text/javascript" src="scribble-common.js"></script><script type="text/javascript" src="manual-racket.js"></script><!--[if IE 6]><style type="text/css">.SIEHidden { overflow: hidden; }</style><![endif]--></head><body id="scribble-racket-lang-org"><div class="tocset"><div class="tocview"><div class="tocviewlist tocviewlisttopspace"><div class="tocviewtitle"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,"tocview_0");">►</a></td><td></td><td><a href="index.html" class="tocviewselflink" data-pltdoc="x">txexpr:<span class="mywbr"> </span> Tagged X-<wbr></wbr>expressions</a></td></tr></table></div><div class="tocviewsublistonly" style="display: none;" id="tocview_0"><table cellspacing="0" cellpadding="0"><tr><td align="right">1 </td><td><a href="index.html#%28part._.Installation%29" class="tocviewlink" data-pltdoc="x">Installation</a></td></tr><tr><td align="right">2 </td><td><a href="index.html#%28part._.Importing_the_module%29" class="tocviewlink" data-pltdoc="x">Importing the module</a></td></tr><tr><td align="right">3 </td><td><a href="index.html#%28part._.What_s_a_txexpr_%29" class="tocviewlink" data-pltdoc="x">What’s a txexpr?</a></td></tr><tr><td align="right">4 </td><td><a href="index.html#%28part._.Why_not_just_use_match__quasiquote__and_so_on_%29" class="tocviewlink" data-pltdoc="x">Why not just use <span class="stt">match</span>, <span class="stt">quasiquote</span>, and so on?</a></td></tr><tr><td align="right">5 </td><td><a href="index.html#%28part._.Interface%29" class="tocviewlink" data-pltdoc="x">Interface</a></td></tr><tr><td align="right">6 </td><td><a href="index.html#%28part._.License___source_code%29" class="tocviewlink" data-pltdoc="x">License & source code</a></td></tr></table></div></div></div><div class="tocsub"><table class="tocsublist" cellspacing="0"><tr><td><span class="tocsublinknumber"></span><a href="#%28part._txexpr__.Tagged_.X-expressions%29" class="tocsubseclink" data-pltdoc="x">txexpr:<span class="mywbr"> </span> Tagged X-<wbr></wbr>expressions</a></td></tr><tr><td><span class="tocsublinknumber">1<tt> </tt></span><a href="#%28part._.Installation%29" class="tocsubseclink" data-pltdoc="x">Installation</a></td></tr><tr><td><span class="tocsublinknumber">2<tt> </tt></span><a href="#%28part._.Importing_the_module%29" class="tocsubseclink" data-pltdoc="x">Importing the module</a></td></tr><tr><td><span class="tocsublinknumber">3<tt> </tt></span><a href="#%28part._.What_s_a_txexpr_%29" class="tocsubseclink" data-pltdoc="x">What’s a txexpr?</a></td></tr><tr><td><span class="tocsublinknumber">4<tt> </tt></span><a href="#%28part._.Why_not_just_use_match__quasiquote__and_so_on_%29" class="tocsubseclink" data-pltdoc="x">Why not just use <span class="stt">match</span>, <span class="stt">quasiquote</span>, and so on?</a></td></tr><tr><td><span class="tocsublinknumber">5<tt> </tt></span><a href="#%28part._.Interface%29" class="tocsubseclink" data-pltdoc="x">Interface</a></td></tr><tr><td><a href="#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">txexpr?</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr-tag~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">txexpr-<wbr></wbr>tag?</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr-attr~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">txexpr-<wbr></wbr>attr?</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr-attr-key~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">txexpr-<wbr></wbr>attr-<wbr></wbr>key?</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr-attr-value~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">txexpr-<wbr></wbr>attr-<wbr></wbr>value?</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr-element~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">txexpr-<wbr></wbr>element?</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr-attrs~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">txexpr-<wbr></wbr>attrs?</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr-elements~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">txexpr-<wbr></wbr>elements?</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._txexpr%2Fmain..rkt%29._validate-txexpr%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">validate-<wbr></wbr>txexpr</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._txexpr%2Fmain..rkt%29._can-be-txexpr-attr-key~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">can-<wbr></wbr>be-<wbr></wbr>txexpr-<wbr></wbr>attr-<wbr></wbr>key?</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._txexpr%2Fmain..rkt%29._can-be-txexpr-attr-value~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">can-<wbr></wbr>be-<wbr></wbr>txexpr-<wbr></wbr>attr-<wbr></wbr>value?</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._txexpr%2Fmain..rkt%29._-~3etxexpr-attr-key%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink"><span class="nobreak">-<wbr></wbr>></span>txexpr-<wbr></wbr>attr-<wbr></wbr>key</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._txexpr%2Fmain..rkt%29._-~3etxexpr-attr-value%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink"><span class="nobreak">-<wbr></wbr>></span>txexpr-<wbr></wbr>attr-<wbr></wbr>value</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr-~3evalues%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">txexpr-<wbr></wbr>>values</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr-~3elist%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">txexpr-<wbr></wbr>>list</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._txexpr%2Fmain..rkt%29._xexpr-~3ehtml%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">xexpr-<wbr></wbr>>html</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._txexpr%2Fmain..rkt%29._get-tag%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">get-<wbr></wbr>tag</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._txexpr%2Fmain..rkt%29._get-attrs%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">get-<wbr></wbr>attrs</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._txexpr%2Fmain..rkt%29._get-elements%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">get-<wbr></wbr>elements</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._txexpr%2Fmain..rkt%29._make-txexpr%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">make-<wbr></wbr>txexpr</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._txexpr%2Fmain..rkt%29._can-be-txexpr-attrs~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">can-<wbr></wbr>be-<wbr></wbr>txexpr-<wbr></wbr>attrs?</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._txexpr%2Fmain..rkt%29._attrs-~3ehash%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">attrs-<wbr></wbr>>hash</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._txexpr%2Fmain..rkt%29._hash-~3eattrs%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">hash-<wbr></wbr>>attrs</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._txexpr%2Fmain..rkt%29._attrs-have-key~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">attrs-<wbr></wbr>have-<wbr></wbr>key?</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._txexpr%2Fmain..rkt%29._attr-ref%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">attr-<wbr></wbr>ref</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._txexpr%2Fmain..rkt%29._attr-set%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">attr-<wbr></wbr>set</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._txexpr%2Fmain..rkt%29._merge-attrs%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">merge-<wbr></wbr>attrs</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._txexpr%2Fmain..rkt%29._remove-attrs%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">remove-<wbr></wbr>attrs</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._txexpr%2Fmain..rkt%29._map-elements%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">map-<wbr></wbr>elements</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._txexpr%2Fmain..rkt%29._map-elements%2Fexclude%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">map-<wbr></wbr>elements/<span class="mywbr"> </span>exclude</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._txexpr%2Fmain..rkt%29._splitf-txexpr%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">splitf-<wbr></wbr>txexpr</span></span></a></td></tr><tr><td><span class="tocsublinknumber">6<tt> </tt></span><a href="#%28part._.License___source_code%29" class="tocsubseclink" data-pltdoc="x">License & source code</a></td></tr></table></div></div><div class="maincolumn"><div class="main"><div class="versionbox"><span class="versionNoNav">6.0.1.11</span></div><h2><a name="(part._txexpr__.Tagged_.X-expressions)"></a><a name="(mod-path._txexpr)"></a><a name="(mod-path._(submod._txexpr._safe))"></a>txexpr: Tagged X-expressions</h2><div class="SAuthorListBox"><span class="SAuthorList"><p class="author">Matthew Butterick <<a href="mailto:mb@mbtype.com">mb@mbtype.com</a>></p></span></div><p><table cellspacing="0" class="defmodule"><tr><td align="left"><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/require.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._require%29%29" class="RktStxLink" data-pltdoc="x">require</a></span><span class="stt"> </span><a href="index.html" class="RktModLink" data-pltdoc="x"><span class="RktSym">txexpr</span></a><span class="RktPn">)</span></td><td align="right"><span class="RpackageSpec"><span class="Smaller"> package:</span> <span class="stt">txexpr</span></span></td></tr><tr><td align="left" colspan="2"><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/require.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._require%29%29" class="RktStxLink" data-pltdoc="x">require</a></span><span class="stt"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/require.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._submod%29%29" class="RktStxLink" data-pltdoc="x">submod</a></span><span class="stt"> </span><span class="RktSym">txexpr</span><span class="stt"> </span><span class="RktSym">safe</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></p><p>A set of small but handy functions for improving the readability and reliability of programs that operate on tagged X-expressions (for short, <span style="font-style: italic">txexpr</span>s).</p><h3>1<tt> </tt><a name="(part._.Installation)"></a>Installation</h3><p><div class="SIntrapara">At the command line:
|
|
</div><div class="SIntrapara"><table cellspacing="0"><tr><td><p><span class="stt">raco pkg install txexpr</span></p></td></tr></table></div></p><p><div class="SIntrapara">After that, you can update the package from the command line:
|
|
</div><div class="SIntrapara"><table cellspacing="0"><tr><td><p><span class="stt">raco pkg update txexpr</span></p></td></tr></table></div></p><h3>2<tt> </tt><a name="(part._.Importing_the_module)"></a>Importing the module</h3><p>The module operates in two modes: fast and safe. Fast mode is the default, which you get by importing the module in the usual way: <span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/require.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._require%29%29" class="RktStxLink" data-pltdoc="x">require</a></span><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktSym">txexpr</span><span class="RktPn">)</span><span class="RktMeta"></span>.</p><p>Safe mode enables the function contracts documented below. Use safe mode by importing the module as <span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/require.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._require%29%29" class="RktStxLink" data-pltdoc="x">require</a></span><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/require.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._submod%29%29" class="RktStxLink" data-pltdoc="x">submod</a></span><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktSym">txexpr</span><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktSym">safe</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktMeta"></span>.</p><h3>3<tt> </tt><a name="(part._.What_s_a_txexpr_)"></a>What’s a txexpr?</h3><p>It’s an X-expression with the following grammar:</p><p><table cellspacing="0"><tr><td align="right" valign="baseline"><span class="hspace"> </span><span class="RktVar">txexpr</span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline">=</td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/pairs.html#%28def._%28%28quote._~23~25kernel%29._list%29%29" class="RktValLink" data-pltdoc="x">list</a></span><span class="hspace"> </span><span class="RktVar">tag</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/pairs.html#%28def._%28%28quote._~23~25kernel%29._list%29%29" class="RktValLink" data-pltdoc="x">list</a></span><span class="hspace"> </span><span class="RktVar">attr</span><span class="hspace"> </span><span class="RktSym">...</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVar">element</span><span class="hspace"> </span><span class="RktSym">...</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/pairs.html#%28def._%28%28quote._~23~25kernel%29._cons%29%29" class="RktValLink" data-pltdoc="x">cons</a></span><span class="hspace"> </span><span class="RktVar">tag</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/pairs.html#%28def._%28%28quote._~23~25kernel%29._list%29%29" class="RktValLink" data-pltdoc="x">list</a></span><span class="hspace"> </span><span class="RktVar">element</span><span class="hspace"> </span><span class="RktSym">...</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td></tr><tr><td align="right" valign="baseline"><span class="hspace"> </span><span class="RktVar">tag</span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline">=</td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="RktSym"><a href="http://docs.racket-lang.org/reference/symbols.html#%28def._%28%28quote._~23~25kernel%29._symbol~3f%29%29" class="RktValLink" data-pltdoc="x">symbol?</a></span></td></tr><tr><td align="right" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td></tr><tr><td align="right" valign="baseline"><span class="hspace"> </span><span class="RktVar">attr</span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline">=</td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/pairs.html#%28def._%28%28quote._~23~25kernel%29._list%29%29" class="RktValLink" data-pltdoc="x">list</a></span><span class="hspace"> </span><span class="RktVar">key</span><span class="hspace"> </span><span class="RktVar">value</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td></tr><tr><td align="right" valign="baseline"><span class="hspace"> </span><span class="RktVar">key</span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline">=</td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="RktSym"><a href="http://docs.racket-lang.org/reference/symbols.html#%28def._%28%28quote._~23~25kernel%29._symbol~3f%29%29" class="RktValLink" data-pltdoc="x">symbol?</a></span></td></tr><tr><td align="right" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td></tr><tr><td align="right" valign="baseline"><span class="hspace"> </span><span class="RktVar">value</span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline">=</td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="RktSym"><a href="http://docs.racket-lang.org/reference/strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span></td></tr><tr><td align="right" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td></tr><tr><td align="right" valign="baseline"><span class="hspace"> </span><span class="RktVar">element</span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline">=</td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="RktSym"><a href="http://docs.racket-lang.org/xml/index.html#%28def._%28%28lib._xml%2Fprivate%2Fxexpr-core..rkt%29._xexpr~3f%29%29" class="RktValLink" data-pltdoc="x">xexpr?</a></span></td></tr></table></p><p>A txexpr is a list with a symbol in the first position — the <span style="font-style: italic">tag</span> — followed by a series of <span style="font-style: italic">elements</span>, which are other X-expressions. Optionally, a txexpr can have a list of <span style="font-style: italic">attributes</span> in the second position.</p><p><table cellspacing="0" class="RktBlk"><tr><td><p>Examples:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr~3f%29%29" class="RktValLink" data-pltdoc="x">txexpr?</a></span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">span</span><span class="hspace"> </span><span class="RktVal">"Brennan"</span><span class="hspace"> </span><span class="RktVal">"Dale"</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#t</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr~3f%29%29" class="RktValLink" data-pltdoc="x">txexpr?</a></span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">span</span><span class="hspace"> </span><span class="RktVal">"Brennan"</span><span class="hspace"> </span><span class="RktVal">(</span><span class="RktVal">em</span><span class="hspace"> </span><span class="RktVal">"Richard"</span><span class="RktVal">)</span><span class="hspace"> </span><span class="RktVal">"Dale"</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#t</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr~3f%29%29" class="RktValLink" data-pltdoc="x">txexpr?</a></span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">span</span><span class="hspace"> </span><span class="RktVal">[</span><span class="RktVal">[</span><span class="RktVal">class</span><span class="hspace"> </span><span class="RktVal">"hidden"</span><span class="RktVal">]</span><span class="RktVal">[</span><span class="RktVal">id</span><span class="hspace"> </span><span class="RktVal">"names"</span><span class="RktVal">]</span><span class="RktVal">]</span><span class="hspace"> </span><span class="RktVal">"Brennan"</span><span class="hspace"> </span><span class="RktVal">"Dale"</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#t</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr~3f%29%29" class="RktValLink" data-pltdoc="x">txexpr?</a></span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">span</span><span class="hspace"> </span><span class="RktVal">lt</span><span class="hspace"> </span><span class="RktVal">gt</span><span class="hspace"> </span><span class="RktVal">amp</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#t</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr~3f%29%29" class="RktValLink" data-pltdoc="x">txexpr?</a></span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">"We really"</span><span class="hspace"> </span><span class="RktVal">"should have"</span><span class="hspace"> </span><span class="RktVal">"a tag"</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#f</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr~3f%29%29" class="RktValLink" data-pltdoc="x">txexpr?</a></span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">span</span><span class="hspace"> </span><span class="RktVal">[</span><span class="RktVal">[</span><span class="RktVal">class</span><span class="hspace"> </span><span class="RktVal">not-quoted</span><span class="RktVal">]</span><span class="RktVal">]</span><span class="hspace"> </span><span class="RktVal">"Brennan"</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#f</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr~3f%29%29" class="RktValLink" data-pltdoc="x">txexpr?</a></span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">span</span><span class="hspace"> </span><span class="RktVal">[</span><span class="RktVal">class</span><span class="hspace"> </span><span class="RktVal">"hidden"</span><span class="RktVal">]</span><span class="hspace"> </span><span class="RktVal">"Brennan"</span><span class="hspace"> </span><span class="RktVal">"Dale"</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#t</span></p></td></tr></table></blockquote></td></tr></table></p><p>The last one is a common mistake. Because the key–value pair is not enclosed in a <span class="RktSym"><a href="http://docs.racket-lang.org/reference/pairs.html#%28def._%28%28quote._~23~25kernel%29._list%29%29" class="RktValLink" data-pltdoc="x">list</a></span>, it’s interpreted as a nested txexpr within the first txexpr, as you may not find out until you try to read its attributes:</p><blockquote class="refpara"><blockquote class="refcolumn"><blockquote class="refcontent"><p>There’s no way of eliminating this ambiguity, short of always requiring an attribute list — empty if necessary — in your txexpr. See also <span class="RktSym"><a href="http://docs.racket-lang.org/xml/index.html#%28def._%28%28lib._xml%2Fmain..rkt%29._xexpr-drop-empty-attributes%29%29" class="RktValLink" data-pltdoc="x">xexpr-drop-empty-attributes</a></span>.</p></blockquote></blockquote></blockquote><p><table cellspacing="0" class="RktBlk"><tr><td><p>Examples:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._get-attrs%29%29" class="RktValLink" data-pltdoc="x">get-attrs</a></span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">span</span><span class="hspace"> </span><span class="RktVal">[</span><span class="RktVal">class</span><span class="hspace"> </span><span class="RktVal">"hidden"</span><span class="RktVal">]</span><span class="hspace"> </span><span class="RktVal">"Brennan"</span><span class="hspace"> </span><span class="RktVal">"Dale"</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'()</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._get-elements%29%29" class="RktValLink" data-pltdoc="x">get-elements</a></span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">span</span><span class="hspace"> </span><span class="RktVal">[</span><span class="RktVal">class</span><span class="hspace"> </span><span class="RktVal">"hidden"</span><span class="RktVal">]</span><span class="hspace"> </span><span class="RktVal">"Brennan"</span><span class="hspace"> </span><span class="RktVal">"Dale"</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'((class "hidden") "Brennan" "Dale")</span></p></td></tr></table></blockquote></td></tr></table></p><p>Tagged X-expressions are most commonly found in HTML & XML documents. Though the notation is different in Racket, the data structure is identical:</p><p><table cellspacing="0" class="RktBlk"><tr><td><p>Examples:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/xml/index.html#%28def._%28%28lib._xml%2Fmain..rkt%29._xexpr-~3estring%29%29" class="RktValLink" data-pltdoc="x">xexpr->string</a></span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">span</span><span class="hspace"> </span><span class="RktVal">[</span><span class="RktVal">[</span><span class="RktVal">id</span><span class="hspace"> </span><span class="RktVal">"names"</span><span class="RktVal">]</span><span class="RktVal">]</span><span class="hspace"> </span><span class="RktVal">"Brennan"</span><span class="hspace"> </span><span class="RktVal">(</span><span class="RktVal">em</span><span class="hspace"> </span><span class="RktVal">"Richard"</span><span class="RktVal">)</span><span class="hspace"> </span><span class="RktVal">"Dale"</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">"<span id=\"names\">Brennan<em>Richard</em>Dale</span>"</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/xml/index.html#%28def._%28%28lib._xml%2Fmain..rkt%29._string-~3exexpr%29%29" class="RktValLink" data-pltdoc="x">string->xexpr</a></span><span class="hspace"> </span><span class="RktVal">"<span id=\"names\">Brennan<em>Richard</em>Dale</span>"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'(span ((id "names")) "Brennan" (em () "Richard") "Dale")</span></p></td></tr></table></blockquote></td></tr></table></p><p>After converting to and from HTML, we get back the original X-expression. Well, almost. The brackets turned into parentheses — no big deal, since they mean the same thing in Racket. Also, per its usual practice, <span class="RktSym"><a href="http://docs.racket-lang.org/xml/index.html#%28def._%28%28lib._xml%2Fmain..rkt%29._string-~3exexpr%29%29" class="RktValLink" data-pltdoc="x">string->xexpr</a></span> added an empty attribute list after <span class="RktSym">em</span>. This is also benign.</p><h3>4<tt> </tt><a name="(part._.Why_not_just_use_match__quasiquote__and_so_on_)"></a>Why not just use <span class="stt">match</span>, <span class="stt">quasiquote</span>, and so on?</h3><p>If you prefer those, please do. But I’ve found two benefits to using module functions:</p><p><span style="font-weight: bold">Readability.</span> In code that already has a lot of matching and quasiquoting going on, these functions make it easy to see where & how txexprs are being used.</p><p><span style="font-weight: bold">Reliability.</span> Because txexprs come in two close but not quite equal forms, careful coders will always have to take both cases into account.</p><p>The programming is trivial, but the annoyance is real.</p><h3>5<tt> </tt><a name="(part._.Interface)"></a>Interface</h3><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" class="boxed RBoxed"><tr><td><table cellspacing="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._txexpr/main..rkt)._txexpr~3f))"></a><span title="Provided from: txexpr, (submod txexpr safe) | Package: txexpr"><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">txexpr?</a></span></span><span class="hspace"> </span><span class="RktVar">v</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/booleans.html#%28def._%28%28quote._~23~25kernel%29._boolean~3f%29%29" class="RktValLink" data-pltdoc="x">boolean?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">v</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span></td></tr></table></td></tr><tr><td><table cellspacing="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._txexpr/main..rkt)._txexpr-tag~3f))"></a><span title="Provided from: txexpr, (submod txexpr safe) | Package: txexpr"><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr-tag~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">txexpr-tag?</a></span></span><span class="hspace"> </span><span class="RktVar">v</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/booleans.html#%28def._%28%28quote._~23~25kernel%29._boolean~3f%29%29" class="RktValLink" data-pltdoc="x">boolean?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">v</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span></td></tr></table></td></tr><tr><td><table cellspacing="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._txexpr/main..rkt)._txexpr-attr~3f))"></a><span title="Provided from: txexpr, (submod txexpr safe) | Package: txexpr"><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr-attr~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">txexpr-attr?</a></span></span><span class="hspace"> </span><span class="RktVar">v</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/booleans.html#%28def._%28%28quote._~23~25kernel%29._boolean~3f%29%29" class="RktValLink" data-pltdoc="x">boolean?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">v</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span></td></tr></table></td></tr><tr><td><table cellspacing="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._txexpr/main..rkt)._txexpr-attr-key~3f))"></a><span title="Provided from: txexpr, (submod txexpr safe) | Package: txexpr"><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr-attr-key~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">txexpr-attr-key?</a></span></span><span class="hspace"> </span><span class="RktVar">v</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/booleans.html#%28def._%28%28quote._~23~25kernel%29._boolean~3f%29%29" class="RktValLink" data-pltdoc="x">boolean?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">v</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span></td></tr></table></td></tr><tr><td><table cellspacing="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._txexpr/main..rkt)._txexpr-attr-value~3f))"></a><span title="Provided from: txexpr, (submod txexpr safe) | Package: txexpr"><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr-attr-value~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">txexpr-attr-value?</a></span></span><span class="hspace"> </span><span class="RktVar">v</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/booleans.html#%28def._%28%28quote._~23~25kernel%29._boolean~3f%29%29" class="RktValLink" data-pltdoc="x">boolean?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">v</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span></td></tr></table></td></tr><tr><td><table cellspacing="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._txexpr/main..rkt)._txexpr-element~3f))"></a><span title="Provided from: txexpr, (submod txexpr safe) | Package: txexpr"><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr-element~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">txexpr-element?</a></span></span><span class="hspace"> </span><span class="RktVar">v</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/booleans.html#%28def._%28%28quote._~23~25kernel%29._boolean~3f%29%29" class="RktValLink" data-pltdoc="x">boolean?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">v</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span></td></tr></table></td></tr></table></blockquote></div><div class="SIntrapara">Predicates for <span class="RktVar">txexpr</span>s that implement this grammar:</div></p><p><table cellspacing="0"><tr><td align="right" valign="baseline"><span class="hspace"> </span><span class="RktVar">txexpr</span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline">=</td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/pairs.html#%28def._%28%28quote._~23~25kernel%29._list%29%29" class="RktValLink" data-pltdoc="x">list</a></span><span class="hspace"> </span><span class="RktVar">tag</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/pairs.html#%28def._%28%28quote._~23~25kernel%29._list%29%29" class="RktValLink" data-pltdoc="x">list</a></span><span class="hspace"> </span><span class="RktVar">attr</span><span class="hspace"> </span><span class="RktSym">...</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVar">element</span><span class="hspace"> </span><span class="RktSym">...</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline">|</td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/pairs.html#%28def._%28%28quote._~23~25kernel%29._cons%29%29" class="RktValLink" data-pltdoc="x">cons</a></span><span class="hspace"> </span><span class="RktVar">tag</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/pairs.html#%28def._%28%28quote._~23~25kernel%29._list%29%29" class="RktValLink" data-pltdoc="x">list</a></span><span class="hspace"> </span><span class="RktVar">element</span><span class="hspace"> </span><span class="RktSym">...</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td></tr><tr><td align="right" valign="baseline"><span class="hspace"> </span><span class="RktVar">tag</span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline">=</td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="RktSym"><a href="http://docs.racket-lang.org/reference/symbols.html#%28def._%28%28quote._~23~25kernel%29._symbol~3f%29%29" class="RktValLink" data-pltdoc="x">symbol?</a></span></td></tr><tr><td align="right" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td></tr><tr><td align="right" valign="baseline"><span class="hspace"> </span><span class="RktVar">attr</span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline">=</td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/pairs.html#%28def._%28%28quote._~23~25kernel%29._list%29%29" class="RktValLink" data-pltdoc="x">list</a></span><span class="hspace"> </span><span class="RktVar">key</span><span class="hspace"> </span><span class="RktVar">value</span><span class="RktPn">)</span></td></tr><tr><td align="right" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td></tr><tr><td align="right" valign="baseline"><span class="hspace"> </span><span class="RktVar">key</span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline">=</td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="RktSym"><a href="http://docs.racket-lang.org/reference/symbols.html#%28def._%28%28quote._~23~25kernel%29._symbol~3f%29%29" class="RktValLink" data-pltdoc="x">symbol?</a></span></td></tr><tr><td align="right" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td></tr><tr><td align="right" valign="baseline"><span class="hspace"> </span><span class="RktVar">value</span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline">=</td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="RktSym"><a href="http://docs.racket-lang.org/reference/strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span></td></tr><tr><td align="right" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="stt"> </span></td></tr><tr><td align="right" valign="baseline"><span class="hspace"> </span><span class="RktVar">element</span></td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="center" valign="baseline">=</td><td align="left" valign="baseline"><span class="stt"> </span></td><td align="left" valign="baseline"><span class="RktSym"><a href="http://docs.racket-lang.org/xml/index.html#%28def._%28%28lib._xml%2Fprivate%2Fxexpr-core..rkt%29._xexpr~3f%29%29" class="RktValLink" data-pltdoc="x">xexpr?</a></span></td></tr></table></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" class="boxed RBoxed"><tr><td><table cellspacing="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._txexpr/main..rkt)._txexpr-attrs~3f))"></a><span title="Provided from: txexpr, (submod txexpr safe) | Package: txexpr"><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr-attrs~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">txexpr-attrs?</a></span></span><span class="hspace"> </span><span class="RktVar">v</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/booleans.html#%28def._%28%28quote._~23~25kernel%29._boolean~3f%29%29" class="RktValLink" data-pltdoc="x">boolean?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">v</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span></td></tr></table></td></tr><tr><td><table cellspacing="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._txexpr/main..rkt)._txexpr-elements~3f))"></a><span title="Provided from: txexpr, (submod txexpr safe) | Package: txexpr"><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr-elements~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">txexpr-elements?</a></span></span><span class="hspace"> </span><span class="RktVar">v</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/booleans.html#%28def._%28%28quote._~23~25kernel%29._boolean~3f%29%29" class="RktValLink" data-pltdoc="x">boolean?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">v</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span></td></tr></table></td></tr></table></blockquote></div><div class="SIntrapara">Shorthand for <span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._listof%29%29" class="RktValLink" data-pltdoc="x">listof</a></span><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr-attr~3f%29%29" class="RktValLink" data-pltdoc="x">txexpr-attr?</a></span><span class="RktPn">)</span><span class="RktMeta"></span> and <span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._listof%29%29" class="RktValLink" data-pltdoc="x">listof</a></span><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr-element~3f%29%29" class="RktValLink" data-pltdoc="x">txexpr-element?</a></span><span class="RktPn">)</span><span class="RktMeta"></span>.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._txexpr/main..rkt)._validate-txexpr))"></a><span title="Provided from: txexpr, (submod txexpr safe) | Package: txexpr"><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._validate-txexpr%29%29" class="RktValDef RktValLink" data-pltdoc="x">validate-txexpr</a></span></span><span class="hspace"> </span><span class="RktVar">possible-txexpr</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr~3f%29%29" class="RktValLink" data-pltdoc="x">txexpr?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">possible-txexpr</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Like <span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr~3f%29%29" class="RktValLink" data-pltdoc="x">txexpr?</a></span>, but raises a descriptive error if <span class="RktVar">possible-txexpr</span> is invalid, and otherwise returns <span class="RktVar">possible-txexpr</span> itself.</div></p><p><table cellspacing="0" class="RktBlk"><tr><td><p>Examples:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._validate-txexpr%29%29" class="RktValLink" data-pltdoc="x">validate-txexpr</a></span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">root</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktErr">validate-txexpr: 'root is not a list starting with a symbol</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._validate-txexpr%29%29" class="RktValLink" data-pltdoc="x">validate-txexpr</a></span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">root</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'(root)</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._validate-txexpr%29%29" class="RktValLink" data-pltdoc="x">validate-txexpr</a></span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">root</span><span class="hspace"> </span><span class="RktVal">(</span><span class="RktVal">(</span><span class="RktVal">id</span><span class="hspace"> </span><span class="RktVal">"top"</span><span class="RktVal">)</span><span class="RktVal">(</span><span class="RktVal">class</span><span class="hspace"> </span><span class="RktVal">42</span><span class="RktVal">)</span><span class="RktVal">)</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktErr">validate-txexpr-attrs: in '(root ((id "top") (class 42))),</span></p></td></tr><tr><td><p><span class="RktErr">'((id "top") (class 42)) is not a valid list of attributes</span></p></td></tr><tr><td><p><span class="RktErr">because '(class 42) is not in the form '(symbol "string")</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._validate-txexpr%29%29" class="RktValLink" data-pltdoc="x">validate-txexpr</a></span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">root</span><span class="hspace"> </span><span class="RktVal">(</span><span class="RktVal">(</span><span class="RktVal">id</span><span class="hspace"> </span><span class="RktVal">"top"</span><span class="RktVal">)</span><span class="RktVal">(</span><span class="RktVal">class</span><span class="hspace"> </span><span class="RktVal">"42"</span><span class="RktVal">)</span><span class="RktVal">)</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'(root ((id "top") (class "42")))</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._validate-txexpr%29%29" class="RktValLink" data-pltdoc="x">validate-txexpr</a></span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">root</span><span class="hspace"> </span><span class="RktVal">(</span><span class="RktVal">(</span><span class="RktVal">id</span><span class="hspace"> </span><span class="RktVal">"top"</span><span class="RktVal">)</span><span class="RktVal">(</span><span class="RktVal">class</span><span class="hspace"> </span><span class="RktVal">"42"</span><span class="RktVal">)</span><span class="RktVal">)</span><span class="hspace"> </span><span class="RktVal">(</span><span class="RktVal">"hi"</span><span class="RktVal">)</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktErr">validate-txexpr-element: in '(root ((id "top") (class "42"))</span></p></td></tr><tr><td><p><span class="RktErr">("hi")), '("hi") is not a valid element (must be txexpr,</span></p></td></tr><tr><td><p><span class="RktErr">string, symbol, XML char, or cdata)</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._validate-txexpr%29%29" class="RktValLink" data-pltdoc="x">validate-txexpr</a></span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">root</span><span class="hspace"> </span><span class="RktVal">(</span><span class="RktVal">(</span><span class="RktVal">id</span><span class="hspace"> </span><span class="RktVal">"top"</span><span class="RktVal">)</span><span class="RktVal">(</span><span class="RktVal">class</span><span class="hspace"> </span><span class="RktVal">"42"</span><span class="RktVal">)</span><span class="RktVal">)</span><span class="hspace"> </span><span class="RktVal">"hi"</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'(root ((id "top") (class "42")) "hi")</span></p></td></tr></table></blockquote></td></tr></table></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" class="boxed RBoxed"><tr><td><table cellspacing="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._txexpr/main..rkt)._can-be-txexpr-attr-key~3f))"></a><span title="Provided from: txexpr, (submod txexpr safe) | Package: txexpr"><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._can-be-txexpr-attr-key~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">can-be-txexpr-attr-key?</a></span></span><span class="hspace"> </span><span class="RktVar">v</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/booleans.html#%28def._%28%28quote._~23~25kernel%29._boolean~3f%29%29" class="RktValLink" data-pltdoc="x">boolean?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">v</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span></td></tr></table></td></tr><tr><td><table cellspacing="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._txexpr/main..rkt)._can-be-txexpr-attr-value~3f))"></a><span title="Provided from: txexpr, (submod txexpr safe) | Package: txexpr"><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._can-be-txexpr-attr-value~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">can-be-txexpr-attr-value?</a></span></span><span class="hspace"> </span><span class="RktVar">v</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/booleans.html#%28def._%28%28quote._~23~25kernel%29._boolean~3f%29%29" class="RktValLink" data-pltdoc="x">boolean?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">v</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span></td></tr></table></td></tr></table></blockquote></div><div class="SIntrapara">Predicates for input arguments that are trivially converted to an attribute <span class="RktVar">key</span> or <span class="RktVar">value</span>…</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" class="boxed RBoxed"><tr><td><table cellspacing="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._txexpr/main..rkt)._-~3etxexpr-attr-key))"></a><span title="Provided from: txexpr, (submod txexpr safe) | Package: txexpr"><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._-~3etxexpr-attr-key%29%29" class="RktValDef RktValLink" data-pltdoc="x"><span class="nobreak">-></span>txexpr-attr-key</a></span></span><span class="hspace"> </span><span class="RktVar">v</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr-attr-key~3f%29%29" class="RktValLink" data-pltdoc="x">txexpr-attr-key?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">v</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._can-be-txexpr-attr-key~3f%29%29" class="RktValLink" data-pltdoc="x">can-be-txexpr-attr-key?</a></span></td></tr></table></td></tr><tr><td><table cellspacing="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._txexpr/main..rkt)._-~3etxexpr-attr-value))"></a><span title="Provided from: txexpr, (submod txexpr safe) | Package: txexpr"><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._-~3etxexpr-attr-value%29%29" class="RktValDef RktValLink" data-pltdoc="x"><span class="nobreak">-></span>txexpr-attr-value</a></span></span><span class="hspace"> </span><span class="RktVar">v</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr-attr-value~3f%29%29" class="RktValLink" data-pltdoc="x">txexpr-attr-value?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">v</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._can-be-txexpr-attr-value~3f%29%29" class="RktValLink" data-pltdoc="x">can-be-txexpr-attr-value?</a></span></td></tr></table></td></tr></table></blockquote></div><div class="SIntrapara">… with these conversion functions.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._txexpr/main..rkt)._txexpr-~3evalues))"></a><span title="Provided from: txexpr, (submod txexpr safe) | Package: txexpr"><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr-~3evalues%29%29" class="RktValDef RktValLink" data-pltdoc="x">txexpr->values</a></span></span><span class="hspace"> </span><span class="RktVar">tx</span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><table cellspacing="0" class="prototype"><tr><td><span class="hspace"> </span></td><td>→</td><td><span class="hspace"> </span></td><td><table cellspacing="0"><tr><td><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr-tag~3f%29%29" class="RktValLink" data-pltdoc="x">txexpr-tag?</a></span></td><td><span class="hspace"> </span></td><td><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr-attrs~3f%29%29" class="RktValLink" data-pltdoc="x">txexpr-attrs?</a></span></td><td><span class="hspace"> </span></td><td><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr-elements~3f%29%29" class="RktValLink" data-pltdoc="x">txexpr-elements?</a></span></td></tr></table></td></tr></table></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">tx</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr~3f%29%29" class="RktValLink" data-pltdoc="x">txexpr?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Dissolves a <span class="RktVar">txexpr</span> into its components and returns all three.</div></p><p><table cellspacing="0" class="RktBlk"><tr><td><p>Examples:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr-~3evalues%29%29" class="RktValLink" data-pltdoc="x">txexpr->values</a></span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">div</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><table cellspacing="0"><tr><td><p><span class="RktRes">'div</span></p></td></tr><tr><td><p><span class="RktRes">'()</span></p></td></tr><tr><td><p><span class="RktRes">'()</span></p></td></tr></table></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr-~3evalues%29%29" class="RktValLink" data-pltdoc="x">txexpr->values</a></span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">div</span><span class="hspace"> </span><span class="RktVal">"Hello"</span><span class="hspace"> </span><span class="RktVal">(</span><span class="RktVal">p</span><span class="hspace"> </span><span class="RktVal">"World"</span><span class="RktVal">)</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><table cellspacing="0"><tr><td><p><span class="RktRes">'div</span></p></td></tr><tr><td><p><span class="RktRes">'()</span></p></td></tr><tr><td><p><span class="RktRes">'("Hello" (p "World"))</span></p></td></tr></table></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr-~3evalues%29%29" class="RktValLink" data-pltdoc="x">txexpr->values</a></span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">div</span><span class="hspace"> </span><span class="RktVal">[</span><span class="RktVal">[</span><span class="RktVal">id</span><span class="hspace"> </span><span class="RktVal">"top"</span><span class="RktVal">]</span><span class="RktVal">]</span><span class="hspace"> </span><span class="RktVal">"Hello"</span><span class="hspace"> </span><span class="RktVal">(</span><span class="RktVal">p</span><span class="hspace"> </span><span class="RktVal">"World"</span><span class="RktVal">)</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><table cellspacing="0"><tr><td><p><span class="RktRes">'div</span></p></td></tr><tr><td><p><span class="RktRes">'((id "top"))</span></p></td></tr><tr><td><p><span class="RktRes">'("Hello" (p "World"))</span></p></td></tr></table></td></tr></table></blockquote></td></tr></table></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><table cellspacing="0" class="prototype RForeground"><tr><td><span class="RktPn">(</span><a name="(def._((lib._txexpr/main..rkt)._txexpr-~3elist))"></a><span title="Provided from: txexpr, (submod txexpr safe) | Package: txexpr"><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr-~3elist%29%29" class="RktValDef RktValLink" data-pltdoc="x">txexpr->list</a></span></span><span class="hspace"> </span><span class="RktVar">tx</span><span class="RktPn">)</span></td><td><span class="hspace"> </span></td><td>→</td><td><span class="hspace"> </span></td><td><table cellspacing="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/pairs.html#%28def._%28%28quote._~23~25kernel%29._list%29%29" class="RktValLink" data-pltdoc="x">list</a></span><span class="hspace"> </span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr-tag~3f%29%29" class="RktValLink" data-pltdoc="x">txexpr-tag?</a></span></td></tr><tr><td><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr-attrs~3f%29%29" class="RktValLink" data-pltdoc="x">txexpr-attrs?</a></span></td></tr><tr><td><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr-elements~3f%29%29" class="RktValLink" data-pltdoc="x">txexpr-elements?</a></span><span class="RktPn">)</span></td></tr></table></td></tr></table></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">tx</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr~3f%29%29" class="RktValLink" data-pltdoc="x">txexpr?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Like <span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr-~3evalues%29%29" class="RktValLink" data-pltdoc="x">txexpr->values</a></span>, but returns the three components in a list.</div></p><p><table cellspacing="0" class="RktBlk"><tr><td><p>Examples:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr-~3elist%29%29" class="RktValLink" data-pltdoc="x">txexpr->list</a></span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">div</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'(div () ())</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr-~3elist%29%29" class="RktValLink" data-pltdoc="x">txexpr->list</a></span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">div</span><span class="hspace"> </span><span class="RktVal">"Hello"</span><span class="hspace"> </span><span class="RktVal">(</span><span class="RktVal">p</span><span class="hspace"> </span><span class="RktVal">"World"</span><span class="RktVal">)</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'(div () ("Hello" (p "World")))</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr-~3elist%29%29" class="RktValLink" data-pltdoc="x">txexpr->list</a></span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">div</span><span class="hspace"> </span><span class="RktVal">[</span><span class="RktVal">[</span><span class="RktVal">id</span><span class="hspace"> </span><span class="RktVal">"top"</span><span class="RktVal">]</span><span class="RktVal">]</span><span class="hspace"> </span><span class="RktVal">"Hello"</span><span class="hspace"> </span><span class="RktVal">(</span><span class="RktVal">p</span><span class="hspace"> </span><span class="RktVal">"World"</span><span class="RktVal">)</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'(div ((id "top")) ("Hello" (p "World")))</span></p></td></tr></table></blockquote></td></tr></table></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._txexpr/main..rkt)._xexpr-~3ehtml))"></a><span title="Provided from: txexpr, (submod txexpr safe) | Package: txexpr"><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._xexpr-~3ehtml%29%29" class="RktValDef RktValLink" data-pltdoc="x">xexpr->html</a></span></span><span class="hspace"> </span><span class="RktVar">x</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">x</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="http://docs.racket-lang.org/xml/index.html#%28def._%28%28lib._xml%2Fprivate%2Fxexpr-core..rkt%29._xexpr~3f%29%29" class="RktValLink" data-pltdoc="x">xexpr?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Convert <span class="RktVar">x</span> to an HTML string. Better than <span class="RktSym"><a href="http://docs.racket-lang.org/xml/index.html#%28def._%28%28lib._xml%2Fmain..rkt%29._xexpr-~3estring%29%29" class="RktValLink" data-pltdoc="x">xexpr->string</a></span> because consistent with the HTML spec, it will not escape text that appears within <span class="RktSym">script</span><span class="RktMeta"></span> or <span class="RktSym">style</span><span class="RktMeta"></span> blocks. For convenience, this function will take any X-expression, not just tagged X-expressions.</div></p><p><table cellspacing="0" class="RktBlk"><tr><td><p>Examples:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/define.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._define%29%29" class="RktStxLink" data-pltdoc="x">define</a></span><span class="hspace"> </span><span class="RktSym">tx</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">root</span><span class="hspace"> </span><span class="RktVal">(</span><span class="RktVal">script</span><span class="hspace"> </span><span class="RktVal">"3 > 2"</span><span class="RktVal">)</span><span class="hspace"> </span><span class="RktVal">"Why is 3 > 2?"</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><table cellspacing="0"><tr><td></td></tr></table></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/xml/index.html#%28def._%28%28lib._xml%2Fmain..rkt%29._xexpr-~3estring%29%29" class="RktValLink" data-pltdoc="x">xexpr->string</a></span><span class="hspace"> </span><span class="RktSym">tx</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">"<root><script>3 &gt; 2</script>Why is 3 &gt; 2?</root>"</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._xexpr-~3ehtml%29%29" class="RktValLink" data-pltdoc="x">xexpr->html</a></span><span class="hspace"> </span><span class="RktSym">tx</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">"<root><script>3 > 2</script>Why is 3 &gt; 2?</root>"</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/pairs.html#%28def._%28%28lib._racket%2Fprivate%2Fmap..rkt%29._map%29%29" class="RktValLink" data-pltdoc="x">map</a></span><span class="hspace"> </span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._xexpr-~3ehtml%29%29" class="RktValLink" data-pltdoc="x">xexpr->html</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/pairs.html#%28def._%28%28quote._~23~25kernel%29._list%29%29" class="RktValLink" data-pltdoc="x">list</a></span><span class="hspace"> </span><span class="RktVal">"string"</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">entity</span><span class="hspace"> </span><span class="RktVal">65</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'("string" "&entity;" "&#65;")</span></p></td></tr></table></blockquote></td></tr></table></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" class="boxed RBoxed"><tr><td><table cellspacing="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._txexpr/main..rkt)._get-tag))"></a><span title="Provided from: txexpr, (submod txexpr safe) | Package: txexpr"><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._get-tag%29%29" class="RktValDef RktValLink" data-pltdoc="x">get-tag</a></span></span><span class="hspace"> </span><span class="RktVar">tx</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr-tag~3f%29%29" class="RktValLink" data-pltdoc="x">txexpr-tag?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">tx</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr~3f%29%29" class="RktValLink" data-pltdoc="x">txexpr?</a></span></td></tr></table></td></tr><tr><td><table cellspacing="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._txexpr/main..rkt)._get-attrs))"></a><span title="Provided from: txexpr, (submod txexpr safe) | Package: txexpr"><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._get-attrs%29%29" class="RktValDef RktValLink" data-pltdoc="x">get-attrs</a></span></span><span class="hspace"> </span><span class="RktVar">tx</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr-attr~3f%29%29" class="RktValLink" data-pltdoc="x">txexpr-attr?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">tx</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr~3f%29%29" class="RktValLink" data-pltdoc="x">txexpr?</a></span></td></tr></table></td></tr><tr><td><table cellspacing="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._txexpr/main..rkt)._get-elements))"></a><span title="Provided from: txexpr, (submod txexpr safe) | Package: txexpr"><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._get-elements%29%29" class="RktValDef RktValLink" data-pltdoc="x">get-elements</a></span></span><span class="hspace"> </span><span class="RktVar">tx</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._listof%29%29" class="RktValLink" data-pltdoc="x">listof</a></span><span class="hspace"> </span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr-element~3f%29%29" class="RktValLink" data-pltdoc="x">txexpr-element?</a></span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">tx</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr~3f%29%29" class="RktValLink" data-pltdoc="x">txexpr?</a></span></td></tr></table></td></tr></table></blockquote></div><div class="SIntrapara">Accessor functions for the individual pieces of a <span class="RktVar">txexpr</span>.</div></p><p><table cellspacing="0" class="RktBlk"><tr><td><p>Examples:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._get-tag%29%29" class="RktValLink" data-pltdoc="x">get-tag</a></span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">div</span><span class="hspace"> </span><span class="RktVal">[</span><span class="RktVal">[</span><span class="RktVal">id</span><span class="hspace"> </span><span class="RktVal">"top"</span><span class="RktVal">]</span><span class="RktVal">]</span><span class="hspace"> </span><span class="RktVal">"Hello"</span><span class="hspace"> </span><span class="RktVal">(</span><span class="RktVal">p</span><span class="hspace"> </span><span class="RktVal">"World"</span><span class="RktVal">)</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'div</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._get-attrs%29%29" class="RktValLink" data-pltdoc="x">get-attrs</a></span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">div</span><span class="hspace"> </span><span class="RktVal">[</span><span class="RktVal">[</span><span class="RktVal">id</span><span class="hspace"> </span><span class="RktVal">"top"</span><span class="RktVal">]</span><span class="RktVal">]</span><span class="hspace"> </span><span class="RktVal">"Hello"</span><span class="hspace"> </span><span class="RktVal">(</span><span class="RktVal">p</span><span class="hspace"> </span><span class="RktVal">"World"</span><span class="RktVal">)</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'((id "top"))</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._get-elements%29%29" class="RktValLink" data-pltdoc="x">get-elements</a></span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">div</span><span class="hspace"> </span><span class="RktVal">[</span><span class="RktVal">[</span><span class="RktVal">id</span><span class="hspace"> </span><span class="RktVal">"top"</span><span class="RktVal">]</span><span class="RktVal">]</span><span class="hspace"> </span><span class="RktVal">"Hello"</span><span class="hspace"> </span><span class="RktVal">(</span><span class="RktVal">p</span><span class="hspace"> </span><span class="RktVal">"World"</span><span class="RktVal">)</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'("Hello" (p "World"))</span></p></td></tr></table></blockquote></td></tr></table></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._txexpr/main..rkt)._make-txexpr))"></a><span title="Provided from: txexpr, (submod txexpr safe) | Package: txexpr"><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._make-txexpr%29%29" class="RktValDef RktValLink" data-pltdoc="x">make-txexpr</a></span></span><span class="hspace"> </span><span class="RktVar">tag</span><span class="hspace"> </span>[<span class="RktVar">attrs</span><span class="hspace"> </span><span class="RktVar">elements</span>]<span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr~3f%29%29" class="RktValLink" data-pltdoc="x">txexpr?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">tag</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr-tag~3f%29%29" class="RktValLink" data-pltdoc="x">txexpr-tag?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">attrs</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr-attrs~3f%29%29" class="RktValLink" data-pltdoc="x">txexpr-attrs?</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/pairs.html#%28def._%28%28lib._racket%2Flist..rkt%29._empty%29%29" class="RktValLink" data-pltdoc="x">empty</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">elements</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr-elements~3f%29%29" class="RktValLink" data-pltdoc="x">txexpr-elements?</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/pairs.html#%28def._%28%28lib._racket%2Flist..rkt%29._empty%29%29" class="RktValLink" data-pltdoc="x">empty</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Assemble a <span class="RktVar">txexpr</span> from its parts. If you don’t have attributes, but you do have elements, you’ll need to pass <span class="RktSym"><a href="http://docs.racket-lang.org/reference/pairs.html#%28def._%28%28lib._racket%2Flist..rkt%29._empty%29%29" class="RktValLink" data-pltdoc="x">empty</a></span> as the second argument. Note that unlike <span class="RktSym"><a href="http://docs.racket-lang.org/xml/index.html#%28def._%28%28lib._xml%2Fmain..rkt%29._xml-~3exexpr%29%29" class="RktValLink" data-pltdoc="x">xml->xexpr</a></span>, if the attribute list is empty, it’s not included in the resulting expression.</div></p><p><table cellspacing="0" class="RktBlk"><tr><td><p>Examples:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._make-txexpr%29%29" class="RktValLink" data-pltdoc="x">make-txexpr</a></span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">div</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'(div)</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._make-txexpr%29%29" class="RktValLink" data-pltdoc="x">make-txexpr</a></span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">div</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">)</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">"Hello"</span><span class="hspace"> </span><span class="RktVal">(</span><span class="RktVal">p</span><span class="hspace"> </span><span class="RktVal">"World"</span><span class="RktVal">)</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'(div "Hello" (p "World"))</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._make-txexpr%29%29" class="RktValLink" data-pltdoc="x">make-txexpr</a></span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">div</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">[</span><span class="RktVal">[</span><span class="RktVal">id</span><span class="hspace"> </span><span class="RktVal">"top"</span><span class="RktVal">]</span><span class="RktVal">]</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'(div ((id "top")))</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._make-txexpr%29%29" class="RktValLink" data-pltdoc="x">make-txexpr</a></span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">div</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">[</span><span class="RktVal">[</span><span class="RktVal">id</span><span class="hspace"> </span><span class="RktVal">"top"</span><span class="RktVal">]</span><span class="RktVal">]</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">"Hello"</span><span class="hspace"> </span><span class="RktVal">(</span><span class="RktVal">p</span><span class="hspace"> </span><span class="RktVal">"World"</span><span class="RktVal">)</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'(div ((id "top")) "Hello" (p "World"))</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/define.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._define%29%29" class="RktStxLink" data-pltdoc="x">define</a></span><span class="hspace"> </span><span class="RktSym">tx</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">div</span><span class="hspace"> </span><span class="RktVal">[</span><span class="RktVal">[</span><span class="RktVal">id</span><span class="hspace"> </span><span class="RktVal">"top"</span><span class="RktVal">]</span><span class="RktVal">]</span><span class="hspace"> </span><span class="RktVal">"Hello"</span><span class="hspace"> </span><span class="RktVal">(</span><span class="RktVal">p</span><span class="hspace"> </span><span class="RktVal">"World"</span><span class="RktVal">)</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><table cellspacing="0"><tr><td></td></tr></table></td></tr><tr><td><table cellspacing="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._make-txexpr%29%29" class="RktValLink" data-pltdoc="x">make-txexpr</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._get-tag%29%29" class="RktValLink" data-pltdoc="x">get-tag</a></span><span class="hspace"> </span><span class="RktSym">tx</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._get-attrs%29%29" class="RktValLink" data-pltdoc="x">get-attrs</a></span><span class="hspace"> </span><span class="RktSym">tx</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._get-elements%29%29" class="RktValLink" data-pltdoc="x">get-elements</a></span><span class="hspace"> </span><span class="RktSym">tx</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="RktRes">'(div ((id "top")) "Hello" (p "World"))</span></p></td></tr></table></blockquote></td></tr></table></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._txexpr/main..rkt)._can-be-txexpr-attrs~3f))"></a><span title="Provided from: txexpr, (submod txexpr safe) | Package: txexpr"><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._can-be-txexpr-attrs~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">can-be-txexpr-attrs?</a></span></span><span class="hspace"> </span><span class="RktVar">v</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/booleans.html#%28def._%28%28quote._~23~25kernel%29._boolean~3f%29%29" class="RktValLink" data-pltdoc="x">boolean?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">v</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Predicate for functions that handle <span class="RktVar">txexpr-attrs</span>. Covers values that are easily converted into pairs of <span class="RktVar">attr-key</span> and <span class="RktVar">attr-value</span>. Namely: single <span class="RktVar">xexpr-attr</span>s, lists of <span class="RktVar">xexpr-attr</span>s (i.e., what you get from <span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._get-attrs%29%29" class="RktValLink" data-pltdoc="x">get-attrs</a></span>), or interleaved symbols and strings (each pair will be concatenated into a single <span class="RktVar">xexpr-attr</span>).</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" class="boxed RBoxed"><tr><td><table cellspacing="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._txexpr/main..rkt)._attrs-~3ehash))"></a><span title="Provided from: txexpr, (submod txexpr safe) | Package: txexpr"><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._attrs-~3ehash%29%29" class="RktValDef RktValLink" data-pltdoc="x">attrs->hash</a></span></span><span class="hspace"> </span><span class="RktVar">x</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/hashtables.html#%28def._%28%28quote._~23~25kernel%29._hash~3f%29%29" class="RktValLink" data-pltdoc="x">hash?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">x</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._can-be-txexpr-attrs~3f%29%29" class="RktValLink" data-pltdoc="x">can-be-txexpr-attrs?</a></span></td></tr></table></td></tr><tr><td><table cellspacing="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._txexpr/main..rkt)._hash-~3eattrs))"></a><span title="Provided from: txexpr, (submod txexpr safe) | Package: txexpr"><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._hash-~3eattrs%29%29" class="RktValDef RktValLink" data-pltdoc="x">hash->attrs</a></span></span><span class="hspace"> </span><span class="RktVar">h</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr-attrs~3f%29%29" class="RktValLink" data-pltdoc="x">txexpr-attrs?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">h</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/hashtables.html#%28def._%28%28quote._~23~25kernel%29._hash~3f%29%29" class="RktValLink" data-pltdoc="x">hash?</a></span></td></tr></table></td></tr></table></blockquote></div><div class="SIntrapara">Convert <span class="RktVar">attrs</span> to an immutable hash, and back again.</div></p><p><table cellspacing="0" class="RktBlk"><tr><td><p>Examples:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/define.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._define%29%29" class="RktStxLink" data-pltdoc="x">define</a></span><span class="hspace"> </span><span class="RktSym">tx</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">div</span><span class="hspace"> </span><span class="RktVal">[</span><span class="RktVal">[</span><span class="RktVal">id</span><span class="hspace"> </span><span class="RktVal">"top"</span><span class="RktVal">]</span><span class="RktVal">[</span><span class="RktVal">class</span><span class="hspace"> </span><span class="RktVal">"red"</span><span class="RktVal">]</span><span class="RktVal">]</span><span class="hspace"> </span><span class="RktVal">"Hello"</span><span class="hspace"> </span><span class="RktVal">(</span><span class="RktVal">p</span><span class="hspace"> </span><span class="RktVal">"World"</span><span class="RktVal">)</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><table cellspacing="0"><tr><td></td></tr></table></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._attrs-~3ehash%29%29" class="RktValLink" data-pltdoc="x">attrs->hash</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._get-attrs%29%29" class="RktValLink" data-pltdoc="x">get-attrs</a></span><span class="hspace"> </span><span class="RktSym">tx</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'#hash((class . "red") (id . "top"))</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._hash-~3eattrs%29%29" class="RktValLink" data-pltdoc="x">hash->attrs</a></span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">#hash</span><span class="RktVal">(</span><span class="RktVal">(</span><span class="RktVal">class</span><span class="hspace"> </span><span class="RktVal">. </span><span class="RktVal">"red"</span><span class="RktVal">)</span><span class="hspace"> </span><span class="RktVal">(</span><span class="RktVal">id</span><span class="hspace"> </span><span class="RktVal">. </span><span class="RktVal">"top"</span><span class="RktVal">)</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'((class "red") (id "top"))</span></p></td></tr></table></blockquote></td></tr></table></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._txexpr/main..rkt)._attrs-have-key~3f))"></a><span title="Provided from: txexpr, (submod txexpr safe) | Package: txexpr"><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._attrs-have-key~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">attrs-have-key?</a></span></span><span class="hspace"> </span><span class="RktVar">attrs</span><span class="hspace"> </span><span class="RktVar">key</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/booleans.html#%28def._%28%28quote._~23~25kernel%29._boolean~3f%29%29" class="RktValLink" data-pltdoc="x">boolean?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">attrs</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr-attrs~3f%29%29" class="RktValLink" data-pltdoc="x">txexpr-attrs?</a></span><span class="hspace"> </span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr~3f%29%29" class="RktValLink" data-pltdoc="x">txexpr?</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">key</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._can-be-txexpr-attr-key~3f%29%29" class="RktValLink" data-pltdoc="x">can-be-txexpr-attr-key?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Returns <span class="RktVal">#t</span> if the <span class="RktVar">attrs</span> contain a value for the given <span class="RktVar">key</span>, <span class="RktVal">#f</span> otherwise.</div></p><p><table cellspacing="0" class="RktBlk"><tr><td><p>Examples:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/define.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._define%29%29" class="RktStxLink" data-pltdoc="x">define</a></span><span class="hspace"> </span><span class="RktSym">tx</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">div</span><span class="hspace"> </span><span class="RktVal">[</span><span class="RktVal">[</span><span class="RktVal">id</span><span class="hspace"> </span><span class="RktVal">"top"</span><span class="RktVal">]</span><span class="RktVal">[</span><span class="RktVal">class</span><span class="hspace"> </span><span class="RktVal">"red"</span><span class="RktVal">]</span><span class="RktVal">]</span><span class="hspace"> </span><span class="RktVal">"Hello"</span><span class="hspace"> </span><span class="RktVal">(</span><span class="RktVal">p</span><span class="hspace"> </span><span class="RktVal">"World"</span><span class="RktVal">)</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><table cellspacing="0"><tr><td></td></tr></table></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._attrs-have-key~3f%29%29" class="RktValLink" data-pltdoc="x">attrs-have-key?</a></span><span class="hspace"> </span><span class="RktSym">tx</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">id</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#t</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._attrs-have-key~3f%29%29" class="RktValLink" data-pltdoc="x">attrs-have-key?</a></span><span class="hspace"> </span><span class="RktSym">tx</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">grackle</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#f</span></p></td></tr></table></blockquote></td></tr></table></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._txexpr/main..rkt)._attr-ref))"></a><span title="Provided from: txexpr, (submod txexpr safe) | Package: txexpr"><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._attr-ref%29%29" class="RktValDef RktValLink" data-pltdoc="x">attr-ref</a></span></span><span class="hspace"> </span><span class="RktVar">tx</span><span class="hspace"> </span><span class="RktVar">key</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr-attr-value~3f%29%29" class="RktValLink" data-pltdoc="x">txexpr-attr-value?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">tx</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr~3f%29%29" class="RktValLink" data-pltdoc="x">txexpr?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">key</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._can-be-txexpr-attr-key~3f%29%29" class="RktValLink" data-pltdoc="x">can-be-txexpr-attr-key?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Given a <span class="RktVar">key</span>, look up the corresponding <span class="RktVar">value</span> in the attributes of a <span class="RktVar">txexpr</span>. Asking for a nonexistent key produces an error.</div></p><p><table cellspacing="0" class="RktBlk"><tr><td><p>Examples:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._attr-ref%29%29" class="RktValLink" data-pltdoc="x">attr-ref</a></span><span class="hspace"> </span><span class="RktSym">tx</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">class</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">"red"</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._attr-ref%29%29" class="RktValLink" data-pltdoc="x">attr-ref</a></span><span class="hspace"> </span><span class="RktSym">tx</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">id</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">"top"</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._attr-ref%29%29" class="RktValLink" data-pltdoc="x">attr-ref</a></span><span class="hspace"> </span><span class="RktSym">tx</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">nonexistent-key</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktErr">attr-ref: no value found for key 'nonexistent-key</span></p></td></tr></table></blockquote></td></tr></table></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._txexpr/main..rkt)._attr-set))"></a><span title="Provided from: txexpr, (submod txexpr safe) | Package: txexpr"><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._attr-set%29%29" class="RktValDef RktValLink" data-pltdoc="x">attr-set</a></span></span><span class="hspace"> </span><span class="RktVar">tx</span><span class="hspace"> </span><span class="RktVar">key</span><span class="hspace"> </span><span class="RktVar">value</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr~3f%29%29" class="RktValLink" data-pltdoc="x">txexpr?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">tx</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr~3f%29%29" class="RktValLink" data-pltdoc="x">txexpr?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">key</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._can-be-txexpr-attr-key~3f%29%29" class="RktValLink" data-pltdoc="x">can-be-txexpr-attr-key?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">value</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr-attr-value~3f%29%29" class="RktValLink" data-pltdoc="x">txexpr-attr-value?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Given a <span class="RktVar">txexpr</span>, set the value of attribute <span class="RktVar">key</span> to <span class="RktVar">value</span>. The function returns the updated <span class="RktVar">txexpr</span>.</div></p><p><table cellspacing="0" class="RktBlk"><tr><td><p>Examples:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/define.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._define%29%29" class="RktStxLink" data-pltdoc="x">define</a></span><span class="hspace"> </span><span class="RktSym">tx</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">div</span><span class="hspace"> </span><span class="RktVal">[</span><span class="RktVal">[</span><span class="RktVal">class</span><span class="hspace"> </span><span class="RktVal">"red"</span><span class="RktVal">]</span><span class="RktVal">[</span><span class="RktVal">id</span><span class="hspace"> </span><span class="RktVal">"top"</span><span class="RktVal">]</span><span class="RktVal">]</span><span class="hspace"> </span><span class="RktVal">"Hello"</span><span class="hspace"> </span><span class="RktVal">(</span><span class="RktVal">p</span><span class="hspace"> </span><span class="RktVal">"World"</span><span class="RktVal">)</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><table cellspacing="0"><tr><td></td></tr></table></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._attr-set%29%29" class="RktValLink" data-pltdoc="x">attr-set</a></span><span class="hspace"> </span><span class="RktSym">tx</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">id</span><span class="hspace"> </span><span class="RktVal">"bottom"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'(div ((class "red") (id "bottom")) "Hello" (p "World"))</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._attr-set%29%29" class="RktValLink" data-pltdoc="x">attr-set</a></span><span class="hspace"> </span><span class="RktSym">tx</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">class</span><span class="hspace"> </span><span class="RktVal">"blue"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'(div ((class "blue") (id "top")) "Hello" (p "World"))</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._attr-set%29%29" class="RktValLink" data-pltdoc="x">attr-set</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._attr-set%29%29" class="RktValLink" data-pltdoc="x">attr-set</a></span><span class="hspace"> </span><span class="RktSym">tx</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">id</span><span class="hspace"> </span><span class="RktVal">"bottom"</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">class</span><span class="hspace"> </span><span class="RktVal">"blue"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'(div ((class "blue") (id "bottom")) "Hello" (p "World"))</span></p></td></tr></table></blockquote></td></tr></table></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._txexpr/main..rkt)._merge-attrs))"></a><span title="Provided from: txexpr, (submod txexpr safe) | Package: txexpr"><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._merge-attrs%29%29" class="RktValDef RktValLink" data-pltdoc="x">merge-attrs</a></span></span><span class="hspace"> </span><span class="RktVar">attrs</span><span class="hspace"> </span><span class="RktMeta">...</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr-attrs~3f%29%29" class="RktValLink" data-pltdoc="x">txexpr-attrs?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">attrs</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._listof%29%29" class="RktValLink" data-pltdoc="x">listof</a></span><span class="hspace"> </span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._can-be-txexpr-attrs~3f%29%29" class="RktValLink" data-pltdoc="x">can-be-txexpr-attrs?</a></span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Combine a series of attributes into a single <span class="RktVar">txexpr-attrs</span> item. This function addresses three annoyances that surface in working with txexpr attributes.</div></p><ol><li><p>You can pass the attributes in multiple forms. See <span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._can-be-txexpr-attrs~3f%29%29" class="RktValLink" data-pltdoc="x">can-be-txexpr-attrs?</a></span> for further details.</p></li><li><p>Attributes with the same name are merged, with the later value taking precedence (i.e., <span class="RktSym"><a href="http://docs.racket-lang.org/reference/hashtables.html#%28def._%28%28quote._~23~25kernel%29._hash%29%29" class="RktValLink" data-pltdoc="x">hash</a></span> behavior). </p></li><li><p>Attributes are sorted in alphabetical order.</p></li></ol><p><table cellspacing="0" class="RktBlk"><tr><td><p>Examples:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/define.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._define%29%29" class="RktStxLink" data-pltdoc="x">define</a></span><span class="hspace"> </span><span class="RktSym">tx</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">div</span><span class="hspace"> </span><span class="RktVal">[</span><span class="RktVal">[</span><span class="RktVal">id</span><span class="hspace"> </span><span class="RktVal">"top"</span><span class="RktVal">]</span><span class="RktVal">[</span><span class="RktVal">class</span><span class="hspace"> </span><span class="RktVal">"red"</span><span class="RktVal">]</span><span class="RktVal">]</span><span class="hspace"> </span><span class="RktVal">"Hello"</span><span class="hspace"> </span><span class="RktVal">(</span><span class="RktVal">p</span><span class="hspace"> </span><span class="RktVal">"World"</span><span class="RktVal">)</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><table cellspacing="0"><tr><td></td></tr></table></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/define.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._define%29%29" class="RktStxLink" data-pltdoc="x">define</a></span><span class="hspace"> </span><span class="RktSym">tx-attrs</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._get-attrs%29%29" class="RktValLink" data-pltdoc="x">get-attrs</a></span><span class="hspace"> </span><span class="RktSym">tx</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><table cellspacing="0"><tr><td></td></tr></table></td></tr><tr><td><span class="stt">> </span><span class="RktSym">tx-attrs</span></td></tr><tr><td><p><span class="RktRes">'((id "top") (class "red"))</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._merge-attrs%29%29" class="RktValLink" data-pltdoc="x">merge-attrs</a></span><span class="hspace"> </span><span class="RktSym">tx-attrs</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">editable</span><span class="hspace"> </span><span class="RktVal">"true"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'((class "red") (editable "true") (id "top"))</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._merge-attrs%29%29" class="RktValLink" data-pltdoc="x">merge-attrs</a></span><span class="hspace"> </span><span class="RktSym">tx-attrs</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">id</span><span class="hspace"> </span><span class="RktVal">"override-value"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'((class "red") (id "override-value"))</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/define.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._define%29%29" class="RktStxLink" data-pltdoc="x">define</a></span><span class="hspace"> </span><span class="RktSym">my-attr</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">id</span><span class="hspace"> </span><span class="RktVal">"another-override"</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><table cellspacing="0"><tr><td></td></tr></table></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._merge-attrs%29%29" class="RktValLink" data-pltdoc="x">merge-attrs</a></span><span class="hspace"> </span><span class="RktSym">tx-attrs</span><span class="hspace"> </span><span class="RktSym">my-attr</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'((class "red") (id "another-override"))</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._merge-attrs%29%29" class="RktValLink" data-pltdoc="x">merge-attrs</a></span><span class="hspace"> </span><span class="RktSym">my-attr</span><span class="hspace"> </span><span class="RktSym">tx-attrs</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'((class "red") (id "top"))</span></p></td></tr></table></blockquote></td></tr></table></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._txexpr/main..rkt)._remove-attrs))"></a><span title="Provided from: txexpr, (submod txexpr safe) | Package: txexpr"><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._remove-attrs%29%29" class="RktValDef RktValLink" data-pltdoc="x">remove-attrs</a></span></span><span class="hspace"> </span><span class="RktVar">tx</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr~3f%29%29" class="RktValLink" data-pltdoc="x">txexpr?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">tx</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr~3f%29%29" class="RktValLink" data-pltdoc="x">txexpr?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Recursively remove all attributes.</div></p><p><table cellspacing="0" class="RktBlk"><tr><td><p>Examples:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/define.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._define%29%29" class="RktStxLink" data-pltdoc="x">define</a></span><span class="hspace"> </span><span class="RktSym">tx</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">div</span><span class="hspace"> </span><span class="RktVal">[</span><span class="RktVal">[</span><span class="RktVal">id</span><span class="hspace"> </span><span class="RktVal">"top"</span><span class="RktVal">]</span><span class="RktVal">]</span><span class="hspace"> </span><span class="RktVal">"Hello"</span><span class="hspace"> </span><span class="RktVal">(</span><span class="RktVal">p</span><span class="hspace"> </span><span class="RktVal">[</span><span class="RktVal">[</span><span class="RktVal">id</span><span class="hspace"> </span><span class="RktVal">"lower"</span><span class="RktVal">]</span><span class="RktVal">]</span><span class="hspace"> </span><span class="RktVal">"World"</span><span class="RktVal">)</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><table cellspacing="0"><tr><td></td></tr></table></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._remove-attrs%29%29" class="RktValLink" data-pltdoc="x">remove-attrs</a></span><span class="hspace"> </span><span class="RktSym">tx</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'(div "Hello" (p "World"))</span></p></td></tr></table></blockquote></td></tr></table></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._txexpr/main..rkt)._map-elements))"></a><span title="Provided from: txexpr, (submod txexpr safe) | Package: txexpr"><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._map-elements%29%29" class="RktValDef RktValLink" data-pltdoc="x">map-elements</a></span></span><span class="hspace"> </span><span class="RktVar">proc</span><span class="hspace"> </span><span class="RktVar">tx</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr~3f%29%29" class="RktValLink" data-pltdoc="x">txexpr?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">proc</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/procedures.html#%28def._%28%28quote._~23~25kernel%29._procedure~3f%29%29" class="RktValLink" data-pltdoc="x">procedure?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">tx</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr~3f%29%29" class="RktValLink" data-pltdoc="x">txexpr?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Recursively apply <span class="RktVar">proc</span> to all elements, leaving tags and attributes alone. Using plain <span class="RktSym"><a href="http://docs.racket-lang.org/reference/pairs.html#%28def._%28%28lib._racket%2Fprivate%2Fmap..rkt%29._map%29%29" class="RktValLink" data-pltdoc="x">map</a></span> will only process elements at the top level of the current <span class="RktVar">txexpr</span>. Usually that’s not what you want.</div></p><p><table cellspacing="0" class="RktBlk"><tr><td><p>Examples:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/define.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._define%29%29" class="RktStxLink" data-pltdoc="x">define</a></span><span class="hspace"> </span><span class="RktSym">tx</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">div</span><span class="hspace"> </span><span class="RktVal">"Hello!"</span><span class="hspace"> </span><span class="RktVal">(</span><span class="RktVal">p</span><span class="hspace"> </span><span class="RktVal">"Welcome to"</span><span class="hspace"> </span><span class="RktVal">(</span><span class="RktVal">strong</span><span class="hspace"> </span><span class="RktVal">"Mars"</span><span class="RktVal">)</span><span class="RktVal">)</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><table cellspacing="0"><tr><td></td></tr></table></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/define.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._define%29%29" class="RktStxLink" data-pltdoc="x">define</a></span><span class="hspace"> </span><span class="RktSym">upcaser</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/lambda.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._~ce~bb%29%29" class="RktStxLink" data-pltdoc="x">λ</a></span><span class="RktPn">(</span><span class="RktSym">x</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/if.html#%28form._%28%28quote._~23~25kernel%29._if%29%29" class="RktStxLink" data-pltdoc="x">if</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktSym">x</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/strings.html#%28def._%28%28quote._~23~25kernel%29._string-upcase%29%29" class="RktValLink" data-pltdoc="x">string-upcase</a></span><span class="hspace"> </span><span class="RktSym">x</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktSym">x</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><table cellspacing="0"><tr><td></td></tr></table></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/pairs.html#%28def._%28%28lib._racket%2Fprivate%2Fmap..rkt%29._map%29%29" class="RktValLink" data-pltdoc="x">map</a></span><span class="hspace"> </span><span class="RktSym">upcaser</span><span class="hspace"> </span><span class="RktSym">tx</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'(div "HELLO!" (p "Welcome to" (strong "Mars")))</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._map-elements%29%29" class="RktValLink" data-pltdoc="x">map-elements</a></span><span class="hspace"> </span><span class="RktSym">upcaser</span><span class="hspace"> </span><span class="RktSym">tx</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'(div "HELLO!" (p "WELCOME TO" (strong "MARS")))</span></p></td></tr></table></blockquote></td></tr></table></p><p>In practice, most <span class="RktVar">xexpr-element</span>s are strings. But woe befalls those who pass string procedures to <span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._map-elements%29%29" class="RktValLink" data-pltdoc="x">map-elements</a></span>, because an <span class="RktVar">xexpr-element</span> can be any kind of <span class="RktSym"><a href="http://docs.racket-lang.org/xml/index.html#%28def._%28%28lib._xml%2Fprivate%2Fxexpr-core..rkt%29._xexpr~3f%29%29" class="RktValLink" data-pltdoc="x">xexpr?</a></span>, and an <span class="RktSym"><a href="http://docs.racket-lang.org/xml/index.html#%28def._%28%28lib._xml%2Fprivate%2Fxexpr-core..rkt%29._xexpr~3f%29%29" class="RktValLink" data-pltdoc="x">xexpr?</a></span> is not necessarily a string.</p><p><table cellspacing="0" class="RktBlk"><tr><td><p>Examples:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/define.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._define%29%29" class="RktStxLink" data-pltdoc="x">define</a></span><span class="hspace"> </span><span class="RktSym">tx</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">p</span><span class="hspace"> </span><span class="RktVal">"Welcome to"</span><span class="hspace"> </span><span class="RktVal">(</span><span class="RktVal">strong</span><span class="hspace"> </span><span class="RktVal">"Mars"</span><span class="hspace"> </span><span class="RktVal">amp</span><span class="hspace"> </span><span class="RktVal">"Sons"</span><span class="RktVal">)</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><table cellspacing="0"><tr><td></td></tr></table></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._map-elements%29%29" class="RktValLink" data-pltdoc="x">map-elements</a></span><span class="hspace"> </span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/strings.html#%28def._%28%28quote._~23~25kernel%29._string-upcase%29%29" class="RktValLink" data-pltdoc="x">string-upcase</a></span><span class="hspace"> </span><span class="RktSym">tx</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktErr">string-upcase: contract violation</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr">expected: string?</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr">given: 'amp</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/define.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._define%29%29" class="RktStxLink" data-pltdoc="x">define</a></span><span class="hspace"> </span><span class="RktSym">upcaser</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/lambda.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._~ce~bb%29%29" class="RktStxLink" data-pltdoc="x">λ</a></span><span class="RktPn">(</span><span class="RktSym">x</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/if.html#%28form._%28%28quote._~23~25kernel%29._if%29%29" class="RktStxLink" data-pltdoc="x">if</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktSym">x</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/strings.html#%28def._%28%28quote._~23~25kernel%29._string-upcase%29%29" class="RktValLink" data-pltdoc="x">string-upcase</a></span><span class="hspace"> </span><span class="RktSym">x</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktSym">x</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><table cellspacing="0"><tr><td></td></tr></table></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._map-elements%29%29" class="RktValLink" data-pltdoc="x">map-elements</a></span><span class="hspace"> </span><span class="RktSym">upcaser</span><span class="hspace"> </span><span class="RktSym">tx</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'(p "WELCOME TO" (strong "MARS" amp "SONS"))</span></p></td></tr></table></blockquote></td></tr></table></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._txexpr/main..rkt)._map-elements/exclude))"></a><span title="Provided from: txexpr, (submod txexpr safe) | Package: txexpr"><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._map-elements%2Fexclude%29%29" class="RktValDef RktValLink" data-pltdoc="x">map-elements/exclude</a></span></span><span class="hspace"> </span><span class="RktVar">proc</span><span class="hspace"> </span><span class="RktVar">tx</span><span class="hspace"> </span><span class="RktVar">exclude-test</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr~3f%29%29" class="RktValLink" data-pltdoc="x">txexpr?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">proc</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/procedures.html#%28def._%28%28quote._~23~25kernel%29._procedure~3f%29%29" class="RktValLink" data-pltdoc="x">procedure?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">tx</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr~3f%29%29" class="RktValLink" data-pltdoc="x">txexpr?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">exclude-test</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr~3f%29%29" class="RktValLink" data-pltdoc="x">txexpr?</a></span><span class="hspace"> </span><span class="RktPn">. </span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/function-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._-~3e%29%29" class="RktStxLink" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="RktPn"> .</span><span class="hspace"> </span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/booleans.html#%28def._%28%28quote._~23~25kernel%29._boolean~3f%29%29" class="RktValLink" data-pltdoc="x">boolean?</a></span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Like <span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._map-elements%29%29" class="RktValLink" data-pltdoc="x">map-elements</a></span>, but skips any <span class="RktVar">txexprs</span> that evaluate to <span class="RktVal">#t</span> under <span class="RktVar">exclude-test</span>. The <span class="RktVar">exclude-test</span> gets a whole txexpr as input, so it can test any of its parts.</div></p><p><table cellspacing="0" class="RktBlk"><tr><td><p>Examples:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/define.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._define%29%29" class="RktStxLink" data-pltdoc="x">define</a></span><span class="hspace"> </span><span class="RktSym">tx</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">div</span><span class="hspace"> </span><span class="RktVal">"Hello!"</span><span class="hspace"> </span><span class="RktVal">(</span><span class="RktVal">p</span><span class="hspace"> </span><span class="RktVal">"Welcome to"</span><span class="hspace"> </span><span class="RktVal">(</span><span class="RktVal">strong</span><span class="hspace"> </span><span class="RktVal">"Mars"</span><span class="RktVal">)</span><span class="RktVal">)</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><table cellspacing="0"><tr><td></td></tr></table></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/define.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._define%29%29" class="RktStxLink" data-pltdoc="x">define</a></span><span class="hspace"> </span><span class="RktSym">upcaser</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/lambda.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._~ce~bb%29%29" class="RktStxLink" data-pltdoc="x">λ</a></span><span class="RktPn">(</span><span class="RktSym">x</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/if.html#%28form._%28%28quote._~23~25kernel%29._if%29%29" class="RktStxLink" data-pltdoc="x">if</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktSym">x</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/strings.html#%28def._%28%28quote._~23~25kernel%29._string-upcase%29%29" class="RktValLink" data-pltdoc="x">string-upcase</a></span><span class="hspace"> </span><span class="RktSym">x</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktSym">x</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><table cellspacing="0"><tr><td></td></tr></table></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._map-elements%29%29" class="RktValLink" data-pltdoc="x">map-elements</a></span><span class="hspace"> </span><span class="RktSym">upcaser</span><span class="hspace"> </span><span class="RktSym">tx</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'(div "HELLO!" (p "WELCOME TO" (strong "MARS")))</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._map-elements%2Fexclude%29%29" class="RktValLink" data-pltdoc="x">map-elements/exclude</a></span><span class="hspace"> </span><span class="RktSym">upcaser</span><span class="hspace"> </span><span class="RktSym">tx</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/lambda.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._~ce~bb%29%29" class="RktStxLink" data-pltdoc="x">λ</a></span><span class="RktPn">(</span><span class="RktSym">x</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/booleans.html#%28def._%28%28quote._~23~25kernel%29._equal~3f%29%29" class="RktValLink" data-pltdoc="x">equal?</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._get-tag%29%29" class="RktValLink" data-pltdoc="x">get-tag</a></span><span class="hspace"> </span><span class="RktSym">x</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">strong</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'(div "HELLO!" (p "WELCOME TO" (strong "Mars")))</span></p></td></tr></table></blockquote></td></tr></table></p><p>Be careful with the wider consequences of exclusion tests. When <span class="RktVar">exclude-test</span> is true, the <span class="RktVar">txexpr</span> is excluded, but so is everything underneath that <span class="RktVar">txexpr</span>. In other words, there is no way to re-include (un-exclude?) elements nested under an excluded element.</p><p><table cellspacing="0" class="RktBlk"><tr><td><p>Examples:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/define.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._define%29%29" class="RktStxLink" data-pltdoc="x">define</a></span><span class="hspace"> </span><span class="RktSym">tx</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">div</span><span class="hspace"> </span><span class="RktVal">"Hello!"</span><span class="hspace"> </span><span class="RktVal">(</span><span class="RktVal">p</span><span class="hspace"> </span><span class="RktVal">"Welcome to"</span><span class="hspace"> </span><span class="RktVal">(</span><span class="RktVal">strong</span><span class="hspace"> </span><span class="RktVal">"Mars"</span><span class="RktVal">)</span><span class="RktVal">)</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><table cellspacing="0"><tr><td></td></tr></table></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/define.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._define%29%29" class="RktStxLink" data-pltdoc="x">define</a></span><span class="hspace"> </span><span class="RktSym">upcaser</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/lambda.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._~ce~bb%29%29" class="RktStxLink" data-pltdoc="x">λ</a></span><span class="RktPn">(</span><span class="RktSym">x</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/if.html#%28form._%28%28quote._~23~25kernel%29._if%29%29" class="RktStxLink" data-pltdoc="x">if</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktSym">x</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/strings.html#%28def._%28%28quote._~23~25kernel%29._string-upcase%29%29" class="RktValLink" data-pltdoc="x">string-upcase</a></span><span class="hspace"> </span><span class="RktSym">x</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktSym">x</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><table cellspacing="0"><tr><td></td></tr></table></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._map-elements%29%29" class="RktValLink" data-pltdoc="x">map-elements</a></span><span class="hspace"> </span><span class="RktSym">upcaser</span><span class="hspace"> </span><span class="RktSym">tx</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'(div "HELLO!" (p "WELCOME TO" (strong "MARS")))</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._map-elements%2Fexclude%29%29" class="RktValLink" data-pltdoc="x">map-elements/exclude</a></span><span class="hspace"> </span><span class="RktSym">upcaser</span><span class="hspace"> </span><span class="RktSym">tx</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/lambda.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._~ce~bb%29%29" class="RktStxLink" data-pltdoc="x">λ</a></span><span class="RktPn">(</span><span class="RktSym">x</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/booleans.html#%28def._%28%28quote._~23~25kernel%29._equal~3f%29%29" class="RktValLink" data-pltdoc="x">equal?</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._get-tag%29%29" class="RktValLink" data-pltdoc="x">get-tag</a></span><span class="hspace"> </span><span class="RktSym">x</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">p</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'(div "HELLO!" (p "Welcome to" (strong "Mars")))</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._map-elements%2Fexclude%29%29" class="RktValLink" data-pltdoc="x">map-elements/exclude</a></span><span class="hspace"> </span><span class="RktSym">upcaser</span><span class="hspace"> </span><span class="RktSym">tx</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/lambda.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._~ce~bb%29%29" class="RktStxLink" data-pltdoc="x">λ</a></span><span class="RktPn">(</span><span class="RktSym">x</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/booleans.html#%28def._%28%28quote._~23~25kernel%29._equal~3f%29%29" class="RktValLink" data-pltdoc="x">equal?</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._get-tag%29%29" class="RktValLink" data-pltdoc="x">get-tag</a></span><span class="hspace"> </span><span class="RktSym">x</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">div</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'(div "Hello!" (p "Welcome to" (strong "Mars")))</span></p></td></tr></table></blockquote></td></tr></table></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><table cellspacing="0" class="prototype RForeground"><tr><td><span class="RktPn">(</span><a name="(def._((lib._txexpr/main..rkt)._splitf-txexpr))"></a><span title="Provided from: txexpr, (submod txexpr safe) | Package: txexpr"><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._splitf-txexpr%29%29" class="RktValDef RktValLink" data-pltdoc="x">splitf-txexpr</a></span></span><span class="hspace"> </span><span class="RktVar">tx</span><span class="hspace"> </span><span class="RktVar">pred</span><span class="RktPn">)</span></td><td><span class="hspace"> </span></td><td>→</td><td><span class="hspace"> </span></td><td><table cellspacing="0"><tr><td><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr~3f%29%29" class="RktValLink" data-pltdoc="x">txexpr?</a></span></td><td><span class="hspace"> </span></td><td><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._listof%29%29" class="RktValLink" data-pltdoc="x">listof</a></span><span class="hspace"> </span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr-element~3f%29%29" class="RktValLink" data-pltdoc="x">txexpr-element?</a></span><span class="RktPn">)</span></td></tr></table></td></tr></table></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">tx</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr~3f%29%29" class="RktValLink" data-pltdoc="x">txexpr?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">pred</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/procedures.html#%28def._%28%28quote._~23~25kernel%29._procedure~3f%29%29" class="RktValLink" data-pltdoc="x">procedure?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Recursively descend through <span class="RktVar">txexpr</span> and extract all elements that match <span class="RktVar">pred</span>. Returns two values: a <span class="RktVar">txexpr</span> with the matching elements removed, and the list of matching elements. Sort of esoteric, but I’ve needed it more than once, so here it is.</div></p><p><table cellspacing="0" class="RktBlk"><tr><td><p>Examples:</p></td></tr><tr><td><blockquote class="SCodeFlow"><table cellspacing="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/define.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._define%29%29" class="RktStxLink" data-pltdoc="x">define</a></span><span class="hspace"> </span><span class="RktSym">tx</span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">div</span><span class="hspace"> </span><span class="RktVal">"Wonderful day"</span><span class="hspace"> </span><span class="RktVal">(</span><span class="RktVal">meta</span><span class="hspace"> </span><span class="RktVal">"weather"</span><span class="hspace"> </span><span class="RktVal">"good"</span><span class="RktVal">)</span><span class="hspace"> </span><span class="RktVal">"for a walk"</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr><tr><td><table cellspacing="0"><tr><td></td></tr></table></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/define.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._define%29%29" class="RktStxLink" data-pltdoc="x">define</a></span><span class="hspace"> </span><span class="RktSym">remove?</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/lambda.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._~ce~bb%29%29" class="RktStxLink" data-pltdoc="x">λ</a></span><span class="RktPn">(</span><span class="RktSym">x</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/if.html#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._and%29%29" class="RktStxLink" data-pltdoc="x">and</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._txexpr~3f%29%29" class="RktValLink" data-pltdoc="x">txexpr?</a></span><span class="hspace"> </span><span class="RktSym">x</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://docs.racket-lang.org/reference/booleans.html#%28def._%28%28quote._~23~25kernel%29._equal~3f%29%29" class="RktValLink" data-pltdoc="x">equal?</a></span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">meta</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._get-tag%29%29" class="RktValLink" data-pltdoc="x">get-tag</a></span><span class="hspace"> </span><span class="RktSym">x</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><table cellspacing="0"><tr><td></td></tr></table></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="index.html#%28def._%28%28lib._txexpr%2Fmain..rkt%29._splitf-txexpr%29%29" class="RktValLink" data-pltdoc="x">splitf-txexpr</a></span><span class="hspace"> </span><span class="RktSym">tx</span><span class="hspace"> </span><span class="RktSym">remove?</span><span class="RktPn">)</span></td></tr><tr><td><table cellspacing="0"><tr><td><p><span class="RktRes">'(div "Wonderful day" "for a walk")</span></p></td></tr><tr><td><p><span class="RktRes">'((meta "weather" "good"))</span></p></td></tr></table></td></tr></table></blockquote></td></tr></table></p><h3>6<tt> </tt><a name="(part._.License___source_code)"></a>License & source code</h3><p>This module is licensed under the LGPL.</p><p>Source repository at <a href="http://github.com/mbutterick/txexpr">http://github.com/mbutterick/txexpr</a>. Suggestions & corrections welcome.</p></div></div><div id="contextindicator"> </div></body></html> |