Undocumented method of chaining functions?

philmasterplus

Active member
I was looking at the source of Zlib for coding lessons when I read:
Code:
str.contains_text( another_str )
I was intrigued to find that a similar syntax could be applied to other functions, especially custom ones:
Code:
<return type> function_name( type1 var1, type2 var2, ... )
var1.function_name( type2 var2, ... )
My poor forum searching skills yielded no information about this. Is this an unreliable or official feature? Because I'd like to add this to the KoLmafia wiki.
 
Last edited:

Bale

Minion
Official feature. It probably should be listed on the wiki.

Any function can be called "java style" as var1.function_name( var2, var3, ... )
 

StDoodle

Minion
Yeah, I pestered Bale about this one a while back. I thought it had been added in somewhere, but it appears not. I'll try to get it here if no one beats me to it.
 

heeheehee

Developer
Staff member
Wasn't really a ninja, per se -- I added it as a result of this thread (more specifically, StD's response).
 

Bale

Minion
You slipped in and posted quietly before anyone else could respond. That's a ninja. :p Just accept it.
 

zarqon

Well-known member
Hmmm yes. Or "Here, there, everywhere."

Those FN ninjas
Posting secretly by night
Here, there, everywhere
 
Top