Logo

dev-resources.site

for different kinds of informations.

A short note on lexical scope

Published at
12/11/2020
Categories
standardml
Author
ananthp
Categories
1 categories in total
standardml
open
Author
7 person written this
ananthp
open
A short note on lexical scope
(* standard ml *)
val x = 10
fun foo () = x
val result1 = foo ()      (* 10 *)
val x = 20
val result2 = foo ()      (* still 10 *)
Enter fullscreen mode Exit fullscreen mode

Run on sosml.org

Featured ones: