Skip to content

Commit

Permalink
1000 fns might not be the best idea
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Lonsdorf committed Apr 3, 2014
1 parent 45734ba commit 6af91c5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lenses.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ var _K = function(x) { return function(y) { return x; } }

, _IntLenses = (function() {
var list = [];
for (var i = 0; i < 1000; i++) {
for (var i = 0; i < 10; i++) {
list[i] = _intIndexedLens(i);
}
return list;
Expand Down

3 comments on commit 6af91c5

@vendethiel
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then again, we're back to what I actually wanted to change : being bound to an arbitrary number.
I agree "num" wasn't the best name, but it didn't create 1000/10 functions for each lenses you wanted to create, and allowed arbitrary numbers :)

@DrBoolean
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Arg, I got turned around with this with the sexy syntax of L[n].

Since js doesn't allow for something like "method missing" everywhere, we're stuck with the eager arbitrary number with this style.

I'll recover num(). Good catch!

Btw, I'm fine with num, but I'm open to new ones. Perhaps Lens.idx(n) ?

@vendethiel
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think idx makes more sense.

Please sign in to comment.