On Sat, Jan 7, 2017 at 4:49 AM, John Cowan <xxxxxx@ccil.org> wrote:

On Wed, Jan 4, 2017 at 1:46 AM, Alex Shinn <xxxxxx@gmail.com> wrote:
 
2. it's quadratic in code size for optional argument handling

If naively implemented, yes.

I'm not talking about implementation, I'm talking about
usage (pre-expanded code).  Consider:

  (define foo
    (opt-lambda ((a 1) (b 2) (c 3) (d 4))
      ...))

versus

  (define foo
    (case-lambda
      (() (foo 1 2 3 4))
      ((a) (foo a 2 3 4))
      ((a b) (foo a b 3 4))
      ((a b c) (foo a b c 4))
      ((a b c d) ...)))

This is actually unacceptable because it duplicates the
defaults multiple times.  You should instead write it as

  (define foo
    (case-lambda
      (() (foo 1))
      ((a) (foo a 2))
      ((a b) (foo a b 3))
      ((a b c) (foo a b c 4))
      ((a b c d) ...)))

and hope that the premature optimizations have handled
this so it doesn't require four extra recursions for (foo).
Even then, you're requiring the programmer to write a
number of clauses linear in the number of parameters,
while the size of the clauses is quadratic!

-- 
Alex