diff options
-rw-r--r-- | julia.html.markdown | 15 | ||||
-rw-r--r-- | latex.html.markdown | 2 | ||||
-rw-r--r-- | typescript.html.markdown | 4 |
3 files changed, 11 insertions, 10 deletions
diff --git a/julia.html.markdown b/julia.html.markdown index 69b6aa0c..eabb988e 100644 --- a/julia.html.markdown +++ b/julia.html.markdown @@ -93,21 +93,22 @@ ascii("This is a string")[1] # Julia indexes from 1 # Otherwise, iterating over strings is recommended (map, for loops, etc). +# String can be compared lexicographically +"good" > "bye" # => true +"good" == "good" # => true +"1 + 2 = 3" == "1 + 2 = $(1 + 2)" # => true + # $ can be used for string interpolation: "2 + 2 = $(2 + 2)" # => "2 + 2 = 4" # You can put any Julia expression inside the parentheses. +# Printing is easy +println("I'm Julia. Nice to meet you!") # => I'm Julia. Nice to meet you! + # Another way to format strings is the printf macro from the stdlib Printf. using Printf @printf "%d is less than %f\n" 4.5 5.3 # => 5 is less than 5.300000 -# Printing is easy -println("I'm Julia. Nice to meet you!") # => I'm Julia. Nice to meet you! - -# String can be compared lexicographically -"good" > "bye" # => true -"good" == "good" # => true -"1 + 2 = 3" == "1 + 2 = $(1 + 2)" # => true #################################################### ## 2. Variables and Collections diff --git a/latex.html.markdown b/latex.html.markdown index 874efeeb..c980f5e5 100644 --- a/latex.html.markdown +++ b/latex.html.markdown @@ -95,7 +95,7 @@ to the source code. Separate paragraphs by empty lines. -You need to add a dot after abbreviations (if not followed by a comma), because otherwise the spacing after the dot is too large: +You need to add a backslash after abbreviations (if not followed by a comma), because otherwise the spacing after the dot is too large: E.g., i.e., etc.\ are are such abbreviations. \section{Lists} diff --git a/typescript.html.markdown b/typescript.html.markdown index 6feaca45..ba4a9e71 100644 --- a/typescript.html.markdown +++ b/typescript.html.markdown @@ -203,8 +203,8 @@ p1.age = 25; // Error, p1.x is read-only var p2 = { name: "John", age: 60 }; var p3: Person = p2; // Ok, read-only alias for p2 -p3.x = 35; // Error, p3.x is read-only -p2.x = 45; // Ok, but also changes p3.x because of aliasing +p3.age = 35; // Error, p3.age is read-only +p2.age = 45; // Ok, but also changes p3.age because of aliasing class Car { readonly make: string; |