[phobos] Time to get ready for the next release

David Simcha dsimcha at gmail.com
Thu Apr 21 13:16:48 PDT 2011


On Thu, Apr 21, 2011 at 4:12 PM, Michel Fortin <michel.fortin at michelf.com>wrote:

> > How about the fact that it breaks using the same function for both method
> chaining and with property syntax?
>
>
> Just use "with":
>
>        with (new Album) {
>                name = "hello";
>                author = "me";
>                group = "them";
>                save("/musicinfo/hello.album");
>        }
>
> Much cleaner than forcing setters to return the underlying object.
>
> NOOOOOOOOOOOOOOOOOOOOOOOOOOOO!!!!!

This is about the 16 billionth time someone has suggested "with" as a
solution, and every time I am forced to point out yet again that with()
doesn't cut it.

auto hist = Histogram(someArray, 100)
    .barColor(getColor(255, 0, 0))   // Returns a Histogram
    .toFigure  // Returns a Figure
    .title("A histogram");

Try doing that anywhere near as succinctly with a with statement.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/phobos/attachments/20110421/bf030e5d/attachment.html>


More information about the phobos mailing list