wow, that was really fast. thanks!<br><br><div class="gmail_quote">On Sat, Nov 26, 2011 at 09:37, Robby Findler <span dir="ltr"><<a href="mailto:robby@eecs.northwestern.edu">robby@eecs.northwestern.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">This has been changed in the current pre-release version, available<br>
from git and via a nightly build:<br>
<br>
<a href="http://pre.racket-lang.org/installers/" target="_blank">http://pre.racket-lang.org/installers/</a><br>
<br>
Robby<br>
<div><div class="h5"><br>
On Fri, Nov 25, 2011 at 3:22 PM, ozzloy <<a href="mailto:ozzloy@gmail.com">ozzloy@gmail.com</a>> wrote:<br>
> i was writing a unit test which had something analogous to the following:<br>
> (check-equal? #rx"a" #rx"a") => raises exn:test:check<br>
> so i checked and sure enough:<br>
> (equal? #rx"a" #rx"a) => #f<br>
> which led me to look for a regexp-equal? so i could do (check regexp-equal?<br>
> #rx"a" #rx"a")<br>
> that doesn't exist, so i wrote one:<br>
> (define (regexp-equal? a b)<br>
> (and (and (regexp? a)<br>
> (regexp? b))<br>
> (or (and (pregexp? a)<br>
> (pregexp? b))<br>
> (and (not (pregexp? a))<br>
> (not (pregexp? b))))<br>
> (equal? (object-name a)<br>
> (object-name b))))<br>
> why not just have (equal? #rx"a" #rx"a") => #t ?<br>
> anticipated objection: "what should equal? mean for two regexps?"<br>
> it should mean that the patterns are identical, totally ignoring that two<br>
> non-identical patterns might match exactly the same set, like #rx"(a|b)" and<br>
> #rx"(b|a)".<br>
> i see in the docs that there is an internal regexp value. if those are what<br>
> i think they are, i propose equal? just compares those for regexes.<br>
><br>
</div></div>> _________________________________________________<br>
> For list-related administrative tasks:<br>
> <a href="http://lists.racket-lang.org/listinfo/users" target="_blank">http://lists.racket-lang.org/listinfo/users</a><br>
><br>
</blockquote></div><br>