add apply() for statements
Merge pull request #1814 from WalterBright/addsapply

add apply() for statements