September Morn Update
This commit is contained in:
parent
4e2d22a71d
commit
aac6731f2c
6856 changed files with 141342 additions and 21127 deletions
12
Task/Scope-modifiers/Julia/scope-modifiers.julia
Normal file
12
Task/Scope-modifiers/Julia/scope-modifiers.julia
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
julia> function foo(n)
|
||||
x = 0
|
||||
for i = 1:n
|
||||
local x # introduce a loop-local x
|
||||
x = i
|
||||
end
|
||||
x
|
||||
end
|
||||
foo (generic function with 1 method)
|
||||
|
||||
julia> foo(10)
|
||||
0
|
||||
29
Task/Scope-modifiers/Pascal/scope-modifiers.pascal
Normal file
29
Task/Scope-modifiers/Pascal/scope-modifiers.pascal
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
procedure super;
|
||||
var
|
||||
f: boolean;
|
||||
|
||||
procedure nestedProcedure;
|
||||
var
|
||||
c: char;
|
||||
begin
|
||||
// here, `f`, `c`, `nestedProcedure` and `super` are available
|
||||
end;
|
||||
procedure commonTask;
|
||||
var
|
||||
f: boolean;
|
||||
begin
|
||||
// here, `super`, `commonTask` and _only_ the _local_ `f` is available
|
||||
end;
|
||||
var
|
||||
c: char;
|
||||
|
||||
procedure fooBar;
|
||||
begin
|
||||
// here, `super`, `fooBar`, `f` and `c` are available
|
||||
end;
|
||||
var
|
||||
x: integer;
|
||||
begin
|
||||
// here, `c`, `f`, and `x`, as well as,
|
||||
// `nestedProcedure`, `commonTask` and `fooBar` are available
|
||||
end;
|
||||
Loading…
Add table
Add a link
Reference in a new issue