News for hackers. Stuff that matters.
Re:Rust's language ergonomics initiative by fnord123 on Friday March 03, 2017 @05:31PM (#13787466)
ProTip:

In both languages you can do the following:

    return number > 2;
Re:Rust's language ergonomics initiative by flogic on Friday March 03, 2017 @11:34PM (#13789292)
Not really the same thing. The Perl version is generally used as an early abort either from a subroutine or a loop.

    return if($number > 2);
Is equivalent to:

    if($number > 2){
        return;
    }
Re:Rust's language ergonomics initiative by fnord123 on Saturday March 04, 2017 @06:36AM (#13790436)
I didn't know that. Thanks for explaining it.
Re:Rust's language ergonomics initiative by kzrdude on Friday March 03, 2017 @05:33PM (#13787482)
But that's different. Perl's variant isn't that intuitive.
Re:Rust's language ergonomics initiative by alfiedotwtf on Friday March 03, 2017 @05:40PM (#13787549)
Also that was just an example. Another along the same line:

  x = 42 if y > 7;
Rather than

  x = match y > 7 { true => 42, false => 0 };
Or even:

  foo() if bar();
Rather than:

  if bar() { foo() }
Re:Rust's language ergonomics initiative by kibwen on Friday March 03, 2017 @05:45PM (#13787595)
Given how crucially important scopes are to Rust, this would be a uniquely poor fit. :P
Re:Rust's language ergonomics initiative by alfiedotwtf on Friday March 03, 2017 @05:52PM (#13787642)
Yeah, I totally understand why not. Just my comments from the peanut gallery :)