if assign / guard ================= Swift has "if let", which makes the identifier accessible only inside the "if" block, which is only entered if the value is not null. Similarly, there is a "guard let", but in that case the value is accessible only in the statements following the "guard". Improvements ------------ "if let" is has a fairly obvious meaning, but type inference does not belong in SLUL, so it should not be copied as-is. "gaurd let", on the other hand, is in my opinion NOT very obvious, and you have to read the manual. SLUL should strive to be as obvious as possible! Syntax 1 -------- if Thing t = get_thing() { t.do_stuff() } require Thing u = get_thing() else { ... } u.do_stuff() Problems: - The else might not be visible if the line is long! - Multiple things may need to be tested! Syntax 2 -------- Thing t = maybe get_thing() else goto fail Thing u = maybe t.other_thing() else goto fail Problems: - What if multiple things can go wrong? Thing t = maybe get_thing().other_thing(a / possibly_zero) else goto fail