Omissible Parentheses...

Chad J chadjoan at __spam.is.bad__gmail.com
Sun Aug 2 08:05:58 PDT 2009


Denis Koroskin wrote:
> On Sun, 02 Aug 2009 18:30:33 +0400, Chad J
> <chadjoan at __spam.is.bad__gmail.com> wrote:
> 
>> KennyTM~ wrote:
>>> Chad J wrote:
>>>> Robert Jacques wrote:
>>>>> On Sat, 01 Aug 2009 16:00:52 -0400, Michiel Helvensteijn
>>>>> Nope. I meant _function_ chaining. This comment comes mostly from
>>>>> using
>>>>> std.string and std.algorithm, whose functions don't behave as fields.
>>>>> Both of these libraries show off the power you get from the
>>>>> flexibility
>>>>> of function call / property duality. I've also used toggle/flag
>>>>> setting
>>>>> methods in this way. It's concise, clean and very understandable.
>>>>>
>>>>
>>>> Interesting.  I don't think I've seen this angle yet.
>>>>
>>>> Could you provide code examples, please?
>>>
>>> "<p>yes?</p>".replace("<", "&lt;").replace(">", "&gt;");
>>
>> I'm not seeing the use of function/property duals or the lack of
>> parentheses.  Am I missing it?
>>
>> (To be clear, I am not looking for an example of function chaining.  I'd
>> like to see why function/property duals are useful for function
>> chaining.)
> 
> Stdout("Hello, World!").newline.newline.newline;

Thanks



More information about the Digitalmars-d mailing list