I want to use a function like method in an OOP programming.
If there is a list which is named k, then I want to have a list like
k={1,3,4,a,whatever,f[x_String]:=Print[x<>"Samy"]}
k[[5]]["Hello, "]
The result I expect from the last input above is "Hello, Samy". The point is whether it is possible to deal with functions as elements in a list so that we can get the ability of OOP's method features.
Thanks. :)