summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2014-12-14 11:50:23 +0100
committerAraq <rumpf_a@web.de>2014-12-14 11:50:23 +0100
commit516a4d933f9b5e87c670565dc03bdc755896bb2b (patch)
treea6171df02316c6316dea9ad7caaac925c17eb72d
parent9724bd4e1b44a23650b0f74c90766fe937ad778b (diff)
parent9607354729e97d99f756b32e803e3f974b3c0d0e (diff)
downloadNim-516a4d933f9b5e87c670565dc03bdc755896bb2b.tar.gz
Merge branch 'devel' of https://github.com/Araq/Nimrod into devel
-rwxr-xr-xbuild.sh19
-rw-r--r--doc/tut1.txt13
-rw-r--r--install.sh.template9
3 files changed, 41 insertions, 0 deletions
diff --git a/build.sh b/build.sh
new file mode 100755
index 000000000..139c28359
--- /dev/null
+++ b/build.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+set -e
+set -x
+
+if [ ! -d "csources" ]; then
+	git clone --depth 1 https://github.com/nim-lang/csources.git
+fi
+
+cd "csources"
+sh build.sh
+cd ".."
+
+./bin/nim c koch
+./koch boot -d:release
+
+cp -f install.sh.template install.sh
+chmod +x install.sh
+
+exit 0
diff --git a/doc/tut1.txt b/doc/tut1.txt
index 80ab2aab3..9d75b1ea2 100644
--- a/doc/tut1.txt
+++ b/doc/tut1.txt
@@ -957,6 +957,19 @@ versa. The `toInt <system.html#toInt>`_ and `toFloat <system.html#toFloat>`_
 procs can be used for these conversions.
 
 
+Type Conversion
+---------------
+Conversion between basic types in nim is performed by using the
+type as a function:
+
+.. code-block:: nim
+  var
+    x: int32 = 1.int32   # same as calling int32(1)
+    y: int8  = int8('a') # 'a' == 97'i8
+    z: float = 2.5       # int(2.5) rounds down to 2
+    sum: int = int(x) + int(y) + int(z) # sum == 100
+
+
 Internal type representation
 ============================
 
diff --git a/install.sh.template b/install.sh.template
new file mode 100644
index 000000000..1292abdab
--- /dev/null
+++ b/install.sh.template
@@ -0,0 +1,9 @@
+#!/bin/sh
+set -e
+set -x
+
+if [ "$1" != "" ]; then
+	exec ./koch install "$1"
+else
+	exec ./koch install
+fi