regexp and valid-sre? Michael Montague (26 Nov 2013 03:34 UTC)
Re: regexp and valid-sre? Alex Shinn (26 Nov 2013 12:44 UTC)
Re: regexp and valid-sre? Peter Bex (26 Nov 2013 14:25 UTC)
Re: regexp and valid-sre? Michael Montague (26 Nov 2013 18:00 UTC)
Re: regexp and valid-sre? Peter Bex (26 Nov 2013 18:21 UTC)
Re: regexp and valid-sre? Michael Montague (26 Nov 2013 19:09 UTC)
Re: regexp and valid-sre? John Cowan (26 Nov 2013 18:24 UTC)
Re: regexp and valid-sre? Michael Montague (26 Nov 2013 19:17 UTC)
Re: regexp and valid-sre? Peter Bex (26 Nov 2013 19:23 UTC)
Re: regexp and valid-sre? Kevin Wortman (26 Nov 2013 19:52 UTC)
Re: regexp and valid-sre? Michael Montague (26 Nov 2013 19:59 UTC)
Re: regexp and valid-sre? Kevin Wortman (27 Nov 2013 23:33 UTC)
Re: regexp and valid-sre? John Cowan (27 Nov 2013 23:42 UTC)
Re: regexp and valid-sre? Arthur A. Gleckler (30 Nov 2013 14:55 UTC)
Re: regexp and valid-sre? Michael Montague (26 Nov 2013 18:02 UTC)
Re: regexp and valid-sre? John Cowan (26 Nov 2013 18:19 UTC)
Re: regexp and valid-sre? Michael Montague (26 Nov 2013 19:11 UTC)

Re: regexp and valid-sre? Kevin Wortman 26 Nov 2013 19:52 UTC

> The only use case for 'valid-sre?' mentioned so far is Peter's
> interactive regular expression IDE. The C standard does not require the
> -fsyntax-only option. These do not seem like compelling arguments for
> including
> 'valid-sre?'.

There is a well-established Scheme idiom that every client-visible data
type have a constructor, and a type predicate such as valid-sre? . In
general user-created data types don't have explicit names in the source
code, so the type predicate may stand for the type itself in
documentation and comments. Speaking for myself, when learning about a
new library the first thing I do is read about all the type predicates
since they enumerate the relevant data structures and roughly how they
interrelate.

In terms of practicalities, sanity-checking predicates such as
valid-sre? are helpful for error checking and interactive debugging.
They are also necessary for specifying contracts on procedures. See e.g.
http://docs.racket-lang.org/reference/contracts.html
which depends upon every data type having a type predicate.

Kevin Wortman