Merge branch 'devel' of https://github.com/Araq/Nimrod into devel

This commit is contained in:
Araq
2014-12-14 11:50:23 +01:00
3 changed files with 41 additions and 0 deletions

19
build.sh Executable file
View File

@@ -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

View File

@@ -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
============================

9
install.sh.template Normal file
View File

@@ -0,0 +1,9 @@
#!/bin/sh
set -e
set -x
if [ "$1" != "" ]; then
exec ./koch install "$1"
else
exec ./koch install
fi