00:51:02 | fowl | dom96: i ended up just using readdata/writedata..i overlooked them somehow >_> |
01:39:38 | * | q66 quit (Quit: Quit) |
09:07:41 | * | XAMPP_ joined #nimrod |
09:16:48 | * | XAMPP quit (*.net *.split) |
09:50:21 | * | q66 joined #nimrod |
09:54:05 | * | Trix[a]r_za is now known as Trixar_za |
10:47:56 | * | Trixar_za is now known as Trix[a]r_za |
11:52:36 | dom96 | fowl: Yeah, that makes more sense. |
13:08:18 | shevy | dom96, are there simple nimrod examples with gtk somewhere? |
13:08:54 | dom96 | shevy: Take a look at these: https://github.com/Araq/Nimrod/tree/master/examples/gtk |
13:10:57 | shevy | cool |
13:12:51 | shevy | oh this is odd |
13:12:57 | shevy | https://github.com/Araq/Nimrod/blob/master/examples/gtk/ex1.nim |
13:13:08 | shevy | this has hardcoded SIGNAL_FUNC(ex1.destroy) |
13:13:19 | shevy | I named the file demo1.nim and it no longer worked |
13:13:29 | shevy | is there a way to find out the filename in use reliably? |
13:13:45 | dom96 | no, it has to be hardcoded. |
13:13:52 | dom96 | However, you don't actually need that. |
13:13:58 | dom96 | You can just write "destroy" instead |
13:14:39 | shevy | demo1.nim(13, 35) Error: type mismatch: got (None) but expected one of: |
13:15:34 | shevy | well, I'll leave it hardcoded then |
13:16:48 | dom96 | perhaps you need it. |
13:16:58 | dom96 | the gtk modules might define a 'destroy' |
13:17:05 | dom96 | so it may be ambiguous |
13:18:14 | shevy | is there a way to get the filename? in ruby it is stored in __FILE__ constant |
13:18:50 | dom96 | of the current module? I doubt it. |
13:19:57 | dom96 | might be able to do something with macros |
13:20:20 | dom96 | but come on, it's not like you'll be changing the module name many times |
15:20:14 | shevy | no, not of the module - of the filename |
15:20:29 | dom96 | why do you want them filename? |
15:20:33 | shevy | ok see |
15:20:39 | shevy | the simple answer would be it is not possible |
15:40:46 | fowl | use control H |
15:40:51 | fowl | find&replace |
15:42:08 | dom96 | yeah |
15:58:48 | shevy | yeah, use workarounds |
16:02:49 | shevy | hmm interesting that python uses just ARGV[0] |
16:03:40 | dom96 | argv[0] is the name of the executable that is being executed |
16:03:47 | dom96 | in the case of python: |
16:03:52 | dom96 | python testscript.py |
16:04:04 | fowl | shevy: you only hit this problem if you're renaming a module so i dont see it as a big problem |
16:04:05 | dom96 | argv[0] will be 'testscript.py' I believe. |
16:04:16 | fowl | it would be nice to have a magic `thisModule` or something similar though |
16:04:58 | dom96 | Renaming modules is really rare, so this really is not a problem. |
16:05:02 | shevy | I find it inelegant to need hardcoded entries |
16:05:39 | dom96 | They're hardly hardcoded entries. |
16:05:44 | fowl | shevy: then you could name your procs so that they dont clash and there wouldnt be a prob |
16:06:16 | dom96 | Python for example requires you prefix all function names with the name of the module. |
16:06:20 | shevy | dom96 you say they are not hardcoded |
16:06:22 | shevy | https://gist.github.com/3499537 |
16:06:37 | shevy | the part SIGNAL_FUNC(demo3.destroy) has the filename demo3.nim |
16:07:33 | dom96 | fine ok. I think fowl's advice is good. |
16:08:28 | shevy | it's interesting to see that python and ruby solve this differently, for some reason ruby's ARGV does not contain the name of the program, whereas python's sys.argv does |
16:10:28 | shevy | hmmm |
16:10:31 | shevy | ruby stole perl's way |
16:10:43 | shevy | print $0 |
16:11:04 | fowl | shevy: i dont see a destroy() that matches that one in glib2 or gtk2 so you could probably just use signal_func(destroy) |
16:12:03 | fowl | nvm i was wrong |
16:12:13 | shevy | downcased? SIGNAL_FUNC is as signal_func yes? |
16:12:21 | shevy | or is there a convention |
16:12:35 | shevy | it's a bit confusing |
16:12:36 | shevy | set_border_width(PCONTAINER(Window), 5) |
16:12:36 | shevy | add(PContainer(window), totalbox) |
16:12:37 | fowl | shevy: i renamed it to mydestroy and it works without the module prefix |
16:30:21 | * | Trix[a]r_za is now known as Trixar_za |
16:32:50 | * | shevy quit (Ping timeout: 246 seconds) |
16:45:34 | * | shevy joined #nimrod |
17:27:31 | fowl | shevy: also you should stop pondering so hard and just try to write something |
17:32:33 | shevy | yeah |
17:32:39 | shevy | it's a good idea to not fight against the language |
19:10:21 | * | fowl quit (Remote host closed the connection) |
19:32:45 | * | fowl joined #nimrod |
19:32:55 | fowl | has anybody used zlib |
19:35:40 | shevy | not me. I only compile it sometimes... I think it uses just a Makefile, no configure.in script |
19:39:11 | fowl | how come some of the libraries dont show up in the index (md5, zlib) |
19:48:20 | dom96 | shevy: Nimrod is case and underscore insensitive. |
19:48:40 | dom96 | set_border_width is the same as setBorderWidth and setborderwidth |
19:49:05 | shevy | yeah |
19:49:15 | shevy | I was confused why it is PCONTAINER in one line, the PContainer right in the next |
19:50:19 | dom96 | The convention is to use camelCase for functions |
19:50:36 | dom96 | And for types it is well: TType |
19:50:42 | dom96 | like in Pascal |
19:51:07 | shevy | aha |
19:53:30 | fowl | i hope this is right https://gist.github.com/3503440 |
19:56:55 | dom96 | fowl: http://build.nimrod-code.org/docs/zipfiles.html |
19:56:56 | dom96 | :P |
19:57:13 | dom96 | Adds a dependency on libzip however |
20:14:49 | fowl | i dint want zips, gzips! |
20:15:10 | dom96 | i see |
20:15:30 | dom96 | Make a module out of this and make it stdlib worthy :P |
20:15:34 | dom96 | please :D |
20:15:49 | fowl | sure |
20:16:03 | fowl | i just updated the gist |
20:16:25 | fowl | im not sure how to guess at the uncompressed length |
20:25:37 | dom96 | I don't know either |
20:32:33 | * | Trixar_za is now known as Trix[a]r_za |
20:34:14 | shevy | what's with Araq, sleepy man these days? |
20:49:45 | dom96 | He's on holidays somewhere. |
21:06:04 | dom96 | He doesn't have internet access but is working on Nimrod I think :P |
23:36:15 | dom96 | good night |