austin (Austin Ziegler) wrote in #note-53: > I don't entirely agree. The ambiguity still exists because there is (more or less) an implicit block behaviour. If `_` already exists in the current scope, *both* the use of a pipe operator an...AlexandreMagro (Alexandre Magro)
austin (Austin Ziegler) wrote in #note-50: > As I said, I don't think Ruby needs a pipe operator, but I wonder if a *different* approach might be taken. In irb, `_` is automatically assigned the result of the previous expression (well, ...AlexandreMagro (Alexandre Magro)
lpogic (Łukasz Pomietło) wrote in #note-49: > I wanted _str_, _a_simple_json_ and _a_ to be treated as variables, maybe method arguments but impossible to reduce to one line. If these variables need to be explicit and cannot be reduc...AlexandreMagro (Alexandre Magro)
lpogic (Łukasz Pomietło) wrote in #note-46: > I wonder if the pipeline operator with assignment wouldn't also be useful in everyday code: > ... The pipe operator is well-known, but this type of operation with assignment is something I ...AlexandreMagro (Alexandre Magro)
austin (Austin Ziegler) wrote in #note-40: > Ruby already *has* pipeline-like method, `#then`. If `|>` or `.{}` acts as syntactic sugar for `#then`, I don't see an issue here. If, internally, it’s turned into the effective equivalent o...AlexandreMagro (Alexandre Magro)
lpogic (Łukasz Pomietło) wrote in #note-43: > baweaver (Brandon Weaver) wrote in #note-41: > ... There’s no need for the syntax to take this route; using an explicit variable (last expression result variable "_") provides a clearer and...AlexandreMagro (Alexandre Magro)
mame (Yusuke Endoh) wrote in https://bugs.ruby-lang.org/issues/20781#note-9 at DevMeeting: > AlexandreMagro (Alexandre Magro) wrote in #note-8: > ... Yes, `r |> q |> p` was just an abstract notation to explicitly show the order of meth...AlexandreMagro (Alexandre Magro)
* [Feature #20770] (Re)Introduce pipe operator (AlexandreMagro) * Initially proposed as syntactic sugar for `.then`, and later refined after discussion to work as a statement separator (like `;`) with a variable carrying the LHS expres...AlexandreMagro (Alexandre Magro)
Reflecting on the opposing points raised, I believe the pipe operator could work differently, avoiding the issue of "implicit blocks" mentioned by @zverok. As suggested by @Eregon, translating the operator to local variables reduces t...AlexandreMagro (Alexandre Magro)