summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorDominik Picheta <dominikpicheta@googlemail.com>2015-10-22 10:38:30 +0100
committerDominik Picheta <dominikpicheta@googlemail.com>2015-10-22 10:38:30 +0100
commitbf6211df6c0717109a235122d182d9fc101879ca (patch)
treec358148442817fa9998be31c4a96d3bd3fd06128
parentd93507fd2e88fe1cffb69b8f0cf50a6670bfbecc (diff)
parentc894f6fd25261d70d5e3385037399925b0e534cd (diff)
downloadNim-bf6211df6c0717109a235122d182d9fc101879ca.tar.gz
Merge pull request #3463 from yglukhov/patch-1
Fixed broken links
-rw-r--r--web/learn.txt4
1 files changed, 2 insertions, 2 deletions
diff --git a/web/learn.txt b/web/learn.txt
index e1a3f1c8c..987666f8e 100644
--- a/web/learn.txt
+++ b/web/learn.txt
@@ -40,8 +40,8 @@ Learning Nim
   .. container:: articles
 
     - `How I Start: Nim <http://howistart.org/posts/nim/1>`_
-    - `Getting Started With Nim <https://akehrer.github.io/nim/2015/01/05/getting-started-with-nim.html>`_
-    - `Getting Started With Nim - Part 2 <https://akehrer.github.io/nim/2015/01/14/getting-started-with-nim-pt2.html>`_
+    - `Getting Started With Nim <https://akehrer.github.io/posts/getting-started-with-nim>`_
+    - `Getting Started With Nim - Part 2 <https://akehrer.github.io/posts/getting-started-with-nim-2>`_
     - `What is special about Nim? <http://hookrace.net/blog/what-is-special-about-nim>`_
     - `What makes Nim practical? <http://hookrace.net/blog/what-makes-nim-practical>`_
     - `Learn Nim in minutes <http://learnxinyminutes.com/docs/nim>`_
ding-left: 5px; padding-right: 5px; } .highlight .hll { background-color: #ffffcc } .highlight .c { color: #888888 } /* Comment */ .highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ .highlight .k { color: #008800; font-weight: bold } /* Keyword */ .highlight .ch { color: #888888 } /* Comment.Hashbang */ .highlight .cm { color: #888888 } /* Comment.Multiline */ .highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */ .highlight .cpf { color: #888888 } /* Comment.PreprocFile */ .highlight .c1 { color: #888888 } /* Comment.Single */ .highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */ .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */ .highlight .gr { color: #aa0000 } /* Generic.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
discard """
  disabled: "posix" # already covered by texceptions.nim
  matrix: "-d:nimStdSetjmp; -d:nimRawSetjmp; -d:nimBuiltinSetjmp"
  output: '''

BEFORE
FINALLY

BEFORE
EXCEPT
FINALLY
RECOVER

BEFORE
EXCEPT: IOError: hi
FINALLY
'''
"""

echo ""

proc no_exception =
  try:
    echo "BEFORE"

  except:
    echo "EXCEPT"
    raise

  finally:
    echo "FINALLY"

try: no_exception()
except: echo "RECOVER"

echo ""

proc reraise_in_except =
  try:
    echo "BEFORE"
    raise newException(IOError, "")

  except IOError:
    echo "EXCEPT"
    raise

  finally:
    echo "FINALLY"

try: reraise_in_except()
except: echo "RECOVER"

echo ""

proc return_in_except =
  try:
    echo "BEFORE"
    raise newException(IOError, "hi")

  except:
    echo "EXCEPT: ", getCurrentException().name, ": ", getCurrentExceptionMsg()
    return

  finally:
    echo "FINALLY"

try: return_in_except()
except: echo "RECOVER"

block: #10417
  proc moo() {.noreturn.} = discard

  let bar =
    try:
      1
    except:
      moo()

  doAssert(bar == 1)

# Make sure the VM handles the exceptions correctly
block:
  proc fun1(): seq[int] =
    try:
      try:
        raise newException(ValueError, "xx")
      except:
        doAssert("xx" == getCurrentExceptionMsg())
        raise newException(KeyError, "yy")
    except:
      doAssert("yy" == getCurrentExceptionMsg())
      result.add(1212)
    try:
      try:
        raise newException(AssertionDefect, "a")
      finally:
        result.add(42)
    except AssertionDefect:
      result.add(99)
    finally:
      result.add(10)
    result.add(4)
    result.add(0)
    try:
      result.add(1)
    except KeyError:
      result.add(-1)
    except ValueError:
      result.add(-1)
    except IndexDefect:
      result.add(2)
    except:
      result.add(3)

    try:
      try:
        result.add(1)
        return
      except:
        result.add(-1)
      finally:
        result.add(2)
    except KeyError:
      doAssert(false)
    finally:
      result.add(3)

  let x1 = fun1()
  const x2 = fun1()
  doAssert(x1 == x2)