<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Dec 6, 2014, at 1:08 AM, Alexis King wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html charset=windows-1252"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div><blockquote type="cite" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">It doesn’t have to be a struct, but the problem is that typed racket doesn’t know that a value of type String for instance will be of type JSExpr or not, so you would have to put (assert x jsexpr?) around everything that you want to treat as a jsexpr.</div></div></blockquote></div><br class=""><div class="">Ah, that’s interesting. I’d seen assert when digging through the docs, but I didn’t quite realize how it worked at the time. Looking back at it again, I’m surprised I missed it, but no matter.</div><div class=""><br class=""></div><div class="">That <i class="">does</i> solve the problem, albeit rather inelegantly. I’d be interested to see if there’s another way, but I would understand why it would be difficult to implement a cleaner approach.</div></div></blockquote><br></div><div>From 100,000 ft: </div><div><br></div><div> JSON and XML and such things have one of two types: a coarse one that does not really address the things a programmer thinks and an incredibly fine-grained one that expresses all of these things. The latter requires a highly intrinsic, complicated, difficult to use thing [due to the union/recursive/dynamic nature of the objects], which no real languages comes with. I conjecture that TR could accommodate just such a type system -- but that might be a dissertation. I should talk to Sam. </div><div><br></div><div>-- Matthias</div><div><br></div><br></body></html>