Arc Forumnew | comments | leaders | submitlogin
1 point by absz 6079 days ago | link | parent

As a first cut, I would scan through to find the tempsets, take out the variables, and then expand to a let or with block now that you know their names.


2 points by almkglor 6079 days ago | link

  (mac make-things-difficult (c v)
    (if (some-property v)
      `(tempset ,c ,v)
      `(if (another-property ,v)
          (tempset ,c ,v)
          (= ,c ,v))))

-----

1 point by absz 6079 days ago | link

Ah. Right. (And I even worried about similar things when writing make-br-fn...). Well, it would work in simple cases, but let/with are looking like better ideas.

Actually, if we add another primitive (with $ or xdef) which works using mzscheme's namespace-undefine-value!, we could have tempset maintain a global list of tempset variables, and cleartemps go through and undefine them.

-----