$arr
|> fn($x) => array_column($x, 'tags')
Why doesn't this work? $arr
|> array_column(..., 'tags')
And when that doesn't work, why doesn't this work? $arr
|> array_unique91–100 of 282 posts
$arr
|> fn($x) => array_column($x, 'tags')
Why doesn't this work? $arr
|> array_column(..., 'tags')
And when that doesn't work, why doesn't this work? $arr
|> array_uniqueC'mon Dart! Follow up please. Go is a lost cause...
I feel like a kindergartener writing go. I wish another language got popular in the space go is used for.
For example ktor (one of the server frameworks) can actually work with Kotlin native but it's not that well supported. This is not using Graal or any of the JVM stuff at runtime (which of course is also a viable path but a lot more heavyweight). With Kotlin native, the Kotlin compiler compiles directly to native code and uses multiplatform libraries with native implementations. There is no Java standard library and none of the jvm libraries are used.
The same compiler is also powering IOS native with Compose multiplatform. On IOS libraries are a bit more comprehensive and it's starting to become a proper alternative to things like flutter and react native. It also has pretty decent objectc and swift integration (both ways) that they are currently working on improving.
In any case, it's pretty easy to write a command line thingy in Kotlin. Use Klikt or similar for command line argument parsing.
Jetbrains seems to be neglecting this a bit for some reason. It's a bit of a blind spot in my view. Their wasm support has similar issues. Works great in browsers (and supported with compose as well) but it's not a really obvious choice for serverless stuff or edge computing just yet; mainly because of the library support.
Swift is a bit more obvious but has the issue that Apple seems to think of it as a library for promoting vendor lockin on their OS rather than as a general purpose language. Both have quite a bit of potential to compete with Go for system programming tasks.
I'm surprised that the example requires lambdas... What's the purpose of the `|> foo(...)' syntax if the function has to take exactly one operand? Why is it necessary to write this? $arr |> fn($x) => array_column($x, 'tags') Why doesn't this work? $arr |> array_column(..., 'tags') And when that doesn't work, why doesn't this work? $arr |> array_unique
They write that elixir has a slightly fancier version, it is likely around this, they mean (where elixir has first class support for arity > 1 functions)
This will be the year of PHP. People are tired of JS.
I'm surprised that the example requires lambdas... What's the purpose of the `|> foo(...)' syntax if the function has to take exactly one operand? Why is it necessary to write this? $arr |> fn($x) => array_column($x, 'tags') Why doesn't this work? $arr |> array_column(..., 'tags') And when that doesn't work, why doesn't this work? $arr |> array_unique
It is to interject the chained value at the right position in the function. They write that elixir has a slightly fancier version, it is likely around this, they mean (where elixir has first class support for arity > 1 functions)
Earlier quoted context omitted.
One can construct English sentences in the opposite order. There is no singular "English sentence order". "Filter for this function in this array" "Map over this array with this function"
Right, but these are both more unwieldy. One filters something with something else, in the real world. Filter water with a mesh etc. And (in maths, at least) one maps something onto something else. (And less commonly one maps an area onto paper etc.) Just because you can make your two sentences does not make them natural word order.
Yes, but that's the opposite of what you said earlier. You might map x onto 2*x, for example. Or, if you're talking about a collection, you might map the integers 0..10 on to double their value. Data first, then the way you're manipulating it. I'm a mathematician and this is what makes sense to me.
I would only say "map this function..." if the function itself is being manipulated somehow (mapped onto some other value).
Earlier quoted context omitted.
I don't see how this is hard to reason about, assuming this is the resulting code when using variables: $tags = ...array_column($arr, 'tags'); $merged_tags = array_merge($tags); $unique_tags = array_unique($merged_tags); $tag_values = array_values($unique_tags); It also makes it easier to inspect the values after each step.
I don't think inspecting this is easier than adding |> IO.inspect() to a pipe chain
Why not just make types psuedo-objects? $myString.trim().replace("w", "h"); Which has the advantage of also offering a clean alternative to the fragmented stdlib.
With this sort of "just" I could build Paris out of matchsticks
Earlier quoted context omitted.
Nothing is really needed, C89 was good enough. Dots are not the same, nobody wants to use chaining like underscore/lodash allowed because it makes dead code elimination impossible.
K&R C was good enough for UNIX System V, why bother with C89.