recur icon indicating copy to clipboard operation
recur copied to clipboard

Multiple &optional parameters get shuffled

Open vemv opened this issue 13 years ago • 1 comments

A simple case:

(recur-defun* ¬ (&optional a b)
  (message (prin1-to-string (list a b)))
  (if (> a b)
      (recur (- a b) b)
      b))

(¬ 10 1)

; Inspecting the iterations at *Messages*:
; (10 1)
; (1 9)

Thank you very much for the hard work Vincent - I'm currently having fun with quite a few of your emacs-utils!

vemv avatar Aug 22 '12 15:08 vemv

Vemv, thanks for the heads up. I actually haven't looked at this code since I factored it out of my big pile'o libraries. It was largely superceded by a more stable implementation of recursion in the pattern matching library shadchen. I'll try to find the bug here and fix it when I have time, but you are welcome to take a shot at it.

It is a pretty embarrassing bug, though. I need more test cases. Probably I tested it with only a single argument before now.

Thanks!

VincentToups avatar Aug 22 '12 15:08 VincentToups