Idea: postfix let as basis for postfix macros

Just for fun an experiment what Rust would look like if everything was postfix (in .await style)

rand::Rng.use;
std::cmp::Ordering.use;
std::io.use;

{
    "Guess the number!".println!();

    rand::thread_rng().gen_range(1, 101).let secret_number;

    {
        "Please input your guess.".println!();

        String::new().let mut guess;

        io::stdin()
            .read_line(&mut guess)
            .expect("Failed to read line");

        guess.trim().parse().match {
            Ok(num) => num,
            Err(_) => continue,
        }.let guess: u32;

        "You guessed: {}".println!(guess);

        guess.cmp(&secret_number).match {
            Ordering::Less => "Too small!".println!(),
            Ordering::Greater => "Too big!".println!(),
            Ordering::Equal => {
                "You win!".println!();
                break;
            }
        }
    }.loop;
}.fn main();

loop and fn are absurd, but let isn't as terrible as I thought, and postfix match is actually pretty cool.

6 Likes