Like English?since
Like English?since
Looking at that makes me realize how far I have to go before I fully understand python.So, I need help with some intense Python shiz. Links, AWAY!
http://stackoverflow.com/questions/29422776/use-2-strings-to-call-function-x-from-module-y
yeah. That is a core concept of FPWell, my problem was fixed. Apparently since functions are also variables, they can be passed as such between functions
So Ruby isn't a "true" FP language?yeah. That is a core concept of FP
Wait...ruby has first class functions...right...right?So Ruby isn't a "true" FP language?
Although there are a ton of ways that this is alleviated, like with blocks/lambdas/procs, but still having first-class functions would be really niceOh they're not, bummer
Technically, the order of succession is block/proc/lambda.Although there are a ton of ways that this is alleviated, like with blocks/lambdas/procs, but still having first-class functions would be really nice
actually method :method_name does itTechnically, the order of succession is block/proc/lambda.
Blocks are just that - blocks of code.
Procs are blocks stored in variables. So technically a Proc is a function in a true FP language.
Lambdas are Procs, except with Procs extra arguments are set to nil, with Lambdas the argument count is checked and errors are raised if you call one with the wrong amount. In addition, Lambdas will simply return the object (well, reference) once called, while Procs will also have the parent method return the same thing as the Proc.
Altogether, if you're looking for a method stored in a variable, Lambdas are the way to go in Ruby.
EDIT: Fixed a typo; added a period.
Defined in same file as a Proc, so you could consider a method a block bound to a name, I guess?actually method :method_name does it
not as far as LISP Also, no actual first-class functions is badDefined in same file as a Proc, so you could consider a method a block bound to a name, I guess?
...Ruby takes the principle "code is data" very far.