This commit is contained in:
Ingy döt Net 2013-06-05 21:47:54 +00:00
parent 1f1ad49427
commit 6f050a029e
2496 changed files with 37609 additions and 3031 deletions

View file

@ -0,0 +1,9 @@
julia> t = true
true
julia> typeof(t)
Bool
julia> if 1
println("true")
end
ERROR: type: non-boolean (Int64) used in boolean context

View file

@ -0,0 +1,13 @@
julia> bool
# methods for generic function bool
bool(x::Bool) at bool.jl:9
bool(x::Number) at bool.jl:10
bool(x::AbstractArray{Bool,N}) at abstractarray.jl:219
bool(x::AbstractArray{T,N}) at abstractarray.jl:220
julia> bool(-2:2)
5-element Bool Array:
true
true
false
true
true

View file

@ -0,0 +1,5 @@
TRUE print
FALSE print
2 1 > print # TRUE (-1)
3 2 < print # FALSE (0)
42 FALSE != # TRUE (-1)