Equivalent

LA home
Computing
 Algorithms
 Bioinformatics
 FP,  λ
 Logic,  π
 MML
 Prog.Langs

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
window on the wide world:

Computer Science Education Week

Linux
 Ubuntu
free op. sys.
OpenOffice
free office suite,
ver 3.4+

The GIMP
~ free photoshop
Firefox
web browser
FlashBlock
like it says!

© L. Allison   http://www.allisons.org/ll/   (or as otherwise indicated),
Faculty of Information Technology (Clayton), Monash University, Australia 3800 (6/'05 was School of Computer Science and Software Engineering, Fac. Info. Tech., Monash University,
was Department of Computer Science, Fac. Comp. & Info. Tech., '89 was Department of Computer Science, Fac. Sci., '68-'71 was Department of Information Science, Fac. Sci.)
Created with "vi (Linux + Solaris)",  charset=iso-8859-1,  fetched Sunday, 02-Nov-2014 00:53:50 EST.