<<05-01-2013>>

01:57:48*shevy joined #nimrod
04:20:16*btbytes joined #nimrod
04:20:31*btbytes left #nimrod (#nimrod)
04:22:49*btbytes joined #nimrod
06:27:26*btbytes left #nimrod (#nimrod)
07:25:23*nolan1 joined #nimrod
07:33:32reactormonkAraq, can the idetools tell about type errors or do I just parse the error messages for that?
10:29:59*q66 joined #nimrod
13:30:08dom96reactormonk: You can use 'nimrod check' but parsing the error messages from that is not exactly trivial.
15:37:19*XAMPP joined #nimrod
17:37:37*gradha joined #nimrod
17:50:39gradhaI'm looking at the algorithm and sequtils modules but I can't figure if it's possible to write a one liner to transforms the string keys of a table into a sequence of integers
17:50:57gradhaat the moment I'm doing "for key in table.keys():
17:51:04gradha int_list.add(key.parseInt)
17:51:25gradhathe equivalent python one liner with list comprehension would be int_list = [int(x) for x in table.keys()]
17:52:07gradhaalso, now I write "var int_list : seq[int]" and another line "int_list = @[]" to initialize
17:52:29gradhamaybe there's a less caveman way of doing that
17:53:17gradhait seems that sequtils would welcome a "map" template, similar to filter, but which returns the applied proc without filtering
17:53:40dom96gradha: http://build.nimrod-code.org/docs/system.html#513
17:54:10gradhaI was just going to say that "map" in the index links to the htmlgen module
17:54:34dom96for some reason or other Araq decided to name it "each" instead of "map".
17:55:01gradhaI'm more worried about how many other perls might be hidden in system
17:55:16gradhayet it's so big it scares reading through it from a to z
17:56:43dom96what do you suggest we do to fix that?
17:57:25gradhaat the moment the only thing I can think of is putting a prominent link in sequtils documentation linking the system map
17:57:44gradhathat's were the "functional" like procs are found, but map was missing
17:58:05gradha*adding to my todo list*
17:58:42dom96ideally, the index should list 'map' as an alias for 'each' to make it easier to search
17:59:00gradhaI think I can make that work too
17:59:12dom96I think there might be a pragma or something to do that
18:05:59dom96see you later
18:06:08gradhabye
18:24:29*nolan1 joined #nimrod
18:39:01gradhaAraq: what is the encoding of literals found in nimrod code? is it guaranteed they are utf8?
18:40:05gradhas/nimrod code/nimrod source code/
19:30:24gradhameh, looks like I'm out of luck with functional http://pastebin.com/1nrWZKJU
19:30:46gradhaAraq: tell me if that's the return value bug or something new you want a github issue
20:01:16reactormonkwhat did you use for the dependency management part of babel? Just write your own algo?
21:46:15*gradha joined #nimrod
22:54:20dom96reactormonk: well. Currently there is no dependency management; it's not implemented yet.
22:54:44reactormonklibalpm? ;-)
22:57:06dom96libalpm doesn't seem to be documented at all.
22:59:56reactormonkthat's likely
23:00:09reactormonkAnd I assume dpkg is a monster
23:00:54dom96yeah. Also, I dislike such dependencies :P
23:01:16dom96But then again, it would be better than nothing.
23:02:38reactormonkhttp://scholar.google.com/scholar?q=dependency+management+algorithm ^^
23:03:49dom96I wish I had enough time to implement all this stuff.
23:04:05reactormonkmore like energy?
23:04:26dom96That too.
23:04:54reactormonkI assume a quick & dirty implementation will do - but reading one or two good papers may help
23:08:22dom96Would be awesome if you could implement it :)
23:08:35reactormonkI know.
23:08:59reactormonkBut let's go shopping for now.
23:11:06reactormonkdom96, quick thoughts: how about enforcing the API not to change in a minor version?
23:11:10reactormonkStatic analysis ftw
23:11:49dom96interesting idea
23:12:12dom96that would be a nice feature yes.
23:12:20dom96But might annoy some people.
23:12:51reactormonkSure it will. But it also enables you to say 'works with this version, so we can go up to the next major version'
23:13:47gradhanot like a proc won't change behaviour just because it keeps it's prototype...
23:14:48dom96There are definitely more important things to consider with babel.
23:15:02reactormonksure. And typing doesn't guarantee semantics
23:15:04*dom96 is still not satisfied with the current way it works
23:20:40gradhaso I got "Error: unhandled exception: error while reading from file [EIO]", how do I check what's the actual error?
23:21:09dom96that is the actual error, what do you mean?
23:21:18gradhasomething went wrong, but I don't know what
23:21:34gradhaI just get an exception thrown out, and the program stops with a backtrace
23:21:53dom96don't you get a traceback?
23:22:02gradhayes, to input.readAll()
23:23:06dom96Anything in the readAll proc?
23:23:25gradhatime to dig in
23:23:43dom96yes, most likely.
23:23:59gradhaoh, readAll presumes the file position is zero when it is called
23:24:07gradhasince I called setFilePos that's invalid
23:24:15dom96there you go
23:24:34dom96perhaps that's a bug with readAll?
23:25:11gradhawait, it's not, rawFileSize is more complicated
23:26:11gradhait could be a bug in ftell/fseek, meh, time to log everything
23:26:39dom96Why is there two readAll with the same prototype in system? 0_o
23:28:02dom96That looks like a bug.
23:30:09gradhathe source I'm looking at has a single readAll
23:30:49*AlexLibman joined #nimrod
23:30:58gradhaconfirmed, rawFileSize returns the whole file size, so readAll presumes you won't have seeked inside of it
23:31:07gradhamaybe I could add a readRest?
23:31:07dom96the docgen is failing I guess
23:31:31dom96maybe readAll should check this?
23:31:51dom96rawFileSize-filePos?
23:31:52gradhayes readAll could be made more lax to allow this
23:32:51gradhait's funny that rawFileSize considers the fseeked case and returns to the previous position
23:38:48dom96maybe there is a reason readAll behaves this way
23:39:34gradhafollow your own bug!... err... adventure! https://github.com/Araq/Nimrod/issues/298
23:41:43dom96lol
23:51:30dom96"# do not blame me; blame the ANSI C standard this is so brain-damaged"
23:51:33dom96:D
23:52:10gradhahardly any news
23:56:36gradhawow, nimrod actually has references to clearerr, though not in the expected places
23:57:07dom96to what?
23:57:27gradhaif you read EOF you are supposed to call clearerr() if you plan on doing anything else with the stream
23:57:38gradhaI guess the number of cases is so small nobody ever cares
23:57:49dom96I see
23:57:55gradhaor wait, maybe it's not feof, errno in general
23:58:12gradhathe manpage isn't that clear either
23:58:35gradhaah, yes, eof requires clearerr
23:59:46gradhaI wonder if this is useful for processes which read files other processes are appending to and then you need to seek back or something