Plot2kill 0.2
Robert Jacques
sandford at jhu.edu
Sat Mar 5 12:22:15 PST 2011
On Sat, 05 Mar 2011 13:42:32 -0500, bearophile <bearophileHUGS at 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).
More information about the Digitalmars-d-announce
mailing list