Jump to content

Scope modifiers: Difference between revisions

m (→‎{{header|REXX}}: added comment about names of subroutines. -- ~~~~)
Line 167:
Variables in Ela are lexically scoped (pretty similar to Haskell) and can be declared using let/in and where bindings. Additionally Ela provides a 'private' scope modifier for global bindings:
 
<lang ela>let private pi = 3.14159
pi # private
pi = 3.14159
 
sum # private
let private sum x y = x + y</lang>
 
Names declared with 'private' modifier are not visible outside of a module. All other bindings are visible and can be imported. It is an error to use 'private' modifier on local bindings.
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.