I've recently noticed some surprising behavior from `opt/c` with regards to
whether it produces a `flat-contract?` when its argument is flat: sometimes
it does, and sometimes it doesn't, even when given the same contract.
The following program is the best I've come up with at demonstrating the
inconsistency consistently. The only difference I can discern between
`two-step-opt-state/c` and `one-step-opt-state/c` is that the latter is
statically visible, but if anything that makes it more surprising that
`one-step-opt-state/c` doesn't produce a `flat-contract?`.
>From looking at the expansion, though, it looks `two-step-opt-state/c` is
just `(coerce-contract 'opt/c state/c)`, so I guess the more complicated
expansion of `one-step-opt-state/c` is where the flatness gets lost.
(struct state (prev now next)
(or/c (struct/c state
;; returns #t, as it should
;; also returns #t, which makes sense
(opt/c (or/c (struct/c state
;; inexplicably returns #f
You received this message because you are subscribed to the Google Groups
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
For more options, visit https://groups.google.com/d/optout.