Arc Forumnew | comments | leaders | submitlogin
Should optional arguments be closer to CL?
6 points by kennytilton 6124 days ago | 4 comments
This is not much of a hardship, but there is no way to have mandatory parameters after optionals, so why must we code:

  (def foo (x (o y)(o z))...)
Why not borrow from CL?:

  (def foo (x &o y z)...)
Just a thought, no big deal.


2 points by tel 6124 days ago | link

Somewhere earlier pg suggested that he'll probably want to have more than just optional parameters at some point in the future. The idea was that at least as of now (o ...) is more robust.

-----

2 points by bogomipz 6124 days ago | link

Here's the other thread;

http://arclanguage.org/item?id=2052

It started with the idea of using ? rather than o, then someone suggested using only one ? for all optional arguments.

-----

1 point by ryantmulligan 6124 days ago | link

It seems that required arguments after optional ones makes it hard for callers to think about what they are passing to the procedure. Keyword arguments solve this problem.

-----

1 point by lojic 6124 days ago | link

+1

Also, either way I would prefer &o instead of simply o for readability.

-----