All Questions
4 questions
2
votes
0
answers
154
views
Is there an accepted Coding Style for multiple ES6 Arrow Functions?
I'm starting to use ES6 arrow functions more, but haven't found a coding style that I like, especially when chaining them together. e.g., Eric Elliott gives this code:
mix = (...fns) => x => ...
2
votes
2
answers
3k
views
Java - Using a Function variable to set the toString() method's return value
Lately I've started adding this to certain classes in an in-house API:
public class MyClass {
// I usually do this with classes I expect to
// be printed out or tested a lot (particularly
// ...
0
votes
2
answers
146
views
Iterating a function with a static argument: Global functions + lambdas vs internal function?
I am never sure which of these is better form:
Option A
def a(x,y):
def b(z): return z+y
return map(b, x)
print a([10,20], 5)
Option B
def b(z,y): return z+y
def a(x,y):
return map(...
5
votes
3
answers
2k
views
What can procs and lambdas do that functions can't in ruby
I've been working in Ruby for the last couple weeks, and I've come to the subject of procs, lambdas and blocks. After reading a fair share of examples from a variety of sources, I don't how they're ...