Hacker News new | ask | show | jobs
by cmrdporcupine 1120 days ago
It's horrifying but maybe also intriguing?

Has shades of the OCaml/StandardML "let ... " scope:

StandardML:

  let
    val a = 1
    val b = 2
  in
    a + b
  end
It's nice for making it clear that the scope of the assignment is restricted to this lexical scope, though there are other ways to do this in C/C++.

I work in Rust these days so haven't had a chance to use much of this, but I wonder if this has some nice RAII type use patterns? I may now go explore.