|
|
|
|
|
by xorcist
315 days ago
|
|
"Essentially the same thing" as a shell pipe, except each function run sequentially in full, keeping output in a variable. So nothing like a shell pipe. For short constructions '$out = sort(fn($in)' is really easier to read. For longer you can break them up in multiple lines. $_ = fn_a($in)
$_ = fb_b($_)
$out = fn_c($_)
Is it really "cognitive overhead" to have the temporary variable explicit? Being explicit can be a virtue. Readability matters in a programming language. If nothing else I think Python taught us that.I am skeptical to these types of sugar. Often what you really want is an iterator. The ability to hide that need carries clear risk. |
|