Arc Forumnew | comments | leaders | submitlogin
1 point by almkglor 6158 days ago | link | parent

No, my friend, the problem is the order of evaluation.

  (let pm (table)
      (pm 1))
  (mac pm ...)
versus:

  (mac pm ...)
  (let pm (table)
     (pm 1))
Unless you qualifiy everything with syntactic modifiers, order of evaluation will matter, and matter horribly.


1 point by bramsundar 6158 days ago | link

I'm sorry, but could you explain your example a bit more? I don't think that I understand the issue here. If pm is redefined as a table through the let, why wouldn't we be able to access the macro version through the modifier? the table would clobber the variable version (@pm), but not the macro version right?

-----

2 points by almkglor 6158 days ago | link

Local variables never override macros. In the first case above, the let will return the expected value correctly, because pm at that time hasn't been defined yet. In the second case, it will not return the expected value, because pm is defined as a macro, and (pm 1) gets replaced with whatever (pm 1) expands to, let notwithstanding.

-----