Enforced immutability: Difference between revisions

added Fortran
(added Fortran)
Line 302:
constant s = {1,2,3}
constant str = "immutable string"</lang>
 
=={{header|Fortran}}==
{{works with|Fortran|90 and later}}
In type declaration statements a PARAMETER attribute can be specified turning the data object into a named constant.
<lang fortran>real, parameter :: pi = 3.141593</lang>
Dummy arguments of procedures can be given an INTENT attribute. An argument with INTENT(IN) cannot be changed by the procedure
<lang Fortran>subroutine sub1(n)
real, intent(in) :: n</lang>
 
=={{header|F#}}==
179

edits