Last active
February 26, 2019 02:15
-
-
Save haigopi/af13b3e5384c3cc2e63c4152be75020d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#= | |
ModuleCaller: | |
- Julia version: 1.1.0 | |
- Author: GOPI K KANCHARLA | |
- Date: 2019-02-25 | |
=# | |
module Bar | |
x = 1 | |
foo() = x | |
end | |
import .Bar | |
x = 10; | |
println(Bar.foo()) | |
for i in 1:10 | |
z = Bar.foo() | |
end | |
for i = 1:10 | |
z = i | |
global z | |
end | |
x, y = 0, 1 | |
for i = 1:10 | |
x = i + y + 1 | |
end | |
println(x) | |
x = 1; | |
function foobar() | |
global x = 2 | |
end; | |
println(x) | |
local x::Int8 | |
function plus(x::Int, y::Int) | |
x + y | |
end | |
mutable struct Foo{T} | |
bar | |
baz::T | |
qux::T | |
end | |
foo = Foo("Hello, world.", 23, 1.5) | |
foo.bar = "TEST" | |
println(foo.bar) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment