Arc Forumnew | comments | leaders | submitlogin
1 point by aston 5905 days ago | link | parent

Might wanna have w/temps work more like

  (w/temps x y
    (def foo (x) (+ x y))
    (tempset y 10)
    (foo 5))
That is, like a with, but with x and y set to some dummy values. You wouldn't even need a tempset then, right?


2 points by bogomipz 5904 days ago | link

Right indeed. The normal way to do this would be;

  (with (y nil foo nil)
    (= foo (fn (x) (+ x y)))
    (= y 10)
    (foo 5))
You can't use 'def there because, unlike in Scheme, def always makes a global binding in Arc. Including x in the with is not necessary, by the way.

From the sound of it, this does not solve lacker's problem, however, because he does not know up front what variables he needs to declare.

-----