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
proc foo(x: int8) = discard | |
proc bar(x: range[0'i8..1'i8]) = discard | |
var x = 1.int | |
echo compiles(foo(x)) # false | |
echo compiles(bar(x)) # true |
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
NOTE: The imports are found by simple walking throught the AST and looking after `nkFromStmt` and `nkImportStmt` nodes. | |
The stdlib modules are identified by simple string comparisions. | |
This method is not entirely accurate, but it does give some indication of which modules are used and which are not. | |
File imports (tot: 14078) | |
0 volatile | |
0 db_odbc | |
0 asyncftpclient | |
0 punycode | |
0 ssl |
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
import typetraits | |
iterator foo(i: int): int {.closure.} = | |
yield i + 1 | |
yield i + 2 | |
let f = foo | |
echo f(1) # 2 | |
echo f(2) # 4 |
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
import random, times | |
var input = newSeq[string]() | |
for _ in 1..100_000: | |
input.add(fromUnix(rand(0..100_000_000)).utc.format("yyyy-MM-dd'T'HH:mm:sszzz")) | |
block: | |
var sum = 0'i64 | |
let before = getTime() | |
for str in input: |
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
Number of files that imports the module (~15000 files total) | |
1 oswalkdir | |
1 rstgen | |
1 ftpclient | |
1 distros | |
1 strmisc | |
2 rlocks | |
2 lenientops | |
2 unidecode | |
3 httpserver |