Jump to content

Pointers and references: Difference between revisions

added standard ml
(fortran (+ lang tag here and there))
(added standard ml)
Line 546:
[Note: in some ways this task is meaningless for Python given the nature of its "variable" binding semantics].
 
=={{header|Standard ML}}==
 
Like OCaml, Standard ML doesn't have pointers but have a "ref" mutable data structure which is the basis of mutability in Standard ML:
 
<lang sml>
val p = ref 1; (* create a new "reference" data structure with initial value 1 *)
val k = !p; (* "dereference" the reference, returning the value inside *)
p := k + 1; (* set the value inside to a new value *)
</lang>
 
=={{header|Tcl}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.