Subject: bug#40968: 28.0.50; (apply nil)

From: Pip Cet <[email-masked]>
Date: Thu, 7 May 2020 11:58:47 +0000

On Thu, May 7, 2020 at 11:54 AM Noam Postavsky <[email-masked]> wrote:
> -      (byte-optimize-apply `(apply #'funcall ,(cadr form)))
> +      (byte-optimize-apply `(apply (car ,(cadr form)) (cdr ,(cadr form))))

That double-evaluates (cadr form), doesn't it?

> -  ptrdiff_t numargs = list_length (spread_arg);
> +  if (nargs == 1)
> +    /* Special case: FUN is really a list of (FUNCTION . ARGS).  */
> +    return CALLN (Fapply, CAR (fun), CDR (fun));

But what if someone defines nil as a function (not serious)? (apply
nil) gets translated to (apply nil nil) which I guess will throw an
error, so that's okay.