diff options
author | Ratan <ratan.r.sur@gmail.com> | 2015-10-10 12:10:27 -0400 |
---|---|---|
committer | Ratan <ratan.r.sur@gmail.com> | 2015-10-10 12:10:27 -0400 |
commit | 77f0219cc6fd64f9c4dbd3007fa395b2242a6e49 (patch) | |
tree | cf6fdb7e322a16c44d8bf62e655bdb474d71de38 /julia.html.markdown | |
parent | d8a1c0cf6a224d7b6e68f06afd444ba24bd75ede (diff) |
change String to AbstractString as per 0.4 spec
Diffstat (limited to 'julia.html.markdown')
-rw-r--r-- | julia.html.markdown | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/julia.html.markdown b/julia.html.markdown index 66329feb..7ca2d492 100644 --- a/julia.html.markdown +++ b/julia.html.markdown @@ -78,7 +78,7 @@ false 1 < 2 < 3 # => true 2 < 3 < 2 # => false -# Strings are created with " +# AbstractStrings are created with " "This is a string." # Character literals are written with ' @@ -314,7 +314,7 @@ end # For loops iterate over iterables. -# Iterable types include Range, Array, Set, Dict, and String. +# Iterable types include Range, Array, Set, Dict, and AbstractString. for animal=["dog", "cat", "mouse"] println("$animal is a mammal") # You can use $ to interpolate variables or expression into strings @@ -550,13 +550,13 @@ super(Any) # => Any # <: is the subtyping operator type Lion <: Cat # Lion is a subtype of Cat mane_color - roar::String + roar::AbstractString end # You can define more constructors for your type # Just define a function of the same name as the type # and call an existing constructor to get a value of the correct type -Lion(roar::String) = Lion("green",roar) +Lion(roar::AbstractString) = Lion("green",roar) # This is an outer constructor because it's outside the type definition type Panther <: Cat # Panther is also a subtype of Cat |