-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
537f1ce
commit 48d3a12
Showing
6 changed files
with
1,106 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# Style examples - compile with `-d:nphBookExamples` to regenerate them | ||
# for the book | ||
|
||
proc function(par0: SomeType): bool = | ||
discard | ||
|
||
proc function(par0: SomeType, par1: SomeType): bool = | ||
discard | ||
|
||
proc function( | ||
par0: SomeType, par1, par2: SomeOtherType, par3 = default(SomeType) | ||
): bool {.inline.} = | ||
discard | ||
|
||
import dir/module | ||
|
||
const v = [1, 2, 3] | ||
|
||
type T = proc(a, b: int) | ||
|
||
import dir/[module1, module2, module3, module4] | ||
|
||
const mylongvariablename = [100000000, 200000000, 300000000] | ||
|
||
proc function(param0: int, param1: int, param2: int) | ||
|
||
import | ||
dir/[module1, module2, module3], | ||
dir2/[module4, module5, module6, module7, module8, module9] | ||
|
||
let myVariable = [functionCall(a, b, c), functionCall(a, b, c, d)] | ||
|
||
functionCall(functionCall(a, b, c), functionCall(a, b, c, d)) | ||
|
||
const values = [10000000, 2000000000, 3000000000, 40000000, 5000000000] | ||
|
||
functionCall(10000000, 2000000000, 3000000000, 40000000, 5000000000) | ||
|
||
proc f( | ||
myParameter = 0, | ||
callback: SomeCallback = proc() = | ||
discard | ||
, | ||
nextParameter = 1, | ||
) | ||
|
||
let myvariable = shortexpression(abc) | ||
|
||
let myvariable = someevenlongerexpression(abc, def) | ||
|
||
let myvariable = someevenlongerexpression(aaa, bbb, ccc, ddd) | ||
|
||
return | ||
if condition: | ||
complex(call) | ||
else: | ||
alsocomplex(call) |
Oops, something went wrong.