On Sat, Feb 15, 2020 at 1:23 PM 'John Clements' via users-redirect <
us...@plt-scheme.org> wrote:

> Yes, absolutely. One reason that students in my class wind up using cast
> quite frequently in their parsers is that they use patterns like (list (?
> symbol s) …) which (as I recall) expand into unannotated lambda’s, and
> always require a cast.


I like `assert` for those situations: it fails immediately if anything goes
wrong, and it uses a predicate, so it corresponds well to the `?` pattern.
(It can also perform better.)

-Philip

> --
-Philip

-- 
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 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAH3z3gbMiTHvBBRsRFuNzTJNy0sOMMZ3DGNbe312%2Bmjf7atdDg%40mail.gmail.com.

Reply via email to