Equivalent

LA home
Computing
Prog.Lang
 Glossary
  Block str.
  Equiv

SML

The SML equivalent of the imperative block-structured [example]:

let                   --lex level 1
  val v1=...;            --level 1 obj 1
  val v2=...;            --level 1 obj 2

  fun A() =              --level 1 obj 3
    
let               --lex level 2
  val v3=...;        --level 2 obj 1

  fun B() =          --level 2 obj 2
    
let            --lex level 3
  val v4=...;     --level 3 obj 1
in ...
end{B}
in B() --call B end{A};
fun C() = --level 1 obj 4
    
let               --lex level 2
  val v5=...;        --level 2 obj 1

  fun D() =          --level 2 obj 2
    
let            --lex level 3
  val v6=...;     --level 3 obj 1
in A()         --call A
end{D}
in D() --call D end{C}
in C() --call C end
-- LA, CS UWA
www:

↑ © L. Allison, www.allisons.org/ll/   (or as otherwise indicated).
Created with "vi (Linux)",  charset=iso-8859-1,   fetched Saturday, 17-Aug-2019 21:50:47 EDT.

Free: Linux, Ubuntu operating-sys, OpenOffice office-suite, The GIMP ~photoshop, Firefox web-browser, FlashBlock flash on/off.