1,769 karma · joined November 11, 2014
Ah I see, you’re saying that the construction of a list in F# mandates a lambda, thereby reducing one possible point of confusion. I could agree with that. But then it comes at a cost of comfort: [0]*4 has less boilerplate than the F# version. So it comes down to trade-offs again.
[list() for _ in range(4)]> In more sane languages, the expression [] means give me an empty list value, nothing more and nothing less
What is a “list value”? It’s either a pointer to some other space where the lists values are stored, or it’s the values stored themselves. If you say it’s the second (I can’t think of any language that does), then `a = […]; b = a` is an expensive copy by value assignment. Is that worth that trade off to get less surprising results in the articles case? I’m not saying the answer is “obviously no”, but it definitely isn’t “obviously yes”.
> In more sane languages, the expression [] means give me an empty list value, nothing more and nothing less
What is an “empty list value”?
> the potential to produce surprising results
That’s actually the big reason for that capability. If you do
let result: Result<_,!> = …
let ok(fine) = result
, if result ever changes from infallible to fallible, you get a compile error rather than the runtime error you would get with unwrap. In fact, when looking it up, it turns out that specific case was a big part of the motivation for the “!” type in the first place! I think the above code probably compiles in nightly because of that. fn infallible() -> Result<u8, !>{
Ok(1)
}
fn match_infallible(){
let Ok(x) = infallible();
}
The compiler here knows the `infallible` function will always return an `Ok` because of the return type. Here you could just `unwrap` the result, but what if it was inside a tuple, or something similar?Whereas APL fans will insist it’s not hard while listing no benefits besides dense code.
And if you had a toggle-able mode, you could still have your code golf.
The fact that nobody selling me on these arcane runes talks about something like that tells me it’s more about code golf for them.
> …written in Rust, addressing a challenge in real-world use of logic programming languages: the fact that logical programs are parts of bigger software systems and need to interoperate with other components written in imperative programming languages.
That gyroscopic effect of the wheel works well when the whole device is wheel (think hoop rolling), but when you start adding weight that's not spinning (like someone riding a scooter), the effect falls off.
Edit: it seems that neither the gyroscopic effect nor rake are sufficient to explain bicycles' self-stability: https://en.wikipedia.org/wiki/Two-mass-skate_bicycle
1) We are happy to have the government intervene in other cases for the sake of children; I would be pretty upset at any politician who espoused removing age restrictions on cigarettes. I don’t know that social media is as bad but it certainly has some of the addictive properties
2) An argument from tragedy of the masses: if all kids’ social lives currently revolve around social media, unilaterally disallowing one child to use it could result in alienation from their peer group, which might be worse for the kid than social media. A government mandate would remove this issue.
My theory is that Waze must model what maneuvers are possible/easy based on other drivers in the area. So if you live in an area with more aggressive drivers it assumes those maneuvers are easier to do.