Merge branch 'master' of github.com:Araq/Nimrod into upstream
This commit is contained in:
commit
c1ad05c4c5
32 changed files with 12023 additions and 459 deletions
24
doc/lib.txt
24
doc/lib.txt
|
|
@ -289,6 +289,15 @@ Miscellaneous
|
|||
This module implements an event system that is not dependant on external
|
||||
graphical toolkits.
|
||||
|
||||
* `oids <oids.html>`_
|
||||
An OID is a global ID that consists of a timestamp,
|
||||
a unique counter and a random value. This combination should suffice to
|
||||
produce a globally distributed unique ID. This implementation was extracted
|
||||
from the Mongodb interface and it thus binary compatible with a Mongo OID.
|
||||
|
||||
* `endians <endians.html>`_
|
||||
This module contains helpers that deal with different byte orders.
|
||||
|
||||
|
||||
Database support
|
||||
----------------
|
||||
|
|
@ -331,6 +340,12 @@ Database support
|
|||
A higher level SQLite database wrapper. The same interface is implemented
|
||||
for other databases too.
|
||||
|
||||
* `db_mongo <db_mongo.html>`_
|
||||
A higher level **mongodb** wrapper.
|
||||
|
||||
* `mongodb <mongo.html>`_
|
||||
Lower level wrapper for the **mongodb** client C library.
|
||||
|
||||
|
||||
Other
|
||||
-----
|
||||
|
|
@ -489,6 +504,9 @@ Graphics libraries
|
|||
* `wingl <wingl.html>`_
|
||||
Part of the wrapper for OpenGL.
|
||||
|
||||
* `opengl <opengl.html>`_
|
||||
New wrapper for OpenGL supporting up to version 4.2.
|
||||
|
||||
|
||||
GUI libraries
|
||||
-------------
|
||||
|
|
@ -581,3 +599,9 @@ Data Compression and Archiving
|
|||
Interface to the `lib zip <http://www.nih.at/libzip/index.html>`_ library by
|
||||
Dieter Baron and Thomas Klausner.
|
||||
|
||||
|
||||
Scientific computing
|
||||
--------------------
|
||||
|
||||
* `libsvm <libsvm.html>`_
|
||||
Low level wrapper for `libsvm <http://www.csie.ntu.edu.tw/~cjlin/libsvm/>`_.
|
||||
|
|
|
|||
|
|
@ -2567,11 +2567,11 @@ Type constraints
|
|||
type parameter. Only the specified types are valid for instantiation:
|
||||
|
||||
.. code-block:: nimrod
|
||||
proc onlyIntOrString[T: int|string](x, y: T): T = nil
|
||||
|
||||
onlyIntOrString(45, 66) # valid
|
||||
onlyIntOrString(56.0, 0.0) # type mismatch
|
||||
proc onlyIntOrString[T: int|string](x, y: T) = nil
|
||||
|
||||
onlyIntOrString(450, 616) # valid
|
||||
onlyIntOrString(5.0, 0.0) # type mismatch
|
||||
onlyIntOrString("xy", 50) # invalid as 'T' cannot be both at the same time
|
||||
|
||||
Apart from ordinary types, type constraints can also be of the
|
||||
following *type classes*:
|
||||
|
|
|
|||
|
|
@ -451,34 +451,3 @@ efficient:
|
|||
else: quit(errorStr(p, "expected: console or gui"))
|
||||
of "license": c.license = UnixToNativePath(k.value)
|
||||
else: quit(errorStr(p, "unknown variable: " & k.key))
|
||||
|
||||
|
||||
..
|
||||
The ECMAScript code generator
|
||||
=============================
|
||||
|
||||
Note: As of version 0.7.0 the ECMAScript code generator is not maintained any
|
||||
longer. Help if you are interested.
|
||||
|
||||
Note: I use the term `ECMAScript`:idx: here instead of `JavaScript`:idx:,
|
||||
since it is the proper term.
|
||||
|
||||
The ECMAScript code generator is experimental!
|
||||
|
||||
Nimrod targets ECMAScript 1.5 which is supported by any widely used browser.
|
||||
Since ECMAScript does not have a portable means to include another module,
|
||||
Nimrod just generates a long ``.js`` file.
|
||||
|
||||
Features or modules that the ECMAScript platform does not support are not
|
||||
available. This includes:
|
||||
|
||||
* manual memory management (``alloc``, etc.)
|
||||
* casting and other unsafe operations (``cast`` operator, ``zeroMem``, etc.)
|
||||
* file management
|
||||
* most modules of the Standard library
|
||||
* proper 64 bit integer arithmetic
|
||||
* proper unsigned integer arithmetic
|
||||
|
||||
However, the modules `strutils`:idx:, `math`:idx:, and `times`:idx: are
|
||||
available! To access the DOM, use the `dom`:idx: module that is only
|
||||
available for the ECMAScript platform.
|
||||
|
|
|
|||
855
doc/theindex.txt
855
doc/theindex.txt
File diff suppressed because it is too large
Load diff
16
doc/tut1.txt
16
doc/tut1.txt
|
|
@ -91,8 +91,9 @@ keywords, comments, operators, and other punctuation marks. Case is
|
|||
``This_is_an_identifier`` and ``ThisIsAnIdentifier`` are the same identifier.
|
||||
This feature enables you to use other
|
||||
people's code without bothering about a naming convention that conflicts with
|
||||
yours. It also frees you from remembering the exact spelling of an identifier
|
||||
(was it ``parseURL`` or ``parseUrl`` or ``parse_URL``?).
|
||||
yours. A Nimrod-aware editor or IDE can show the identifiers as
|
||||
preferred. It also frees you from remembering the exact spelling of an
|
||||
identifier (was it ``parseURL`` or ``parseUrl`` or ``parse_URL``?).
|
||||
|
||||
|
||||
String and character literals
|
||||
|
|
@ -117,16 +118,13 @@ Comments
|
|||
--------
|
||||
|
||||
`Comments`:idx: start anywhere outside a string or character literal with the
|
||||
hash character ``#``. Documentation comments start with ``##``.
|
||||
Comments consist of a concatenation of `comment pieces`:idx:. A comment piece
|
||||
starts with ``#`` and runs until the end of the line. The end of line characters
|
||||
belong to the piece. If the next line only consists of a comment piece which is
|
||||
aligned to the preceding one, it does not start a new comment:
|
||||
hash character ``#``. Documentation comments start with ``##``. Multiline
|
||||
comments need to be aligned at the same column:
|
||||
|
||||
.. code-block:: nimrod
|
||||
|
||||
i = 0 # This is a single comment over multiple lines belonging to the
|
||||
# assignment statement. The scanner merges these two pieces.
|
||||
# assignment statement.
|
||||
# This is a new comment belonging to the current block, but to no particular
|
||||
# statement.
|
||||
i = i + 1 # This a new comment that is NOT
|
||||
|
|
@ -1206,7 +1204,7 @@ Traced references are declared with the **ref** keyword, untraced references
|
|||
are declared with the **ptr** keyword.
|
||||
|
||||
The empty ``[]`` subscript notation can be used to *derefer* a reference,
|
||||
meaning to retrieve the item the reference points to. The ``addr`` procedure
|
||||
meaning to retrieve the item the reference points to. The ``addr`` operator
|
||||
returns the address of an item. An address is always an untraced reference:
|
||||
``addr`` is an *unsafe* feature.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue