Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sequential In-Line Function Calls
Message
From
01/05/2011 06:20:59
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01508815
Message ID:
01508927
Views:
53
>I've been dabbling in different languages lately (Python, Ruby on Rails, C#, etc.) and one thing I found that I really like with Ruby is the sequential in-line function calls.
>
>In VFP we work inside out which isn't easy to read:
>
myudf(padr(trim(str(lnVariable)),10))
>
>In Ruby (using VFP methods) the same thing would be like this:
>
lnVariable.str().trim().padr(10).myudf()
>
>The sequential way is SO much more readable. Here's my question. Generically, what do you call this difference/paradigm (as I'm sure it's not called Sequential In-Line Function Calls) ?

In jQuery, this is called chaining, but the meaning is different. The jQuery generally returns an object or a collection of objects. A function then operates on this object or collection, returning the same object (if it did something to it), or a different object (if it's a filter or other kind of selector). So this object returned is then passed to the next function (or we could say it's a method call, because these functions are methods of these objects).

So, not sure whether chaining would apply to your Ruby example, as the semantic is different.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform