Arc Forumnew | comments | leaders | submitlogin
7 points by rntz 5634 days ago | link | parent

Here's the diff: http://www.rntz.net/files/arc3-features.diff

There's a bug in the andf "optimization". Namely, it can cause multiple evaluation of the arguments to the andf'ed function:

    arc> ((andf odd even) (prn 3))
    3
    3
    nil
    arc> user break
    > (ac '((andf odd even) 2) ())
    (if (not (ar-false? (ar-funcall1 _odd 2))) (ar-funcall1 _even 2) (quote nil))
Note how 3 was printed twice. This is because the expression(s) passed to the andf-expression are substituted directly into the argument lists passed to the andf-ed functions, which means they will be evaluated once for each andf-ed function applied.


4 points by pg 5634 days ago | link

Oops, will fix.

-----

4 points by pg 5633 days ago | link

This is fixed in the latest arc3.tar. Thanks for catching it.

-----