| 00:10:58 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
| 00:29:05 | * | ics joined #nimrod |
| 00:30:37 | * | Fx00F joined #nimrod |
| 00:31:44 | adoniscik | why can't nimrod automatically cast ints to cinsts as it does with cfloat/cdouble and floats? |
| 00:32:10 | flaviu | because int != cint. int == size_t |
| 00:33:24 | adoniscik | so what's the right to feed (c)ints to C libraries? |
| 00:33:32 | adoniscik | must I do cint(foo) for every int? |
| 00:33:42 | adoniscik | right way |
| 00:34:06 | flaviu | I personally like foo.cint, but that works too |
| 00:34:20 | flaviu | You can also use a little documented feature, converters |
| 00:34:53 | flaviu | But keep in mind that explicit is better than implicit |
| 00:35:10 | adoniscik | and what about arrays of cints; pls can you show you would define a simple array like [1,2,3,4,5] as cints |
| 00:36:07 | flaviu | [1.cint, 2.cint, 3.cint, 4.cint, 5.cint] |
| 00:36:21 | adoniscik | I don't need to tell you how ugly that is :) |
| 00:36:33 | flaviu | Not too nice, you might want to make a function to convert the array |
| 00:37:18 | flaviu | https://gist.github.com/aa0dda27a97eb89e03e0 would allow https://gist.github.com/a28bba00b3992edbc754 , which would look much nicer |
| 00:39:23 | flaviu | but you could just change the name of the proc in the second gist, same thing |
| 00:42:15 | * | bjz joined #nimrod |
| 00:53:02 | adoniscik | I'm trying to write a cint converter. I read the parameters using an int varargs but I couldn't figure out how to return them. |
| 00:53:21 | adoniscik | in the meantime I have another question: if int corresponds to size_t, what corresponds to cint? |
| 00:55:37 | def- | adoniscik: http://nimrod-lang.org/system.html#cint ? |
| 00:56:35 | adoniscik | I see, thanks. |
| 01:01:49 | * | ics quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
| 01:03:55 | adoniscik | Is there a way to generate tuples without naming the fields? for example define converter `toCint`(t: varargs[int]): seq[cint] = map(t, proc (x: int) : cint = cint(x)) |
| 01:03:57 | * | ics joined #nimrod |
| 01:04:09 | adoniscik | echo toCint(1,2,3) returns @[1,2,3] |
| 01:04:27 | adoniscik | could I return a tuple do I can use the result of toCint for tuple unpacking? |
| 01:09:53 | Varriount | adoniscik: COuld you restate your problem? |
| 01:11:08 | flaviu | adoniscik: Keep in mind that cint's length isn't defined. It can be anything |
| 01:11:16 | adoniscik | how can I elegantly convert an tuple or array of ints to cints ? |
| 01:11:33 | flaviu | From what I understand, old C compilers called int16 an int |
| 01:11:44 | flaviu | adoniscik: tuple? |
| 01:12:07 | adoniscik | yes, (int1, int2, ... , intn) -> (cint1, cint2, ... , cintn) |
| 01:13:26 | flaviu | Hmm, that might be hard. Nimrod doesn't have variadic types |
| 01:17:53 | adoniscik | maybe I dont need it. If I define a wrapper proc using int args and {.nodecl, importc.}, does nimrod automatically convert ints to cints? |
| 01:18:07 | adoniscik | I'm guessing not :) |
| 01:18:36 | flaviu | I don't know, but only one way to find out :) |
| 01:23:04 | adoniscik | sure, I'm working on it. interestingly, you can do var x,y,z = (1,2,3) but not var x,y,z:int = (1,2,3) |
| 01:23:52 | adoniscik | if it had worked it might have been an elegant solution to my problem |
| 01:27:17 | * | bjz quit (Ping timeout: 255 seconds) |
| 01:28:37 | * | xenagi joined #nimrod |
| 01:31:01 | * | BlameStross left #nimrod (#nimrod) |
| 01:39:23 | * | saml_ joined #nimrod |
| 01:39:33 | * | ics quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
| 01:45:29 | * | q66 quit (Quit: Leaving) |
| 01:57:18 | NimBot | Araq/Nimrod devel f345b02 Grzegorz Adam Hankiewicz [+0 ±1 -0]: Adds os.copyDirWithPermissions(). |
| 01:57:18 | NimBot | Araq/Nimrod devel d597767 Grzegorz Adam Hankiewicz [+0 ±1 -0]: Adds hyperlinks to copyFile* docstrings. |
| 01:57:18 | NimBot | Araq/Nimrod devel 5c43fbc Varriount [+0 ±1 -0]: Merge pull request #1416 from gradha/pr_copy_dir_permissions... 2 more lines |
| 01:57:38 | NimBot | Araq/Nimrod devel b10bf62 Grzegorz Adam Hankiewicz [+0 ±2 -0]: Documents pretty command. |
| 01:57:38 | NimBot | Araq/Nimrod devel 83d7d30 Varriount [+0 ±2 -0]: Merge pull request #1412 from gradha/pr_documents_pretty... 2 more lines |
| 02:10:59 | * | darkf quit (Read error: Connection reset by peer) |
| 02:12:02 | * | darkf joined #nimrod |
| 02:21:39 | NimBot | Araq/Nimrod devel 90e3c99 Grzegorz Adam Hankiewicz [+0 ±1 -0]: Adds TSet.isValid(). |
| 02:21:39 | NimBot | Araq/Nimrod devel cdecac1 Grzegorz Adam Hankiewicz [+0 ±1 -0]: Adds TOrderedSet.isValid(). |
| 02:21:39 | NimBot | Araq/Nimrod devel dd47fa9 Grzegorz Adam Hankiewicz [+0 ±1 -0]: Moves TSet procs to their code block. |
| 02:21:39 | NimBot | Araq/Nimrod devel 6c3b967 Grzegorz Adam Hankiewicz [+0 ±1 -0]: Adds test cases for remaining TSet procs. |
| 02:21:39 | NimBot | 6 more commits. |
| 02:22:05 | adoniscik | thanks for keeping us informed, nimbot :) |
| 02:28:36 | * | flaviu quit (Read error: Connection reset by peer) |
| 02:30:31 | * | flaviu joined #nimrod |
| 02:44:47 | * | Raynes quit (Ping timeout: 272 seconds) |
| 02:45:00 | * | boydgreenfield quit (Quit: boydgreenfield) |
| 02:46:30 | * | Raynes joined #nimrod |
| 02:54:41 | * | ics joined #nimrod |
| 03:04:11 | * | boydgreenfield joined #nimrod |
| 03:15:52 | * | flaviu quit (Ping timeout: 255 seconds) |
| 03:18:22 | * | boydgreenfield quit (Quit: boydgreenfield) |
| 03:26:23 | * | flaviu joined #nimrod |
| 03:27:56 | * | flaviu quit (Client Quit) |
| 03:28:05 | * | flaviu joined #nimrod |
| 03:36:26 | * | boydgreenfield joined #nimrod |
| 03:45:59 | * | xenagi quit (Quit: Leaving) |
| 03:49:06 | * | saml_ quit (Ping timeout: 260 seconds) |
| 04:03:58 | * | ics quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
| 04:38:34 | * | ics joined #nimrod |
| 04:43:37 | * | mwbrown quit (Ping timeout: 256 seconds) |
| 04:44:28 | * | flaviu quit (Ping timeout: 240 seconds) |
| 05:04:19 | * | boydgreenfield quit (Quit: boydgreenfield) |
| 05:04:32 | * | ics quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
| 05:05:18 | * | boydgreenfield joined #nimrod |
| 05:05:22 | * | Fx00F quit (Quit: leaving) |
| 05:33:23 | * | ARCADIVS joined #nimrod |
| 05:40:00 | * | ics joined #nimrod |
| 05:40:24 | * | boydgreenfield quit (Quit: boydgreenfield) |
| 05:41:05 | * | bjz joined #nimrod |
| 05:41:40 | * | jh32 quit (Ping timeout: 250 seconds) |
| 06:01:10 | * | Boscop quit (Read error: Connection reset by peer) |
| 06:01:50 | * | Boscop joined #nimrod |
| 06:06:07 | * | Boscop quit (Client Quit) |
| 06:06:32 | * | Boscop joined #nimrod |
| 06:06:32 | * | Boscop quit (Changing host) |
| 06:06:32 | * | Boscop joined #nimrod |
| 06:11:12 | * | bjz quit (Ping timeout: 260 seconds) |
| 06:12:46 | * | bjz joined #nimrod |
| 06:33:21 | * | krusipo joined #nimrod |
| 07:25:42 | * | kunev joined #nimrod |
| 07:38:32 | * | Araq_ joined #nimrod |
| 07:38:55 | Araq_ | adoniscik: you can write [3.cint, 4, 5, 6] |
| 07:39:07 | Araq_ | you only need to give the first element its type |
| 07:41:58 | * | bjz quit (Ping timeout: 260 seconds) |
| 07:42:47 | adoniscik | thanks @Araq_, I noticed that too. |
| 07:43:09 | adoniscik | is that trick mentioned in the manual? I use it all the time |
| 07:43:19 | adoniscik | we should check |
| 07:47:44 | * | q66 joined #nimrod |
| 07:51:31 | * | bjz joined #nimrod |
| 07:55:22 | * | bjz quit (Quit: Textual IRC Client: www.textualapp.com) |
| 07:56:10 | Araq_ | maybe, we should add it in any case |
| 07:56:31 | * | bjz joined #nimrod |
| 07:59:23 | * | io2 joined #nimrod |
| 07:59:27 | * | io2 quit (Changing host) |
| 07:59:27 | * | io2 joined #nimrod |
| 08:02:06 | * | bjz quit (Ping timeout: 272 seconds) |
| 08:03:42 | * | adoniscik quit (Ping timeout: 250 seconds) |
| 08:04:20 | * | bjz joined #nimrod |
| 08:34:10 | * | Araq_ quit (Quit: ChatZilla 0.9.90.1 [Firefox 29.0/20140421221237]) |
| 08:39:03 | * | ics quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
| 08:50:52 | Skrylar | huh. |
| 08:50:59 | Skrylar | type mismatch, got (uint64,uint64) |
| 08:51:05 | Skrylar | for the > operator |
| 08:51:06 | def- | Skrylar: import unsigned |
| 08:51:11 | Skrylar | def-: already did |
| 08:54:07 | def- | Skrylar: ah yeah, because they are no ordinals |
| 08:54:28 | Skrylar | i had to remove the typeclass to get it to compile :/ |
| 08:54:35 | Skrylar | I had a [T:int64|uint64] section |
| 08:55:08 | def- | Skrylar: sounds strange |
| 08:55:31 | Skrylar | very |
| 08:55:45 | Skrylar | unsigned being a second class citizen is very inconvenient at times |
| 08:55:53 | def- | Yeah, I noticed the same |
| 08:56:04 | Skrylar | in this case, its serialization and packet code--a domain they are often used in |
| 08:56:28 | def- | I had problems with bigints, which store their parts in unsigned ints |
| 08:58:08 | Skrylar | I've been getting some really bad lisp pangs lately |
| 09:05:47 | * | bjz quit (Read error: Connection reset by peer) |
| 09:05:47 | * | bjz joined #nimrod |
| 09:08:54 | * | mal`` quit (Quit: ERC Version 5.3 (IRC client for Emacs)) |
| 09:14:42 | * | mal`` joined #nimrod |
| 09:27:46 | Skrylar | Oh my. Reading some old forth benchmarks out of curiosity |
| 09:28:22 | Skrylar | http://www.complang.tuwien.ac.at/forth/performance.html apparently the amount of source code is around ~25% as much needed for the C equivalents o.o |
| 10:25:09 | * | Kelet joined #nimrod |
| 10:28:15 | Kelet | Does anyone have a small graph implementation (nodes/edges)? |
| 10:44:58 | * | ARCADIVS quit (Quit: WeeChat 0.4.3) |
| 11:01:29 | * | AnnaJokela joined #nimrod |
| 11:03:33 | * | AnnaJokela quit (Client Quit) |
| 11:19:03 | * | Boscop quit (Read error: Connection reset by peer) |
| 11:19:28 | * | Boscop joined #nimrod |
| 11:54:51 | * | mwbrown joined #nimrod |
| 12:01:09 | flyx | hi folks! I'd like to expand the unicode package to add UTF16 & UTF-32 support. is anyone else working on something like this? |
| 12:03:42 | flyx | and can someone tell me what TRune16 is for? |
| 12:12:10 | def- | flyx: you mean toUTF16 and toUTF32 or what? |
| 12:12:29 | def- | ah, and the other direction too probably |
| 12:12:34 | flyx | def-: exactly |
| 12:13:06 | flyx | def-: I'm not entirely sure if it fits into the package, as only some functions have UTF8 in their name |
| 12:13:24 | flyx | I'd like to hear Araq's opinion on that |
| 12:13:33 | def- | yeah, since nimrod always implicitly assumes utf8 |
| 12:13:55 | flyx | yes, but it *should* have support for other encodings |
| 12:14:25 | flyx | they're required by some specs, like JSON and YAML |
| 12:15:30 | def- | and TRune16 is not used anywhere from what I can see |
| 12:15:44 | flyx | that's why I wondered why it was there |
| 12:24:06 | * | flaviu joined #nimrod |
| 12:31:51 | Boscop | has anyone here heard of the Red language, and what do you think of it? |
| 12:33:47 | * | untitaker quit (Ping timeout: 272 seconds) |
| 12:40:04 | * | untitaker joined #nimrod |
| 12:40:58 | * | io2 quit (Quit: ...take irc away, what are you? genius, billionaire, playboy, philanthropist) |
| 12:43:15 | * | Araq_ joined #nimrod |
| 12:43:41 | Araq_ | Boscop: I looked at Rebol once and it didn |
| 12:43:45 | Araq_ | *didn |
| 12:44:04 | Araq_ | *didn't convince me, but I forgot why ;-) |
| 12:45:46 | Araq_ | flyx: feel free but maybe put it in a different module |
| 12:46:26 | Araq_ | btw UTF16 and UTF32 suck ;-) |
| 12:47:04 | flyx | Araq_: I know. but it's needed in some places because specifications require it |
| 12:47:18 | Araq_ | yup. specs suck |
| 12:52:41 | * | othello joined #nimrod |
| 12:53:35 | flyx | the world will be infinitely better when software developers can always say „no we won't implement that, it sucks“ ^^ |
| 12:53:45 | othello | hello, is there a way to check whether a type is a seq type at compile time? |
| 12:54:03 | othello | e.g. type T = tuple[header: string, body: seq[int]] |
| 12:54:35 | othello | I'd like to do sth like `when T.body is seq` |
| 12:57:22 | Araq_ | doesn |
| 12:57:36 | Araq_ | doesn't this work already? |
| 12:58:07 | Araq_ | maybe you need: let dummy = x.body; when dummy is seq |
| 12:58:54 | othello | my bad it does |
| 12:58:59 | othello | Nimrod is indeed awesome |
| 12:59:28 | flaviu | Well, if you want another way of doing it I came up with https://gist.github.com/fba6df9cb02bf10278d6 lol |
| 12:59:29 | othello | however `when T[1] is seq` doesn't compile |
| 13:00:59 | flaviu | othello: My overloading solution works there |
| 13:02:03 | Araq_ | flyx: more realistically I think spec writers should be forced to implement their spec |
| 13:02:23 | Araq_ | that doesn |
| 13:02:37 | flaviu | Araq: Remember how you said dom96's syntax would complexity the compiler? |
| 13:02:37 | flaviu | Here is the patch: https://gist.github.com/flaviut/aa0dda27a97eb89e03e0 |
| 13:02:45 | Araq_ | doesn't prevent bloat though |
| 13:03:36 | Araq_ | flaviu: I'm not sure that's correct |
| 13:04:10 | flaviu | Possibly not, I was only concerned with getting it to compile. I doubt I'd be much more complex though. |
| 13:04:50 | Araq_ | I |
| 13:04:57 | Araq_ | oh ffs |
| 13:05:03 | othello | flaviu: your solution works, but not at compile time |
| 13:05:05 | Araq_ | stupid keyboard |
| 13:05:30 | Araq_ | flaviu: I'd rather see real improvements in the compiler |
| 13:05:42 | flaviu | othello: works for me, https://gist.github.com/3970d93fbb16b3654b07 gives the expected results |
| 13:05:58 | Araq_ | where "real" means "what I have in mind" :P |
| 13:06:47 | flaviu | Well, with that small change, you get type constructors, I think that's pretty real. |
| 13:07:17 | Araq_ | so we have a "small change" that people soon will rely on |
| 13:07:43 | Araq_ | that's worse :P |
| 13:08:05 | * | io2 joined #nimrod |
| 13:08:55 | othello | flaviu: your gist works indeed, thanks! |
| 13:09:27 | othello | flaviu: took me some time to get that you were building a MyT var with the `("foo", @[1,2])` bit ;) |
| 13:10:05 | flaviu | Yep, all that MyT does is give fancy labels to the items in the tuple |
| 13:11:59 | othello | flaviu: thanks again! Btw, is there a way to know the number of fields inside a tuple (at compile time I'd imagine)? |
| 13:12:13 | * | darkf quit (Quit: Leaving) |
| 13:12:46 | Araq_ | othello: something in typetraits |
| 13:13:09 | Araq_ | though it has some bug I don't remember if we fixed it |
| 13:15:34 | othello | proc arity*(t: typedesc): int ? |
| 13:15:45 | Araq_ | yup |
| 13:15:53 | othello | thanks! |
| 13:17:53 | Araq_ | def-: iirc zmq is now a babel package, they changed the ABI |
| 13:18:03 | Araq_ | so the old wrapper doesn't work anymore |
| 13:18:23 | Araq_ | dunno why it's still in the main repo |
| 13:18:48 | def- | Araq_: ah, my bad |
| 13:20:14 | def- | Araq_: hm, can't find the babel package |
| 13:20:36 | Araq_ | hmm strange |
| 13:29:52 | * | mwbrown quit (Ping timeout: 260 seconds) |
| 13:33:08 | Araq_ | def-: maybe wrap nanomsg instead? |
| 13:36:32 | * | samlee joined #nimrod |
| 13:36:42 | Araq_ | hi samlee welcome |
| 13:37:00 | samlee | hello |
| 13:37:06 | samlee | what? |
| 13:37:08 | samlee | why am i samlee |
| 13:37:31 | Araq_ | because of your mum |
| 13:37:54 | * | samlee quit (Remote host closed the connection) |
| 13:38:11 | * | saml joined #nimrod |
| 13:39:00 | saml | i was setting up company irc stuff and had to use real name |
| 13:39:04 | saml | now back to webscale name |
| 13:48:37 | flyx | irc, providing webscale names since before webscale was a thing |
| 14:02:31 | flyx | hm, just wondering, what's the best way of providing an exchangeable set of procs in Nimrod? to do something like: |
| 14:02:40 | flyx | let encoding = guessEncoding(myString) |
| 14:02:57 | flyx | encoding.runeLen(myString) |
| 14:03:10 | flyx | encoding.encode(myRune) |
| 14:03:11 | flyx | etc |
| 14:04:49 | Araq_ | you can either use objects + inheritance + methods or function pointer or 'case' |
| 14:05:15 | Araq_ | I usually use |
| 14:05:43 | Araq_ | case because the "oh this way somebody else can easily add an encoding without touching my code" never ever happens |
| 14:07:22 | flyx | what do you mean by 'case'? defining an encoding enum and provide that to every proc? |
| 14:09:52 | Araq_ | yes |
| 14:10:19 | Araq_ | you get a nice factory for free |
| 14:10:28 | flyx | wouldn't that be slower compared to function pointers? |
| 14:11:45 | flyx | hm, it's either a jump inside the function or one outside the function |
| 14:12:20 | flyx | probably doesn't make much of a difference |
| 14:12:41 | flyx | I'll do that, thanks |
| 14:15:10 | Araq_ | case is usually faster than function pointers |
| 14:15:27 | Araq_ | in principle it always faster since the FP loses information |
| 14:45:48 | * | MayurYa joined #nimrod |
| 14:45:48 | * | MayurYa quit (Changing host) |
| 14:45:48 | * | MayurYa joined #nimrod |
| 14:49:54 | * | io2 quit (Quit: ...take irc away, what are you? genius, billionaire, playboy, philanthropist) |
| 15:10:26 | * | Araq_ quit (Quit: ChatZilla 0.9.90.1 [Firefox 29.0/20140421221237]) |
| 15:15:45 | * | Demos joined #nimrod |
| 15:28:49 | * | kunev quit (Quit: leaving) |
| 15:28:57 | Demos | mustache braces are only used for pragmas right? |
| 15:33:18 | Demos | oh no they are used for sets as well |
| 15:33:51 | def- | Demos: and for key-value tables: {"foo": 12, "bar: 13} |
| 15:33:54 | def- | "bar"* |
| 15:34:17 | def- | and tables should be seqs of tuples* |
| 15:36:54 | * | Jehan_ joined #nimrod |
| 15:42:11 | * | othello quit (Quit: Page closed) |
| 16:37:51 | * | gsingh93 joined #nimrod |
| 16:50:28 | * | Matthias247 joined #nimrod |
| 17:14:14 | * | vendethiel joined #nimrod |
| 17:17:28 | * | ics joined #nimrod |
| 17:22:39 | * | Ven joined #nimrod |
| 17:28:57 | * | adoniscik joined #nimrod |
| 17:30:03 | * | brson joined #nimrod |
| 17:30:09 | * | brson quit (Client Quit) |
| 17:30:12 | * | ics quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
| 17:30:17 | * | brson joined #nimrod |
| 17:38:10 | * | flaviu quit (Remote host closed the connection) |
| 17:38:21 | * | flaviu joined #nimrod |
| 17:38:41 | * | flaviu quit (Remote host closed the connection) |
| 17:52:40 | * | io2 joined #nimrod |
| 18:01:06 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 18:16:06 | * | Ven joined #nimrod |
| 18:17:41 | * | ics joined #nimrod |
| 18:21:38 | * | flaviu joined #nimrod |
| 19:10:28 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 19:12:52 | * | btiffin quit (Ping timeout: 250 seconds) |
| 19:14:55 | * | jh32 joined #nimrod |
| 19:24:06 | * | btiffin joined #nimrod |
| 19:37:06 | * | ics quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
| 19:41:56 | * | Ven joined #nimrod |
| 19:43:25 | * | ics joined #nimrod |
| 19:59:19 | * | btiffin quit (Remote host closed the connection) |
| 20:14:04 | * | linkmonitor joined #nimrod |
| 20:16:18 | dom96 | hi linkmonitor |
| 20:17:57 | linkmonitor | hi |
| 20:23:58 | adoniscik | how's the link? |
| 20:28:32 | * | Ven quit (Read error: No route to host) |
| 20:28:46 | linkmonitor | Referring to me? If so, then well. If not, I apologize for logging into the middle of a conversation. |
| 20:30:36 | adoniscik | yes, just welcoming you to the club :) |
| 20:32:55 | * | Ven joined #nimrod |
| 20:34:54 | Araq | don't worry there is no conversation going on |
| 20:36:35 | Demos | really silent today actually |
| 20:37:08 | adoniscik | where's nimbot when you need him :) |
| 20:38:31 | linkmonitor | Ha, well thank you much. I'm new to Nimrod, but it's the rising star in my list of favorite languages. |
| 20:38:39 | linkmonitor | How's the adonis? |
| 20:41:17 | adoniscik | pretty sexy, according to mythology |
| 20:42:01 | adoniscik | and he's busy coding in nimrod :) |
| 20:43:01 | adoniscik | nimrod is a mythological character too, so it's appropriate :) |
| 20:43:54 | adoniscik | is lambda a keyword? |
| 20:44:28 | adoniscik | yes, it is |
| 20:44:48 | linkmonitor | Quite appropriate. I never figured Greek mythological characters to be tech savvy, but there's is a realm unto itself. |
| 20:45:42 | adoniscik | is lambda reserved for anonymous procs or what? I couldn't find anything in the docs beside a brief reference to "lambda lifting". |
| 20:46:28 | Demos | well lambda functions are anonymous procs |
| 20:46:29 | adoniscik | some closure business yet to be implemented? |
| 20:46:48 | adoniscik | but anonymous procs already exist |
| 20:46:55 | Demos | closures work as advertised, although I think there are some limits to having closures inside closures |
| 20:46:58 | Demos | yes |
| 20:47:07 | adoniscik | http://en.wikipedia.org/wiki/Lambda_lifting |
| 20:47:11 | Demos | oh lambda is a resurved word? |
| 20:47:22 | Araq | nah, Demos your knowledge is not up to date |
| 20:47:28 | adoniscik | yes, I just found out when porting a library that used it as an arg :) |
| 20:47:30 | Araq | these limits are gone |
| 20:47:42 | Demos | yay! |
| 20:47:55 | Demos | and adoniscik try enclosing the name in ``s, like `lambda` |
| 20:48:12 | Araq | well lambda is a keyword ... because ... |
| 20:48:20 | Araq | do you really want to know? |
| 20:48:36 | Demos | kinda... |
| 20:49:10 | * | noam joined #nimrod |
| 20:49:12 | Araq | well I figured how to do lambdas without lambda later |
| 20:50:41 | Araq | it's suprising how bad python is at multi-line lambdas when it's really not hard to do |
| 20:55:35 | * | Matthias247 quit (Read error: Connection reset by peer) |
| 20:58:58 | * | Johz joined #nimrod |
| 21:00:52 | adoniscik | how would you defined a procedural type that returns foo and has no argument constraints? |
| 21:01:40 | Demos | type TProc = proc(): foo |
| 21:05:50 | flaviu | I'm trying to open a file, but its segfaulting |
| 21:06:23 | flaviu | the path is correct, using the path in the terminal works fine |
| 21:07:22 | flaviu | Oh, nm |
| 21:07:41 | flaviu | It seems that the lines iterator takes a filename as a parameter, not a string |
| 21:08:39 | Araq | there is also strutils.splitLines |
| 21:09:30 | flaviu | lines is easier for me here, I'm reading a file anyways. Thanks though |
| 21:10:07 | def- | flaviu: i guess "type path = distinct string" would give a nicer error |
| 21:11:48 | dom96 | Araq: You're going to love this: github redesigned its issues (again?) lol |
| 21:12:04 | Araq | oh god, really? |
| 21:12:10 | Araq | for the better? |
| 21:12:29 | dom96 | dunno |
| 21:14:26 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 21:21:31 | flaviu | dom96: This should really bug you: I'm parsing html with regexps :D |
| 21:22:14 | Araq | yeah it's not like we have some serious html parser in the stdlib already |
| 21:23:21 | flaviu | Araq: That example isn't exactly encoraging |
| 21:23:26 | flaviu | I can do it in two lines |
| 21:25:47 | * | betawaffle quit (Ping timeout: 264 seconds) |
| 21:31:53 | * | betawaffle joined #nimrod |
| 21:43:33 | Araq | so ... how do we let people override the new 'deepCopy'? |
| 21:44:51 | NimBot | Araq/Nimrod devel 69949c0 Grzegorz Adam Hankiewicz [+0 ±1 -0]: Escapes properly code blocks without highlite support. |
| 21:44:51 | NimBot | Araq/Nimrod devel 9b63a33 Andreas Rumpf [+0 ±1 -0]: Merge pull request #1423 from gradha/pr_escape_not_highlighted_languages... 2 more lines |
| 21:47:17 | Jehan_ | Araq: In what context? Do you mean how to customize it for user-defined types? |
| 21:47:38 | Araq | Jehan_: yeah |
| 21:47:45 | Araq | well the major problem is syntax |
| 21:48:48 | Jehan_ | Araq: What parameters does it get? source object, source heap, target heap, something like that? Or just a source object and the rest gets figured out automagically? |
| 21:49:09 | Araq | proc `=` (x: var T, y: T) # ok, obviously overriding built-in assignment |
| 21:49:36 | Araq | proc detroy(x: T) {.destructor.} # but this one needs a pragma |
| 21:49:47 | * | Johz quit (Ping timeout: 264 seconds) |
| 21:50:09 | Araq | proc deepCopy(x: T): T # and this one looks not special at all |
| 21:51:31 | Jehan_ | So, you need to define all three procedures? |
| 21:51:52 | Araq | no, but the inconsistencies are weird |
| 21:52:07 | Araq | people voted for: |
| 21:52:28 | Araq | destructor destroy(x: T) |
| 21:52:48 | Araq | but then this doesn't improve much, if anything |
| 21:53:19 | Jehan_ | Hmm. |
| 21:53:54 | Jehan_ | What's the specific use case for the deep copy? Assignment with value semantics, replicating data for concurrency, etc.? |
| 21:53:56 | Demos | well there is no way to resolve the inconsistency by changing destructors, since they do not show up as a symbol in code |
| 21:54:26 | Araq | Demos: yes there is, if we go for the "some proc names are special" route |
| 21:54:48 | Demos | oh true |
| 21:55:20 | Araq | Jehan_: it's actually only invoked for inter thread communication |
| 21:55:21 | Jehan_ | If you want special proc names, you can always do stuff like: proc `*destructor*`(x: var T) = … |
| 21:55:27 | OrionPK | why not free up the lambda keyword then |
| 21:55:39 | Araq | OrionPK: consider it done |
| 21:55:59 | Jehan_ | Araq: Are source and target always in the same heap, and if not, how do you figure out which heap they belong to? |
| 21:56:34 | Araq | Jehan_: well they are obviously not in the same heap ;-) |
| 21:57:11 | Araq | source is some foreign heap, dest in its own heap |
| 21:57:32 | Jehan_ | Araq: I expected not, but wasn't sure if you had some additional mechanism in mind. |
| 21:57:53 | Araq | it's a really simply mechanism really |
| 21:57:54 | Jehan_ | Ah, so you figure out the source heap from the reference, and the target heap is whatever's current. |
| 21:57:58 | Jehan_ | Gotcha. |
| 21:58:04 | Araq | yes |
| 21:59:17 | Araq | for the first iteration only ref and ptr are allowed to be overriden for deepCopy |
| 21:59:41 | Araq | btw I though about naming it threadTransfer() or something similar |
| 22:00:07 | Araq | but we already have shallowCopy |
| 22:00:17 | Jehan_ | Eiffel uses `deep_import` to distinguish it from copying. |
| 22:00:42 | Jehan_ | However, import already has an established meaning in Nimrod. |
| 22:02:25 | Araq | well I always was against __ASCII_ART__ but proc `*destroy*` is not too bad |
| 22:03:21 | Jehan_ | Well, the idea is to have something that people don't accidentally use. |
| 22:03:59 | Jehan_ | I wasn't suggesting the particular syntax, just something that forces you to be explicit about your intent. |
| 22:05:06 | Jehan_ | I still think a pragma would look more idiomatic for Nimrod. |
| 22:07:01 | Araq | fyi we tried 'proc destroy' and it lead to weird bugs where some wrappers would already have picked that name |
| 22:07:24 | Araq | so yes, some way to be explicit about it is required |
| 22:09:14 | Jehan_ | By the way, is `::` used for anything? I can't define a proc by that name. |
| 22:15:50 | Araq | yeah, operators with : are reserved |
| 22:18:12 | Jehan_ | Gotcha. |
| 22:36:45 | * | io2 quit (Quit: ...take irc away, what are you? genius, billionaire, playboy, philanthropist) |
| 22:39:21 | Araq | well what should the pragma be? .override? |
| 23:04:47 | Jehan_ | override what? |
| 23:05:07 | Araq | deepCopy and destroy |
| 23:06:01 | Jehan_ | I'd simply use two different ones. |
| 23:06:14 | Jehan_ | {.deepcopy.} and {.destructor.} or something like that. |
| 23:09:11 | Araq | meh |
| 23:14:54 | * | darkf joined #nimrod |
| 23:18:33 | * | Jehan_ quit (Quit: Leaving) |
| 23:19:27 | Araq | good night |
| 23:19:34 | linkmonitor | good night |
| 23:31:53 | * | saml_ joined #nimrod |
| 23:38:29 | * | linkmonitor left #nimrod (#nimrod) |