Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Understanding a Python Closure Oddity. Parent comment
foreach my $x (@input) { push @callbacks, sub { $x }; }
I was spoiled by this and driven nuts by function level scoping like python's and javascript's 'var', and the adoption of 'let' made me very happy.
My current annoyance with JS is its lack of -
my $foo = do { ...; ...; <expression> };
Note that I know:
let foo; { ...; ...; foo = <expression> }
There are no comments on this comment yet.
I was spoiled by this and driven nuts by function level scoping like python's and javascript's 'var', and the adoption of 'let' made me very happy.
My current annoyance with JS is its lack of -
but there's a proposal for that, and the 'match' proposal (which would be glorious) depends on it on the basis it's a shoo-in, so I am very hopeful.Note that I know:
already works but it's Not The Same (although significantly less upsetting than (() => { ... })() is ;).