Jump to content

Introspection: Difference between revisions

(Added Kotlin)
Line 905:
 
=={{header|Julia}}==
{{works with|Julia|0.6}}
<lang Julia>julia> VERSION
v"0.3.2"
 
<lang julia>@show VERSION > v"0.3.1"
VERSION < v"0.4" && exit(1)
true</lang>
 
if isdefined(:bloop) && !isempty(methods(abs))
@show abs(bloop)
end
 
a, b, c = 1, 2, 3
vars = filter(x -> eval(x) isa Integer, names(Main))
println("Integer variables: ", join(vars, ", "), ".")
println("Sum of integers in the global scope: ", sum(eval.(vars)), ".")</lang>
 
{{out}}
<pre>VERSION = v"0.6.2"
Integer variables: a, b, c.
Sum of integers in the global scope: 6.</pre>
 
=={{header|Kotlin}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.