Arc Forumnew | comments | leaders | submitlogin
3 points by absz 5752 days ago | link | parent

You could also wrap your or= sequence in a macro:

  (mac defaults args
    `(do ,@(pair args (fn (var val) `(or= ,var ,val)))))
  
  (def the-example (value1 value2 value3 value4)
    (defaults value1 'Results
              value2 'wahoo!
              value3 'ugh!
              value4 'omg!)
    (prn "Value1: " value1)
    (prn "Value2: " value2)
    (prn "Value3: " value3)
    (prn "Value4: " value4))