<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Eli Barzilay wrote at 12/22/2010 08:04 PM:
<blockquote cite="mid:19730.40985.544287.235066@winooski.ccs.neu.edu"
type="cite">
<pre wrap="">6 minutes ago, Neil Van Dyke wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Thanks for your comments, Eli. I am still wavering on whether to do the permissive thing. And I am also looking at whether Typed Scheme and/or "html-template" make the permissiveness less useful than before.
</pre>
</blockquote>
<pre wrap=""><!---->
Well, the problems that I ran into wouldn't have been different if there was a type system around -- changing a function still means changing call sites, etc.
</pre>
</blockquote>
<br>
Well, it seems that TR can tell the difference between ``(p "foo")''
(i.e., element) and ``((p "foo") ((p "bar"))'' (i.e., content) at the
borders it guards.<br>
<br>
Where those borders occur, I think depends on things like how much
tools like "html-template" do for the programmer, and where else the
programmer puts those borders. Of course, I can still imagine likely
cases in which splicing errors can occur within procedures.<br>
<br>
BTW, initially, I am *not* trying to match all of SXML with TR rules,
but instead just match objects like strings and the first two pairs of
each list. Once that's good, then I can measure the performance change
when matching entire lists and their trees, and see if there's a
problem and what I can do about it.<br>
<br>
<blockquote cite="mid:19730.40985.544287.235066@winooski.ccs.neu.edu"
type="cite">
<blockquote type="cite">
<pre wrap="">Permissiveness sure does make some things harder to implement and more computationally expensive.
</pre>
</blockquote>
<pre wrap=""><!---->
Why is it harder? My experience so far is that the cost in terms of implementation complexity is very minor.
</pre>
</blockquote>
<br>
Example:<br>
<br>
(xexp-char-ref-value '(& copy)) ;;==> copy<br>
(xexp-char-ref-value '(& () ((() () (() copy) (()))) ())) ;;==>
copy<br>
<br>
(: xexp-char-ref-value (XexpNamedCharRef -> Symbol))<br>
(define (xexp-char-ref-value char-ref)<br>
(or (let: loop-find-symbol : (U Symbol False)<br>
((lst : Any (cdr char-ref)))<br>
(cond<br>
((null? lst) #f)<br>
((pair? lst)<br>
(let ((head (car lst)))<br>
(cond ((symbol? head)<br>
(%assert-only-xexp-extraneous-lists (cdr lst))<br>
head)<br>
((pair? head)<br>
(cond ((loop-find-symbol head)<br>
=> (lambda (found)<br>
(%assert-only-xexp-extraneous-lists (cdr
head))<br>
(%assert-only-xexp-extraneous-lists (cdr
lst))<br>
found))<br>
((loop-find-symbol (cdr head))<br>
=> (lambda (found)<br>
(%assert-only-xexp-extraneous-lists (cdr
lst))<br>
found))<br>
(else (loop-find-symbol (cdr lst)))))<br>
((null? head) (loop-find-symbol (cdr lst)))<br>
(else (raise-invalid-xexp-error<br>
'xexp-char-ref-value<br>
#:expected "char-ref body"<br>
#:invalid-xexp head<br>
#:context-xexp char-ref)))))<br>
(else (raise-invalid-xexp-error<br>
'xexp-char-ref-value<br>
#:expected "proper list in char-ref body"<br>
#:invalid-xexp lst<br>
#:context-xexp char-ref))))<br>
(raise-invalid-xexp-error 'xexp-char-ref-value<br>
#:expected "char-ref"<br>
#:invalid-xexp char-ref)))<br>
<br>
<br>
<blockquote cite="mid:19730.40985.544287.235066@winooski.ccs.neu.edu"
type="cite">
<pre wrap=""> (define (bp . body) (apply p style: "text-weight: bold;" body))
it works, but I'd like to be able to use it with:
(bp style: "color: blue;" "blah blah")
</pre>
</blockquote>
<br>
I see what you mean. In the case of the "style" attribute in HTML, I
believe that recommended practice is to instead use CSS rules based on
element names, "class" attributes, element structures, and possibly
"id" attributes. Perhaps in XML processing there are analogous
problems, but perhaps the solution comes down to a transformation
operation or a schema change.<br>
<br>
<div class="moz-signature">-- <br>
<a class="moz-txt-link-freetext" href="http://www.neilvandyke.org/">http://www.neilvandyke.org/</a>
</div>
</body>
</html>