--
Did you find this reply useful? Help the Railo community and add it to the Railo Server wiki at https://github.com/getrailo/railo/wiki
---
You received this message because you are subscribed to the Google Groups "Railo" group.
To view this discussion on the web visit https://groups.google.com/d/msgid/railo/367a6783-c9ba-45b1-9324-8492ff7ecf57%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Micha
component {
public Any function init(){
instance.member = [];
for( counter in [1,2,3] )
instance.member[ counter ] = function() { dump( counter ); }
return this;
}
public any function getMember( idx ){
return instance.member[ arguments.idx ];
}
}
obj = new Test();
firstMember = obj.getMember( 1 );
secondMember = obj.getMember( 2 );
thirdMember = obj.getMember( 3 );
firstMember(); // return 3
secondMember(); // return 3
thirdMember(); // return 3
Hi,
This presentation from Adam Tuttle is a pretty good explanation for clousure.
--
Did you find this reply useful? Help the Railo community and add it to the Railo Server wiki at https://github.com/getrailo/railo/wiki
---
You received this message because you are subscribed to the Google Groups "Railo" group.
To view this discussion on the web visit https://groups.google.com/d/msgid/railo/a719cedb-3788-40f3-8e3c-ed3110871a91%40googlegroups.com.