| A lot of my paragraph tags look like (tag p (pr "blah blah blah"))
which I can shorten with a procedure p like Arc's para: (def p args
(tag p (apply pr args)))
(p "blah blah blah")
On occasion though I need to include some tags in my paragraph, so I'm back to having to use pr: (tag p
(pr "blah blah ")
(tag b (pr "blah"))
(pr " blah"))
I noticed that within a tag, a plain string doesn't do anything (the value is just thrown away), and so it wouldn't hurt to have plain strings automatically printed.With a macro helper function, (def autopr (args)
(map [if (isa _ 'string) `(pr ,_) _] args))
(mac p args
`(tag p
,@(autopr args)))
(mac b args
`(tag b
,@(autopr args)))
arc> (p "blah blah " (b "blah") " blah")
<p>blah blah <b>blah</b> blah</p>
|