Update README.md
This commit is contained in:
parent
28c90f16c4
commit
4c1f858cd7
1 changed files with 7 additions and 6 deletions
13
README.md
13
README.md
|
|
@ -12,7 +12,8 @@ Extensions so far include:
|
||||||
Usage:
|
Usage:
|
||||||
|
|
||||||
```nim
|
```nim
|
||||||
import extensions/oop
|
import extensions / oop
|
||||||
|
|
||||||
class BaseObject: # inherits from RootObj
|
class BaseObject: # inherits from RootObj
|
||||||
# attributes/properties
|
# attributes/properties
|
||||||
var
|
var
|
||||||
|
|
@ -44,7 +45,7 @@ Extensions so far include:
|
||||||
|
|
||||||
```nim
|
```nim
|
||||||
import os
|
import os
|
||||||
import extensions/enumerate
|
import extensions / enumerate
|
||||||
|
|
||||||
for i, line in enumerate(lines, "file.txt"):
|
for i, line in enumerate(lines, "file.txt"):
|
||||||
echo i, " ", line
|
echo i, " ", line
|
||||||
|
|
@ -58,7 +59,7 @@ Extensions so far include:
|
||||||
These printing procs are useful for printing objects and their types.
|
These printing procs are useful for printing objects and their types.
|
||||||
|
|
||||||
```nim
|
```nim
|
||||||
import objprint
|
import extensions / objprint
|
||||||
|
|
||||||
type Unit = ref object
|
type Unit = ref object
|
||||||
name: string
|
name: string
|
||||||
|
|
@ -68,7 +69,7 @@ echo Unit(name: "Non-ref")[]
|
||||||
echo (str: "value")
|
echo (str: "value")
|
||||||
|
|
||||||
# Prints:
|
# Prints:
|
||||||
#. ref Unit(name: "Ref")
|
# ref Unit(name: "Ref")
|
||||||
#. Unit(name: "Non-ref")
|
# Unit(name: "Non-ref")
|
||||||
#. tuple[str: string](str: "value")
|
# tuple[str: string](str: "value")
|
||||||
```
|
```
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue