why is (prog . '((+ 1 2 3) (+ 4 5 6))) not equivalent to (apply 'prog '((+ 1 2 3) (+ 4 5 6)))

2021-05-26 Thread polifemo
(prog . '((+ 1 2 3) (+ 4 5 6))) returns the expected value, 15, while (apply 'prog '((+ 1 2 3) (+ 4 5 6))) fails with "Address boundary error". Why is this so? I would have expected both to behave the same, and they do if I use a more benign function like '+ (+ . (1 2 3)) -> 6 (apply '+ (1 2 3))

Re: why is (prog . '((+ 1 2 3) (+ 4 5 6))) not equivalent to (apply 'prog '((+ 1 2 3) (+ 4 5 6)))

2021-05-26 Thread Alexander Burger
On Wed, May 26, 2021 at 11:49:57PM -0500, polifemo wrote: > (prog . '((+ 1 2 3) (+ 4 5 6))) returns the expected value, 15, while > (apply 'prog '((+ 1 2 3) (+ 4 5 6))) fails with "Address boundary error". 'apply' can be used only with functions evaluating their arguments (EXPRs or SUBRs). It take