Re: coop - a concurrent ml-like wanna be (pre-SRFI)
Wolfgang Corcoran-Mathe 06 May 2021 21:54 UTC
On 2021-05-06 21:37 +0200, Marc Nieper-Wißkirchen wrote:
> Unless you can be sure that procedure can be inlined by the compiler and
> the optimizer can understand the code the match macro generates, a
> procedure of the form (lambda args ...) will be rather inefficient.
>
> Don't cons arguments (in the form of a rest argument) just to be able to
> use match to destructure them.
I don't want to belabor the point, but I think that it depends; we
can't easily write "fast" under case-lambda and "slow" under
match-lambda or the like without talking about specific
implementations. The portable case-lambda implementation from R7RS
also expands to (lambda args ...); given the possibility that someone
will run code on a Scheme using this, I wouldn't be particularly
worried about trying to optimize argument-matching in portable code.
--
Wolfgang Corcoran-Mathe <xxxxxx@sigwinch.xyz>
"Prolonged contact with the computer turns mathematicians into
clerks and vice-versa." --Alan J. Perlis