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
# builder.nim, line 746 (nimbuild repo) | |
proc hubConnect(state: PState, reconnect: bool) = | |
echo("hubConnect") | |
state.sock = AsyncSocket() | |
state.sock.handleConnect = proc (s: PAsyncSocket) = handleConnect(s, state) | |
state.sock.handleRead = proc (s: PAsyncSocket) = handleHubMessage(s, state) | |
state.reconnecting = reconnect | |
state.sock.connect(state.cfg.hubAddr, TPort(state.cfg.hubPort)) | |
state.dispatcher.register(state.sock) |
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 times import epochTime | |
#import ropes | |
type | |
NaturalFloat = range [0.0 .. Inf] | |
TDMPSettings = object | |
diffTimeout: NaturalFloat ## Number of seconds to map a diff before | |
## giving up (0 for infinity). |
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
# Old, C-Sharp code | |
string longtext = text1.Length > text2.Length ? text1 : text2; | |
string shorttext = text1.Length > text2.Length ? text2 : text1; | |
#New, nimrod code. | |
var longText = textOne | |
var shortText = textTwo | |
if len(textOne) > len(textTwo): | |
swap(longText, shortText) |
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 delete*[T](s: var seq[T], first, last: int) = | |
## Deletes in `s` the items at position `first` .. `last`. This modifies | |
## `s` itself, it does not return a copy. | |
var i = first | |
var j = last+1 | |
var newLen = len(s)-j+i | |
while i < newLen: | |
s[i].shallowCopy(s[j]) | |
inc(i) | |
inc(j) |
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
/* | |
* Copyright 2008 Google Inc. All Rights Reserved. | |
* Author: [email protected] (Neil Fraser) | |
* Author: [email protected] (Matthaeus G. Chajdas) | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License") | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.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
Bootstrapping! | |
[New Thread 7448.0x1794] | |
Program received signal SIGSEGV, Segmentation fault. | |
[Switching to Thread 7448.0x1794] | |
0x0000000000454b79 in getbigchunk_30616 (a=0x301120, size=12288) at c:/64/nimrod/lib/system/alloc.nim:490 | |
490 if result.size == size: |
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:\common\Nimwrappers>nimrod compile helloworld.nim | |
c:\64\nimrod\config\nimrod.cfg(36, 2) Hint: added path: 'C:\Users\Clay\.babel\pkgs\' [Path] | |
Hint: used config file 'C:\64\nimrod\config\nimrod.cfg' [Conf] | |
Hint: system [Processing] | |
Hint: helloworld [Processing] | |
gcc.exe -c -w -IC:\64\nimrod\lib -o c:\common\nimwrappers\nimcache\nimwrappers_helloworld.o | |
gcc.exe -c -w -IC:\64\nimrod\lib -o c:\common\nimwrappers\nimcache\nimrod_system.o c:\common | |
gcc.exe -o c:\common\nimwrappers\helloworld.exe c:\common\nimwrappers\nimcache\nimrod_sys | |
Hint: operation successful (7828 lines compiled; 3.338 sec total; 13.133MB) [SuccessX] |
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
#mangle "'_'{.*}" "$1" | |
#mangle "'__'{.*}" "$1" | |
// Copyright (c) 2013 Marshall A. Greenblatt. All rights reserved. | |
// | |
// Redistribution and use in source and binary forms, with or without | |
// modification, are permitted provided that the following conditions are | |
// met: | |
// | |
// * Redistributions of source code must retain the above copyright | |
// notice, this list of conditions and the following disclaimer. |
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 table # You can use anything declared public in the table module | |
from table import TTable # You can ONLY reference TTable, none of its methods | |
from table import TTable, len, [], mget, hasKey, []=, add, del, initTable, toTable, $, pairs, mpairs, keys, values, mvalues # Now we can use everything associated with TTable |
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
type | |
Wrapper[T] = object of TObject | |
iter: # The iterator procedure | |
args: # Arguments of the iterator |