Re: Thinking about optional parameters and optional object elements

2017-08-07 Thread Jeremy Roussak via 4D_Tech
Yes, yes, yes, yes, yes! structs are the single biggest thing I missed when coming to 4D from C; and I still miss them. Objects are not a substitute, nice and useful though they may be. Jeremy Jeremy Roussak j...@mac.com > +1,000! I was fighting for structs for months over on the Forums

Re: Thinking about optional parameters and optional object elements

2017-07-31 Thread David Adams via 4D_Tech
On Mon, Jul 31, 2017 at 1:44 PM, Julio Carneiro via 4D_Tech < 4d_tech@lists.4d.com> wrote: > We coud write something like: > > MyMediocreMethod(->[Table];5;Current date;{numofdays:5}) > or > > MyMediocreMethod(->[Table];5;Current date;{startDay:0; numofdays:5}) > Yes, wouldn't that be nice :(

Re: Thinking about optional parameters and optional object elements

2017-07-31 Thread Julio Carneiro via 4D_Tech
Well, I might hate you less ;-) if instead of: > > MyMediocreMethod(->[Table];5;Current date;"";"";0;5) We coud write something like: > MyMediocreMethod(->[Table];5;Current date;{numofdays:5}) or > MyMediocreMethod(->[Table];5;Current date;{startDay:0; numofdays:5}) If the optional parameters

Re: Thinking about optional parameters and optional object elements

2017-07-31 Thread David Adams via 4D_Tech
Julio, I'm sure that you hate what I'm saying in the nicest possible way ;-) I think that you more-or-less got what I was saying, although a bit less ugly that. This sort of code is really horrible in every way: OB SET($options;”o4”;p4;”o5”;”";”o6”;”";”o7”;”") or

Re: Thinking about optional parameters and optional object elements

2017-07-31 Thread Julio Carneiro via 4D_Tech
David, If I understood your thoughts right, which is no guarantee at all ;), I believe you are proposing replacing a method call like: MyMethodWithOptionals(p1, p2, p3, p4) or MyMethodWithOptionals(p1, p2, p3, p4, p5, p6,p7) where parameters 1-3 are mandatory and 4-7 optional, by