bugfixes: macros; splitFile; strutils.split; iterator.method
This commit is contained in:
parent
053309e60a
commit
d5acb88ccc
31 changed files with 177 additions and 95 deletions
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
.. contents::
|
||||
|
||||
Abstraction is layering ignorance on top of reality. -- unknown
|
||||
"Abstraction is layering ignorance on top of reality." -- unknown
|
||||
|
||||
|
||||
Directory structure
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ Nimrod Standard Library
|
|||
|
||||
..
|
||||
|
||||
The good thing about reinventing the wheel is that you can get a round one.
|
||||
"The good thing about reinventing the wheel is that you can get a round one."
|
||||
|
||||
Though the Nimrod Standard Library is still evolving, it is already quite
|
||||
usable. It is divided into *pure libraries*, *impure libraries* and *wrappers*.
|
||||
|
|
|
|||
|
|
@ -760,7 +760,7 @@ An example:
|
|||
nkIf # an if statement
|
||||
PNode = ref TNode
|
||||
TNode = object
|
||||
case kind: TNodeKind # the ``kind`` field is the discriminator
|
||||
case kind: TNodeKind # the ``kind`` field is the discriminant
|
||||
of nkInt: intVal: int
|
||||
of nkFloat: floavVal: float
|
||||
of nkString: strVal: string
|
||||
|
|
@ -1648,7 +1648,7 @@ required. ``Elif`` parts are also allowed (but unlikely to be good
|
|||
style).
|
||||
|
||||
|
||||
Type convertions
|
||||
Type conversions
|
||||
~~~~~~~~~~~~~~~~
|
||||
Syntactically a `type conversion` is like a procedure call, but a
|
||||
type name replaces the procedure name. A type conversion is always
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
:Version: |nimrodversion|
|
||||
|
||||
.. contents::
|
||||
|
||||
|
||||
Introduction
|
||||
============
|
||||
|
||||
|
|
|
|||
|
|
@ -871,7 +871,7 @@ type:
|
|||
var
|
||||
x = 0.0 # x is of type ``float``
|
||||
y = 0.0'f32 # y is of type ``float32``
|
||||
z = 0.0'f64 # z is of type ``int64``
|
||||
z = 0.0'f64 # z is of type ``float64``
|
||||
|
||||
The common operators ``+ - * / < <= == != > >=`` are defined for
|
||||
floats and follow the IEEE standard.
|
||||
|
|
@ -1318,7 +1318,7 @@ This is best illustrated by an example:
|
|||
|
||||
main()
|
||||
|
||||
|
||||
.. code-block:: nimrod
|
||||
# Module B
|
||||
import A # A is not parsed here! Only the already known symbols
|
||||
# of A are imported.
|
||||
|
|
@ -1338,9 +1338,11 @@ imported by a third one:
|
|||
# Module A
|
||||
var x*: string
|
||||
|
||||
.. code-block:: nimrod
|
||||
# Module B
|
||||
var x*: int
|
||||
|
||||
.. code-block:: nimrod
|
||||
# Module C
|
||||
import A, B
|
||||
write(stdout, x) # error: x is ambiguous
|
||||
|
|
@ -1357,9 +1359,11 @@ rules apply:
|
|||
# Module A
|
||||
proc x*(a: int): string = return $a
|
||||
|
||||
.. code-block:: nimrod
|
||||
# Module B
|
||||
proc x*(a: string): string = return $a
|
||||
|
||||
.. code-block:: nimrod
|
||||
# Module C
|
||||
import A, B
|
||||
write(stdout, x(3)) # no error: A.x is called
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue