Arc Forumnew | comments | leaders | submitlogin
1 point by Pauan 3407 days ago | link | parent

Okay, scrap that. Here's my new plan:

Make all arguments optional, as per evanrmurphy's suggestion. I'll still support the (o foo) form for backwards compatibility, but I think it has so many problems that it really should be avoided.

This isn't final, but I figure the simplicity of not supporting required parameters will be a net gain most of the time. If you really need required parameters, it's possible to write macros that do the checks at run-time. I might even provide such a macro in arc.arc so you don't have to write it yourself.

Also, for telling Arc what the default is (it's normally nil), you use the (= foo 'bar) form, like so:

  (def foo ((o a 1) (o b 2))) ; pgArc
  (def foo ((= a 1) (= b 2))) ; PyArc
I also plan to support argument-ssyntax, which is basically ssyntax that is only expanded in the argument list. Then you can do this:

  (def foo (a=1 b=2))
This should, of course, be customizable within Arc.