This file contains hidden or 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
[GCASSERT] incRef: interiorPtr | |
Traceback (most recent call last) | |
builder.nim(916) builder | |
builder.nim(773) open | |
builder.nim(754) hubConnect | |
gc.nim(242) asgnRef | |
gc.nim(102) incRef |
This file contains hidden or 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
C:\64\Nimrod>.\tools\detect\detect.exe | |
CMD gcc -o testh.exe testh.c | |
testh.c:1:17: fatal error: aio.h: No such file or directory | |
#include <aio.h> | |
^ | |
compilation terminated. | |
Not found: <aio.h> | |
CMD gcc -o testh.exe testh.c | |
testh.c:1:19: fatal error: dlfcn.h: No such file or directory | |
#include <dlfcn.h> |
This file contains hidden or 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
# Generated by detect.nim | |
const | |
E2BIG* = cint(7) | |
EACCES* = cint(13) | |
EADDRINUSE* = cint(100) | |
EADDRNOTAVAIL* = cint(101) | |
EAFNOSUPPORT* = cint(102) | |
EAGAIN* = cint(11) | |
EALREADY* = cint(103) | |
EBADF* = cint(9) |
This file contains hidden or 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 os, sequtils | |
const doslike = defined(windows) or defined(OS2) or defined(DOS) | |
proc u2np(path: string): string = | |
return unixToNativePath(path) | |
proc testUnixToNativePath() = | |
# Have input and output example paths for each system. | |
# Depending on the system, run the input path and compare against | |
# the output path. |
This file contains hidden or 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
# | |
# | |
# osPlus.nim | |
# | |
# Enhancements and additional procedures for os.nim | |
# | |
import os | |
const | |
DirLike = {pkDir, pkLinkToDir} | |
FileLike = {pkFile, pkLinkToFile} |
This file contains hidden or 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 Implementation | |
proc removeDir*(dir: string) = | |
for kind, path in walkDir(dir): | |
case kind | |
of pcFile, pcLinkToFile, pcLinkToDir: removeFile(path) | |
of pcDir: removeDir(path) | |
rawRemoveDir(dir) | |
## New Implementation |
This file contains hidden or 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
from sublime_plugin import EventListener | |
COMMENT_SCOPE = "comment.line.number-sign.nimrod" | |
FAIL_TOLERANCE = 3 | |
DEBUG = False | |
def debug(string): | |
if DEBUG: | |
print(string) |
This file contains hidden or 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 getFileInfo(path: string, followSymlinks:true): FileInfo = | |
## Retrieve the metadata associated with file system object pointed | |
## to by `path` . | |
when defined(Windows): | |
var openFlags = FILE_ATTRIBUTE_NORMAL | |
if followSymlinks: | |
openFlags = (openFlags or FILE_FLAG_OPEN_REPARSE_POINT) | |
var handle = createFileW(path, 0'i32, 0'i32, nil, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) |
This file contains hidden or 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
# Current styles of generic procedures | |
# Generic | |
proc foo[T](a: int, b: T): T = | |
result = b | |
var i = 0 | |
while i < a: | |
result = result+b | |
# Typedesc |
This file contains hidden or 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
# Normally, iterators must be passed all their arguments each time they are iterated over | |
iterator counter(start, stop:int): int {.closure.} = | |
var x = start | |
while x < stop: | |
yield x | |
inc(x) | |
var counterInstance = counter | |
echo(counterInstance(0,5)) | |
echo(counterInstance(0,5)) |