From 985d23a52b76593a120adff5381c2df3a80fe298 Mon Sep 17 00:00:00 2001 From: HairyFotr Date: Wed, 23 Aug 2017 10:14:39 +0200 Subject: Fix a bunch of typos --- nim.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'nim.html.markdown') diff --git a/nim.html.markdown b/nim.html.markdown index 5d00304d..07674532 100644 --- a/nim.html.markdown +++ b/nim.html.markdown @@ -76,7 +76,7 @@ let myDrink = drinks[2] # static typing powerful and useful. type - Name = string # A type alias gives you a new type that is interchangable + Name = string # A type alias gives you a new type that is interchangeable Age = int # with the old type but is more descriptive. Person = tuple[name: Name, age: Age] # Define data structures too. AnotherSyntax = tuple @@ -109,7 +109,7 @@ when compileBadCode: type Color = enum cRed, cBlue, cGreen - Direction = enum # Alternative formating + Direction = enum # Alternative formatting dNorth dWest dEast -- cgit v1.2.3 From 5bbb8ef6cd315e0a1d6373f878f66146ba4ef938 Mon Sep 17 00:00:00 2001 From: Keith Miyake Date: Thu, 19 Oct 2017 23:07:29 -0700 Subject: [nim/en] Add multi-line comments --- nim.html.markdown | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'nim.html.markdown') diff --git a/nim.html.markdown b/nim.html.markdown index 07674532..30dfa94f 100644 --- a/nim.html.markdown +++ b/nim.html.markdown @@ -12,6 +12,25 @@ that gives the programmer power without compromises on runtime efficiency. Nim is efficient, expressive, and elegant. ```nim +# Single-line comments start with a # + +#[ + Multi-line comments begin with a #[ + ... and end with ]# + +They don't care about indentation + + #[ + and they can be nested + ]# + +]# + +discard """ +This can also work as a multiline comment. +Or for unparsable, broken code +""" + var # Declare (and assign) variables, letter: char = 'n' # with or without type annotations lang = "N" & "im" @@ -35,10 +54,6 @@ when compileBadCode: # `when` is a compile time `if` discard 1 > 2 # Note: The compiler will complain if the result of an expression # is unused. `discard` bypasses this. -discard """ -This can work as a multiline comment. -Or for unparsable, broken code -""" # # Data Structures -- cgit v1.2.3 From 563e135e68223775e2db5bea3421afddc28d8c30 Mon Sep 17 00:00:00 2001 From: Donovan Glover Date: Wed, 27 Dec 2017 13:35:16 -0500 Subject: Fix the multiline Nim comment --- nim.html.markdown | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'nim.html.markdown') diff --git a/nim.html.markdown b/nim.html.markdown index 30dfa94f..1e17d8f0 100644 --- a/nim.html.markdown +++ b/nim.html.markdown @@ -15,15 +15,9 @@ Nim is efficient, expressive, and elegant. # Single-line comments start with a # #[ - Multi-line comments begin with a #[ - ... and end with ]# - -They don't care about indentation - - #[ - and they can be nested - ]# - + This is a multiline comment. + In Nim, multiline comments can be nested, beginning with #[ + ... and ending with ]# ]# discard """ -- cgit v1.2.3 From 6a5b626f788d4aaaa2f3c6e7e749bf3b77410245 Mon Sep 17 00:00:00 2001 From: Josias Date: Thu, 16 Jul 2020 18:48:59 +0200 Subject: Nim: Fix syntax error Semicolons for types are supposed to be directly after the variable name. --- nim.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nim.html.markdown') diff --git a/nim.html.markdown b/nim.html.markdown index 1e17d8f0..9730e579 100644 --- a/nim.html.markdown +++ b/nim.html.markdown @@ -28,7 +28,7 @@ Or for unparsable, broken code var # Declare (and assign) variables, letter: char = 'n' # with or without type annotations lang = "N" & "im" - nLength : int = len(lang) + nLength: int = len(lang) boat: float truth: bool = false -- cgit v1.2.3