Arc Forumnew | comments | leaders | submitlogin
1 point by greatness 6132 days ago | link | parent

Why not follow the same idea as < and >:

  (def <=? args 
    (if (apply <= args) (car args)))


1 point by sjs 6130 days ago | link

I should have been clearer. I agree the semantics should be the same, I just didn't see an immediately clean way to add that to the current, recursive <= and >= functions. A thin wrapper would work just fine.

-----

1 point by greatness 6126 days ago | link

Yeah, either that or use a lambda function inside their definitions:

  (def >= args
    (let f (afn (ar) (or no.ar
                       (no:cdr ar)
                       (and (no:< car.ar cadr.ar)
                       (self:cdr ar))))
      (if (f args) car.args)))

-----