Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×

Comment Re:Still 32GB barrier (Score 1) 434

For example, it prevents you from reading a binary object larger than 2^32 into memory for subsequent manipulation or serving up from cache. With modern media files, it's quite possible (and even common) to exceed the 2GB file size limit of 32 bits.

Comment Re:I'm disappointed (Score 1) 434

No, I think we're talking about different things.

With Erlang, any function that matches an argument signature can be passed to a function that can take a lambda. But with Erlang, a given function can take more than one lambda at the same time as an argument. The closest analogy I could think of with the Java approach is to override *multiple* methods with a single lambda specification, not jujst one.

So it's not polymorphic in the sense that I think you're describing. It's just a broader-scoped implementation.

For example, you might define one lambda in Erlang that gets the next value from some abstract container to be defined by the programmer. You might define another lambda to compare elements. The lambda-receiving function sort() accepts both, producing a sorted list based on the arbitrary "key" of the lambdas. I don't see any way of doing that with the Java approach, because there is no way to specify multiple lambda arguments for the implementation of sort().

In "normal" Java you could do it by expecting two interfaces for sort()'s arguments, so perhaps you could then specify lambdas of the interfaces, but I'm not sure. I'm pretty sure Java would mandate that you use classes, not interfaces, which kind of limits the generic approach that Erlang offers.

Comment Re:I'm disappointed (Score 3, Interesting) 434

I think the bigger reason they probably didn't do it is that Erlang only lets you assign a variable once, so there are no concurrency issues with read/write of variables. One of the neat side effects of this is that a service/method which takes a lambda argument can be parallelized behind the scenes without changing the meaning of the code execution.

Another thing that puzzles me is that Java lambdas seem to be based on the idea of overriding a method of a class. That seems to me to be a critically limiting way of implementing them vs. function prototypes/templates, as there is no way to specify multiple lambdas being passed to the evaluator.

Comment I'm disappointed (Score 2) 434

I'm disappointed. I expected Lambda functions to be closer to Erlang's implementation, where you can access the variables of the enclosing function/method safely. But perhaps the examples in the article are just too simplistic to show such behaviour.

Slashdot Top Deals

God help those who do not help themselves. -- Wilson Mizner

Working...