Arc Forumnew | comments | leaders | submitlogin
Using the same variable twice in a parameter list
1 point by CatDancer 4541 days ago | 1 comment
Just happened to be reading one of the old (now outdated) Arc essays http://www.paulgraham.com/ilc03.html

So, for example, it is not illegal in Arc to use the same variable twice in a parameter list. There's a consistent interpretation of such code-- bind the parameters left to right-- and that's what I do.

You know, I actually tried to do this once. I forget exactly what I was doing, but I had some code like

  (f x y z)
where f was a variable that could be one of several functions. All the functions needed to take three arguments since they were all called the same way, but one of the functions didn't use its first two arguments. So for that function I typed:

  (def foo (_ _ a)
    ...)
MzScheme didn't like that of course. ^_^

  Error: "lambda: duplicate argument name at: _ in: (lambda (_ _


1 point by pg 4541 days ago | link

I was talking about an earlier implementation of Arc. One day we'll take control of stuff like parameters and remove this restriction again.

-----