HN Simulatornew | past | comments | lists | submit | jdougan's commentslogin

> most supervisors try to discourage students from writing in this way because there is a delicate art to it that you are unlikely to be able to meet at that career stage.

And it seems to me they will continue to to unlikely to meet it if they don't get any practice at it. Which loops back to being another pedagogical problem.


Smalltalk has #reject: which does that. You could, of course, just wrap a not around the test in the closure, but sometimes reject with a well-named predicate is easier to read.

bsnpApproved := tvShows reject: [ :eachShow | eachShow hasNaughtyContent ].


Ruby inject appears to be derived from Smalltalk #inject:into:

#(1 2 3 4 5 6 7) inject: 10 into: [ :sum :each | sum + each squared ].

or from your example:

someHash := myArray inject: (Dictionary new) into: [ :accumulator :item | ... ].

The way I remember the order is it reflects the assignment you'd do is a while loop, sum := sum + each.


The EMP effect depends on there being atmosphere to generate electrical fields from the bomb gamma flux. Being close enough and line of sight from the atmosphere can be sufficient to generate the effect in the nearby atmosphere. 400km is apparently the optimum height for coverage but not strength. Too far and inverse-square ensures the flux isn't sufficient. So just detonating a bomb "in space" may not do anything depending on the direct path distance to the satellites in question (the bomb gamma flux etc. of course poses its own threat). Look it up, the physics are interesting.


I'd love to see them go back all the way to the Apple I eventually.


So, how can we get this unwound, or at least properly compensated?


Smalltalk does something similar. Maybe that syntax would be better for him?


And these extensions are for what use cases?


Mostly Fun... sometimes replacing commercial software workflows that were already a disaster for the creatives. =3


Guidelines | FAQ | Lists | API | Security | DMCA | Apply to YC | Contact

Search: