In “Await Syntax Discussion Summary” it was proposed to allow keywords to be used after . , for example:

await future match foo { ... } // will be equivalent to future.await foo.match {...}

Personally I am not fond of using . in such way, partially because it’s too similar to magic attributes and I think will be quite confusing for newcommers. But the idea on another hand is quite appealing. So how about introducing sigil for pipelining which (eventually) will work with keywords (accepting one expresion), functions and macros? Unfamiliar sigil will cause unfamiliar with the feature to learn about it, thus making it less confusing.

Let’s use @ for examples (open to bikeshedding):

let data = await connection.get(); data .unwrap() .iter() .filter(|v| { ... }) .nth(3) @match { ... }; .is_none() @if { ... } let data = connection .get_header() @await? .get_body()? @await .unwrap(); // assuming generators will have resume with arguments let val = value @yield .process() @yield; // equivalent to let t = yield value; let value = yield t.process();

foo(24, bar(baz(data), 42)); // equivalent to let res = data@baz@bar(42)@|x| foo(24, x); // this functionality will effectively give us postfix macros "Result: {}"@format!(res); res@assert_ne!(None); res @refine @dbg! @Into::into @check? @db.save? // `db` is a value which has `save` method .stats() @return;

Previously several pipilining proposals were posted (1, 2), but they haven’t found much traction. But maybe such generalization will be more successful?

UPD: Translation of real-life code taken from await-syntax: