On Mon, 17 Dec 2018 at 07:58 -0800, Will Jukes wrote:
> After learning more Haskell I've been playing around with match and
> define/match, and I'm wondering if there's any particular reason to
> prefer more traditional Scheme forms over match (I vastly prefer match
> in most cases). Glancing at the match module it looks the process of
> expanding a match clause is pretty intricate, and the documentation
> mentions that match lacks the time complexity guarantee of case, but
> beyond that it's not immediately clear whether match imposes some
> unacceptable overhead or etc., or to what extent it does if so.

You can always use "expand" or "expand-once" to look at the code
generated by the use of a match. Usually, it's just a bunch of nested
conds and lets, with a function and call to check the next pattern.

Haskell's pattern matching is probably compiled to something more
efficient (anyone want to test this hypothesis?), but Racket's works
when you need it, and has some really nice features (e.g., list-no-order
and quasiquote matches).

-- 
Jack M. Rosenthal                 ( http://inside.mines.edu/~jrosenth
Graduate Student, Computer Science )     http://jack.rosenth.al

One of the main causes of the fall of the Roman Empire was
that -- lacking zero -- they had no way to indicate successful
termination of their C programs.
    -- Robert Firth

-- 
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.
For more options, visit https://groups.google.com/d/optout.

Attachment: signature.asc
Description: PGP signature

Reply via email to