tut3.rst formatting fix
This commit is contained in:
parent
8cb80238c4
commit
10219584ee
1 changed files with 8 additions and 8 deletions
16
doc/tut3.rst
16
doc/tut3.rst
|
|
@ -19,16 +19,16 @@ a Nim syntax tree into a different tree.
|
||||||
|
|
||||||
Examples of things that can be implemented in macros:
|
Examples of things that can be implemented in macros:
|
||||||
|
|
||||||
* An assert macro that prints both sides of a comparison operator, if
|
* An assert macro that prints both sides of a comparison operator, if
|
||||||
the assertion fails. ``myAssert(a == b)`` is converted to
|
the assertion fails. ``myAssert(a == b)`` is converted to
|
||||||
``if a != b: quit($a " != " $b)``
|
``if a != b: quit($a " != " $b)``
|
||||||
|
|
||||||
* A debug macro that prints the value and the name of the symbol.
|
* A debug macro that prints the value and the name of the symbol.
|
||||||
``myDebugEcho(a)`` is converted to ``echo "a: ", a``
|
``myDebugEcho(a)`` is converted to ``echo "a: ", a``
|
||||||
|
|
||||||
* Symbolic differentiation of an expression.
|
* Symbolic differentiation of an expression.
|
||||||
``diff(a*pow(x,3) + b*pow(x,2) + c*x + d, x)`` is converted to
|
``diff(a*pow(x,3) + b*pow(x,2) + c*x + d, x)`` is converted to
|
||||||
``3*a*pow(x,2) + 2*a*x + c``
|
``3*a*pow(x,2) + 2*a*x + c``
|
||||||
|
|
||||||
|
|
||||||
Macro Arguments
|
Macro Arguments
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue