Arc Forumnew | comments | leaders | submitlogin
7 points by rocketnia 5323 days ago | link | parent

In my code, I've been doing sorta convoluted things to avoid accidental macro-expansion just like what you're talking about:

  (def whatever (row) (row "something"))     ; unsafe
  (def whatever (row) (do.row "something"))  ; safe
  (def whatever (row) (or.row "something"))  ; safe
  ; The "or.row" one is possibly more efficient, since it expands to
  ; "row", but I use "do.row" 'cause I don't want to desensitize myself
  ; to "or".
  
  (def whatever (tab key) (= tab.key "something"))     ; unsafe
  (def whatever (tab key) (= do.tab.key "something"))  ; doesn't work
  (def whatever (tab key) (= or.tab.key "something"))  ; confuses me
  (def whatever (tab key) (= .key.tab "something"))    ; safe
As long as I keep this up, my macros and parameters can conflict all they like, and it doesn't matter. But this approach basically amounts to qualifying the name of each parameter as it's used in function position, so from my point of view, macros and parameters almost don't live in the same namespace.