forked from clojure/clojure
/
clojure.template-api.html
132 lines (120 loc) · 5.96 KB
/
clojure.template-api.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<html>
<head>
<title>clojure.template API reference (Clojure)</title>
<link href="static/favicon.png" rel="icon" />
<link href="static/favicon.png" rel="shortcut icon" />
<link media="all" type="text/css" href="static/clojure.css" rel="stylesheet" />
<link media="all" type="text/css" href="static/wiki.css" rel="stylesheet" />
<link media="all" type="text/css" href="static/internal.css" rel="stylesheet" />
<!-- TODO: are we using these (from clojure.org)? If so, add the files -->
<script src="file/view/code_highlighter.js" type="text/javascript"></script>
<script src="file/view/clojure.js" type="text/javascript"></script>
<style>.menuWrapper{height: 36px;}</style>
<!--[if lte IE 6]>
<link rel="stylesheet" href="http://www.wikispaces.com/_/2009051601/s/internal_ie.css" type="text/css" />
<![endif]-->
</head>
<!--
This document was auto-generated from the source by the clojure autodoc system.
To report errors or ask questions about the overall documentation structure, formatting,
etc., contact Tom Faulhaber (google mail name: tomfaulhaber).
For errors in the documentation of a particular namespace, contact the author of that
namespace.
-->
<body>
<div id="AllContentContainer">
<div id="Header">
<a id="Logo" href="index.html"><img alt="Clojure" height="100" width="100" src="static/clojure-icon.gif" /></a>
<h1><a title="page header title" id="page-header" href="index.html">Clojure Core API Reference</a></h1>
</div>
<div id="leftcolumn"><div style="text-align: center;"></div>
<div class="menu">
<div class="WikiCustomNav WikiElement wiki">
<div class="BranchTOC">
<a class="wiki_link" href="#">Branches</a>
<ul id="left-sidebar-branch-list">
<li><a href="index.html" class="wiki_link">master</a></li><li><a href="branch-1.1.x/index.html" class="wiki_link">1.1.x</a></li>
</ul>
</div>
<a class="wiki_link" href="index.html">Overview</a><br />
<a class="wiki_link" href="api-index.html">API Index</a><br />
<a class="wiki_link" href="#">Namespaces:</a>
<ul id="left-sidebar-list">
<li><a href="clojure.core-api.html" class="wiki_link">clojure.core</a></li><li><a href="clojure.inspector-api.html" class="wiki_link">clojure.inspector</a></li><li><a href="clojure.main-api.html" class="wiki_link">clojure.main</a></li><li><a href="clojure.pprint-api.html" class="wiki_link">clojure.pprint</a></li><li><a href="clojure.set-api.html" class="wiki_link">clojure.set</a></li><li><a href="clojure.stacktrace-api.html" class="wiki_link">clojure.stacktrace</a></li><li><a href="clojure.template-api.html" class="wiki_link">clojure.template</a></li><li><a href="clojure.test-api.html" class="wiki_link">clojure.test</a></li><li><a href="clojure.walk-api.html" class="wiki_link">clojure.walk</a></li><li><a href="clojure.xml-api.html" class="wiki_link">clojure.xml</a></li><li><a href="clojure.zip-api.html" class="wiki_link">clojure.zip</a></li>
</ul>
</div>
</div>
</div>
<div id="rightcolumn">
<div id="Content">
<div class="contentBox"><div class="innerContentBox">
<div id="content_view" class="wiki wikiPage">
<div id="right-sidebar"><div id="toc">
<h1 class="nopad">Table of Contents</h1>
<div style="margin-left: 1em;" class="toc-section">
<a href="#toc0">Overview</a>
<div style="margin-left: 1em;" class="toc-entry">
<a href="#clojure.template/apply-template">apply-template</a>
</div><div style="margin-left: 1em;" class="toc-entry">
<a href="#clojure.template/do-template">do-template</a>
</div>
<br />
</div>
</div>
</div>
<div id="content-tag"><h1 id="overview">API for <span id="namespace-name">clojure.template</span>
<span id="branch-name">(master branch)</span></h1>
by <span id="author">Stuart Sierra</span><br />
<br />Usage:
<pre>
(ns your-namespace
(:require <span id="long-name">clojure.template</span>))
</pre><pre>
</pre><h2>Overview</h2>
<pre id="namespace-docstr">Macros that expand to repeated copies of a template expression.</pre>
<br />
<h2>Public Variables and Functions</h2>
<div id="var-entry">
<br />
<hr />
<h2 id="clojure.template/apply-template">apply-template</h2>
<span id="var-type">function</span><br />
<pre id="var-usage">Usage: (apply-template argv expr values)
</pre>
<pre id="var-docstr">For use in macros. argv is an argument list, as in defn. expr is
a quoted expression using the symbols in argv. values is a sequence
of values to be used for the arguments.
apply-template will recursively replace argument symbols in expr
with their corresponding values, returning a modified expr.
Example: (apply-template '[x] '(+ x x) '[2])
;=> (+ 2 2)</pre>
<a href="http://github.com/richhickey/clojure/blob/787938361128c2bc21ed896dd4523651b59cb420/src/clj/clojure/template.clj#L30" id="var-source">Source</a>
</div><div id="var-entry">
<br />
<hr />
<h2 id="clojure.template/do-template">do-template</h2>
<span id="var-type">macro</span><br />
<pre id="var-usage">Usage: (do-template argv expr & values)
</pre>
<pre id="var-docstr">Repeatedly copies expr (in a do block) for each group of arguments
in values. values are automatically partitioned by the number of
arguments in argv, an argument vector as in defn.
Example: (macroexpand '(do-template [x y] (+ y x) 2 4 3 5))
;=> (do (+ 4 2) (+ 5 3))</pre>
<a href="http://github.com/richhickey/clojure/blob/787938361128c2bc21ed896dd4523651b59cb420/src/clj/clojure/template.clj#L45" id="var-source">Source</a>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="foot">
<div style="text-align: center;" id="copyright">Copyright 2007-2009 by Rich Hickey</div>
</div>
</div>
<div id="DesignedBy">Logo & site design by <a title="Visit Tom Hickey's website." href="http://www.tomhickey.com">Tom Hickey</a>.<br />
Clojure auto-documentation system by Tom Faulhaber.</div>
</div>
<!-- /AllContentContainer -->
</body>
</html>