Closed jackfirth closed 1 year ago
These improvements look really good — thanks!
If resyntax also tore apart 2,000 line syntax functions, it would be perfect :-)
I am a little bit hesitant of the (-> any/c boolean?) to predicate/c transformation. I feel like the former is easier to read.
Robby
I am a little bit hesitant of the (-> any/c boolean?) to predicate/c transformation. I feel like the former is easier to read. Robby
I agree with this, actually. It's a little weird that predicate/c
exists at all. The docs say it's because it offers some optimizations to avoid wrappers for struct type predicates. But could we just make ->
smart enough to recognize (-> any/c boolean?)
as a special case and avoid wrappers for that too? Then predicate/c
would be obsolete.
Looks like it does! yay. :)
#lang racket
(struct s ())
(eq? (contract (-> any/c boolean?) s? 'pos 'neg) s?) ;; => #t
Perfect! Then I think it's time to update the docs for predicate/c
to say it's now an obsolete alias for (-> any/c boolean?)
, and the latter should just be used directly instead.
This one is a continuation of #363, this time expanded to the entire
scribble/private
collection.