Re: lambda... again



On 23 , 05:22, "slebet...@xxxxxxxxx" <slebet...@xxxxxxxxx> wrote:
Personally I think the [apply] method that we now have in 8.5 is the
way to go. Lambdas are after all merely values. So there is no reason
to treat a lambda as anything other than a string until you want to
use it as a function. So:

We WILL have ;) there's still no release.
At least, I could use this lambda for backward compatibility.
Tcl 8.4 is actual standard now.

The advantage is that unlike the proc work-arounds the apply method
has all the advantages of regular variables: local scope, passable as
first class citizens etc.

The disadvantage is that calling a lambda is different from calling a
regular proc (you need to prepend apply to it). Now... if someone
feels like modifying [unknown] so that lambdas can be called like a
proc..... ;-)

Procs are compiled only once.
And what about apply-lambda?

.



Relevant Pages

  • Re: lambda
    ... I need your help understanding lambda (and doing it a better way ... for fn in fns: ... print "defining fn that returns", ... print "Calling", fn ...
    (comp.lang.python)
  • Re: localizing a sort
    ... You need the lambda to assign both arguments. ... No, your mistake is that you're CALLING locale.strcoll, while as Peter ... That lambda _IS_ superfluous, as Peter said. ...
    (comp.lang.python)
  • Re: lambda... again
    ... I could use this lambda for backward compatibility. ... has all the advantages of regular variables: ... The disadvantage is that calling a lambda is different from calling a ... Procs are compiled only once. ...
    (comp.lang.tcl)
  • Re: functional programming
    ... that Ruby lambdas are not first-class functions (i.e. "The difference ... between lambda and a real first-class function is quite profound"). ... between calling a function foo with a n arguments, ...
    (comp.lang.ruby)
  • Re: lambda... again
    ... proc lambda { ... set name [list lambda $p $b] ... has all the advantages of regular variables: ... The disadvantage is that calling a lambda is different from calling a ...
    (comp.lang.tcl)