lambda-functions

Theoretical Basics of Lambda Functions

Hi all, I was just wondering where I could find some language-agnostic tutorials for what lambda functions are, what their use is, and rough equivalents in languages that don't support them. I would especially love any information on common notations. Thanks! Please let me know if I can elaborate on this at all. EDIT: Oh hey I forgot...

PHP: passing a function with parameters as parameter

Hey, I'm not sure that silly question, but I ask: So, if there is an anonymous function I can give it as another anonymous functions parameter, if it has been already stored a variable. But, whats in that case, if I have stored only one function in a variable, and add the second directly as a parameter into it? Can I add parameters to t...

How to convert comma-separated key value pairs into a dictionary using lambda functions

I'm having a little problem figuring out lamba functions. Could someone show me how to split the following string into a dictionary using lambda functions? fname:John,lname:doe,mname:dunno,city:Florida Thanks ...

Why is param in this lambda expression?

The MSDN magazine article by Josh Smith on MVVM contains a lambda expression I don't completely understand. What is the purpose of param in this code? _saveCommand = new RelayCommand(param => this.Save(), param => this.CanSave ); Translated to my preferred language VB it's: Dim saveAction as New Action(Of Object)(Addr...

JS λ-functions & "upper context" variables

Say I have some context where variables are set and a λ-function is called which uses them directly: function outerContext(){ ... var data = ...; // some data the script uses ... someObject.method = function(){ data; // the variable is used here }; ... } I know that the dynamically created funct...

How to kick-ass pass scope through "setInterval"

Dear Masterminds, I'm currently wondering if there is a better solution than passing this scope to the lambda-function via the parameter 'e' and then passing it to 'funkyFunction' using call()-method setInterval(function(e){e.funkyFunction.call(e)}, speed, this) (Minor question aside: I'd been reading something about memory-leaks in ...

Ruby: Can lambda function parameters have default values?

I want to do something similar to this: def creator() return lambda { |arg1, arg2 = nil| puts arg1 if(arg2 != nil) puts arg2 end } end test = creator() test('lol') test('lol', 'rofl') I get a few syntax errors: test.rb:2: syntax error re...