On Sat, 05 Mar 2011 13:42:32 -0500, bearophile <bearophileh...@lycos.com>
wrote:
dsimcha:
I've done some major updating of my Plot2kill plotting library lately,
I see code that wants named arguments :-)
65 auto sleepinessFig = Figure(sleepinessPlot)
66 .title("Sleepiness Survey")
67 .yLabel("Sleepiness Rating")
68 .xLabel("Activity")
69 .legendLocation(LegendLocation.right)
70 .horizontalGrid(true)
71 .xTickLabels(
72 iota(3),
73 ["In Meeting", "On Phone", "Coding"]
74 );
Bye,
bearophile
Why? Each of those arguments should be able to be set after creation. So
given DRY principals, method chaining is the way to go. Besides, Figure
takes a variable number of plot arguments, which means you couldn't
support default arguments (at least with the current syntax).