Arc Forumnew | comments | leaders | submitlogin
1 point by evanrmurphy 5011 days ago | link | parent

Relatedly, why not define afn in terms of rfn?

  (mac afn (parms . body)
    `(rfn self ,parms ,@body))
Am I missing something here?


2 points by waterhouse 5010 days ago | link

I'm guessing they defined afn because it was frequently useful, then defined rfn because they needed it "for use in macro expansions", and didn't find the refactoring worth their trouble.

Note, by the way, that rfn = "recursive fn" (that's the only reason you would use it instead of fn). But rif is certainly not "recursive if". If you still find it helps you remember it or that it makes more sense, sure, use it, but I would personally use iflet. (Or you could have it defined both ways and use whichever one your brain remembers first.)

-----

1 point by evanrmurphy 5009 days ago | link

Somehow it had escaped me that the r stood for "recursive". I thought maybe it stood for "reference", in which case rif would be a sensible name.

I think you're right this definition could just override iflet. It would be an obscure case where you wouldn't want var binding to the other exprs.

-----