From 4595c7e3ed55b10b449e817657f3647f51e5a501 Mon Sep 17 00:00:00 2001 From: JasonJAyalaP Date: Fri, 19 Sep 2014 20:00:13 -0500 Subject: Removed common operations, explained continue --- nim.html.markdown | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) (limited to 'nim.html.markdown') diff --git a/nim.html.markdown b/nim.html.markdown index 48a24834..f22d0365 100644 --- a/nim.html.markdown +++ b/nim.html.markdown @@ -41,17 +41,6 @@ This can work as a multiline comment. Or for unparsable, broken code """ -# -# Common Operations on Basic Types -# - -# Strings -let - phrase = "Nim is a" - nim = phrase[0..5] - fullPhrase = phrase & "programming language." - length = len(fullPhrase) # Or: fullPhrase.len - # # Data Structures # @@ -218,8 +207,8 @@ for line in splitLines(myString): echo(line) for i, c in myString: # Index and letter. Or `for j in` for just letter - if i mod 2 == 0: continue # Compact `if` form - elif c == 'X': break + if i mod 2 == 0: continue # Skip rest of iteration + elif c == 'X': break # Compact `if` form else: echo(c) # # Procedures @@ -259,7 +248,7 @@ proc pluralize(a: int): string = # # Because Nim compiles to C, FFI is easy: - +# proc strcmp(a, b: cstring): cint {.importc: "strcmp", nodecl.} var cmp = strcmp("C?", "Easy!") -- cgit v1.2.3