00:06:05 | subsetpark | Generally speaking, are variables declared with `let` eligible for optimization by the Nim or C compilers, since they can be assumed not to change? |
00:07:28 | subsetpark | For instance, for some `let x = foo()`, where you refer to x + 1 in the body of a loop, hoisting the calculation outside of the loop since the compiler knows it will always be the same |
00:07:31 | PMunch | subsetpark, yes. |
00:07:59 | PMunch | IIRC |
00:09:00 | PMunch | For example: https://nim-lang.org/docs/nimc.html#optimizing-for-nim-optimizing-string-handling |
00:09:50 | PMunch | Since Nim knows that things defined with let won't change, it is able to avoid copying a string by referencing the original instead. |
00:10:11 | subsetpark | excellent |
00:14:24 | subsetpark | I wonder if that's a special case for strings ? |
00:14:34 | subsetpark | I assume not |
00:16:21 | PMunch | Pretty sure it's no |
00:16:23 | PMunch | not* |
00:16:47 | PMunch | For example try getting the .addr of a let |
00:16:56 | PMunch | It won't let you because it "has no address" |
00:17:39 | PMunch | http://ix.io/yF8 |
00:17:53 | PMunch | Hmm, what can cause the tables module to over-/underflow |
00:19:08 | subsetpark | oh wow interesting |
00:20:02 | * | xet7 quit (Quit: Leaving) |
00:27:12 | PMunch | Huh, well this is weird. It seems to be something with the underlying seq |
00:40:14 | PMunch | Oh man -_- |
00:40:15 | * | couven92 quit (Quit: Client Disconnecting) |
00:41:19 | PMunch | Okay, I was working with loading things through a dynlib (dll, so, whatever). And I had forgotten to recompile the dynlib, so it was passing something else than what I was expecting to get.. |
01:08:10 | * | yingjun joined #nim |
01:09:04 | * | Snircle quit (Ping timeout: 255 seconds) |
01:19:39 | * | Snircle joined #nim |
01:36:31 | * | chemist69 quit (Ping timeout: 255 seconds) |
01:50:28 | * | chemist69 joined #nim |
01:54:41 | * | rauss quit (Read error: Connection reset by peer) |
01:55:54 | * | rauss joined #nim |
02:07:07 | * | vendethiel joined #nim |
02:21:32 | * | endragor quit (Ping timeout: 246 seconds) |
02:29:55 | PMunch | Hmm, is there a way to assign to result when doing tuple unpacking? |
02:30:52 | * | mahtob quit (Quit: Leaving) |
02:30:57 | * | vendethiel quit (Ping timeout: 248 seconds) |
02:31:07 | * | mahtob joined #nim |
02:46:39 | * | vicarious_cm joined #nim |
03:20:27 | * | endragor joined #nim |
03:24:57 | * | mahtob quit (Remote host closed the connection) |
03:28:33 | * | yingjun quit (Remote host closed the connection) |
03:28:54 | * | yingjun joined #nim |
03:29:41 | * | yingjun quit (Remote host closed the connection) |
03:41:18 | * | planhths joined #nim |
03:47:25 | * | Nimbecile joined #nim |
03:50:59 | Nimbecile | thank you Araq for fixing the website (official/unofficial package lists)! |
03:51:38 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
03:52:51 | * | Nimbecile left #nim (#nim) |
04:01:25 | * | PMunch quit (Remote host closed the connection) |
04:08:18 | * | yingjun joined #nim |
04:16:28 | * | pilne quit (Quit: Quitting!) |
04:25:22 | * | yingjun quit (Remote host closed the connection) |
04:25:37 | * | yingjun joined #nim |
04:26:34 | * | yingjun quit (Remote host closed the connection) |
04:31:41 | * | yingjun joined #nim |
04:36:11 | * | yingjun quit (Remote host closed the connection) |
04:37:23 | * | def-pri-pub quit (Quit: leaving) |
04:50:35 | * | yingjun joined #nim |
05:02:15 | * | planhths quit (Quit: Konversation terminated!) |
05:29:22 | * | rauss quit (Quit: WeeChat 1.9) |
05:32:15 | * | tankfeeder joined #nim |
05:32:22 | tankfeeder | morning |
05:33:34 | tankfeeder | why i cant compile this one: |
05:33:36 | tankfeeder | http://ideone.com/ALPMch |
05:33:37 | tankfeeder | ? |
05:43:37 | * | dankrad quit (Ping timeout: 260 seconds) |
06:14:47 | * | Vladar joined #nim |
06:22:01 | FromGitter | <mratsim> Once again, someone confused and applying Python import logic to Nim. We need a specific page dedicated to Python import: https://www.reddit.com/r/nim/comments/6oa1jf/nim_newbie_got_a_few_questions/dkkh9bm/ |
06:23:49 | * | nsf joined #nim |
06:53:05 | * | yingjun quit (Remote host closed the connection) |
06:53:17 | * | yingjun joined #nim |
06:54:15 | * | yingjun quit (Remote host closed the connection) |
07:02:49 | * | yingjun joined #nim |
07:06:00 | * | vendethiel joined #nim |
07:08:03 | Araq | tankfeeder: because the template parameter is also substituted in foo.param |
07:08:09 | Araq | and that's a *feature* |
07:08:21 | Araq | so that you can abstract over the field name |
07:09:31 | tankfeeder | Does workaround exists? |
07:09:49 | tankfeeder | Or leave as is |
07:12:52 | tankfeeder | Cant abstract over field name |
07:15:04 | Araq | workaround: choose different template parameter names |
07:15:25 | FromGitter | <mratsim> http://ideone.com/6csLI0 |
07:15:37 | tankfeeder | Ok |
07:16:07 | tankfeeder | Aaaaa, i see |
07:16:20 | tankfeeder | Mratsim, thanks |
07:16:51 | FromGitter | <mratsim> you’re welcome |
07:26:51 | * | yglukhov joined #nim |
07:28:58 | tankfeeder | if i have template i want do different things based on input parameter type |
07:29:48 | tankfeeder | can i do it without typetraits + x.type.name ? |
07:32:33 | FromGitter | <mratsim> You can overload the template |
07:33:20 | * | irrequietus joined #nim |
07:33:23 | FromGitter | <mratsim> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5975a2c345fc670746bedf48] |
07:33:36 | FromGitter | <ephja> "x.type is T"? |
07:34:12 | * | irrequietus quit (Client Quit) |
07:35:08 | FromGitter | <mratsim> Ah yes, like ephja said you can use `when x is T` as well (no x.type) |
07:37:29 | tankfeeder | ok |
07:40:35 | * | vicarious_cm quit (Ping timeout: 240 seconds) |
07:40:52 | * | rnrwashere joined #nim |
07:53:39 | * | ftsf joined #nim |
08:10:33 | * | rnrwashere quit (Remote host closed the connection) |
08:14:13 | * | Calinou quit (Remote host closed the connection) |
08:15:21 | * | Calinou joined #nim |
08:20:10 | * | vendethiel quit (Ping timeout: 255 seconds) |
08:20:41 | * | yingjun quit (Remote host closed the connection) |
08:24:01 | * | yingjun joined #nim |
08:25:03 | * | yingjun quit (Remote host closed the connection) |
08:26:47 | * | yingjun joined #nim |
08:42:35 | * | dom96|w joined #nim |
09:14:33 | * | dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
09:18:16 | * | dom96|w joined #nim |
09:46:43 | * | user0 joined #nim |
09:47:10 | user0 | What's the equivalent of member functions in Nim? And what's the syntax for it? |
09:51:05 | euantor | I've not used C++ before, but it looks like you might be looking for methods? https://nim-lang.org/docs/tut2.html#object-oriented-programming-methods |
09:51:49 | euantor | Might be best to describe what you're trying to do - methods provide dynamic dispatch, which often isn't actually needed |
09:57:11 | * | couven92 joined #nim |
09:57:45 | user0 | I am defining an object. While doing so, I want to find a derived value of it. For example, in a rectangle object, there's x, y, height, width and midpoint. midpoint is a derived value, how can I define midpoint? midpoint = (x + width / 2, y + length / 2) does not work, initialization does not work there |
09:59:58 | Vladar | proc midpoint(rect: Rect): float |
10:00:27 | * | yingjun quit (Remote host closed the connection) |
10:02:48 | * | arnetheduck joined #nim |
10:02:48 | user0 | Any wat to get the proc inside Type? |
10:02:53 | * | endragor quit (Remote host closed the connection) |
10:03:45 | * | yingjun joined #nim |
10:03:48 | * | yingjun quit (Remote host closed the connection) |
10:03:49 | * | endragor joined #nim |
10:04:16 | * | yingjun joined #nim |
10:04:41 | * | mahtov2 joined #nim |
10:09:48 | euantor | You cna define it as a property of the object, like the STream type does |
10:10:06 | euantor | https://github.com/nim-lang/Nim/blob/master/lib/pure/streams.nim#L48 |
10:10:22 | euantor | But the idiomatic approach is to simply use a proc as above |
10:11:02 | user0 | Thanks |
10:25:34 | * | mahtov2 quit (Ping timeout: 258 seconds) |
10:34:16 | * | endragor quit (Remote host closed the connection) |
10:34:25 | * | mahtov joined #nim |
10:36:04 | * | endragor joined #nim |
10:48:31 | * | ShalokShalom joined #nim |
10:56:10 | * | endragor quit (Remote host closed the connection) |
10:56:41 | * | yingjun quit (Remote host closed the connection) |
10:57:33 | * | endragor joined #nim |
11:02:36 | * | yingjun joined #nim |
11:08:34 | * | Snircle joined #nim |
11:12:51 | FromGitter | <Varriount> user0: You can also do tricks overloading the "." Operator |
11:20:10 | * | mahtov quit (Read error: Connection reset by peer) |
11:20:48 | * | mahtov joined #nim |
11:34:17 | * | dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
11:40:31 | * | pwntus quit (Changing host) |
11:40:32 | * | pwntus joined #nim |
11:41:06 | * | pwntus is now known as Pwntus |
11:41:57 | * | tankfeeder quit (Quit: Connection closed for inactivity) |
11:58:34 | * | yingjun quit (Remote host closed the connection) |
11:58:43 | * | yingjun joined #nim |
11:59:34 | * | yingjun quit (Remote host closed the connection) |
12:14:45 | * | dom96|w joined #nim |
12:56:10 | FromGitter | <zacharycarter> o/ morning |
13:00:11 | * | yingjun joined #nim |
13:04:29 | * | yingjun quit (Ping timeout: 246 seconds) |
13:09:25 | * | dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
13:10:48 | * | Jipok[m] quit (Quit: Bridged client killed) |
13:14:35 | euantor | I wonder if changing `gettimeofday` to `clock_gettime` as described here is worthwhile in the "times" module... http://pzemtsov.github.io/2017/07/23/the-slow-currenttimemillis.html |
13:15:37 | crem | Is there any live demo of nim app compiled to javascript which runs in browser which is not a game (or a game but not canvas-based)? |
13:16:14 | euantor | crem: The JS for the playground is written in Nim: https://play.nim-lang.org/ |
13:16:16 | * | stisa quit (Quit: Bridged client killed) |
13:16:53 | crem | thanks! |
13:20:17 | crem | Nim is much more impressive than I initially thought! I wanted to take a closer look for a few years already, but now I finally read through all the docs, and walking impressed the whole week. :) |
13:26:12 | * | v17d joined #nim |
13:27:36 | * | rauss joined #nim |
13:43:46 | * | krux02 joined #nim |
13:45:22 | krux02 | crem: then welcome to the Nim world |
13:45:42 | krux02 | Nim also impressed me when I started with it |
13:46:55 | krux02 | but be warned when I started with it, I realized Nim is not the Hold Grail of programming languages as well. It has its flaws, too. But nothing I found was fundamentally wrong. |
13:47:10 | krux02 | It's just the standard library could be improved |
13:47:21 | krux02 | and here and there a few tweaks |
13:51:55 | crem | There are things that I don't like much too. Like that language's syntax is too permissive, or that all metaprogramming related stuff is a bit too clever, or that when reading the source code and some identifier from some library is used, there's no way to find out from where it's imported. But in general it's really impressive. |
13:58:04 | krux02 | crem: well there is nimsuggest so the question from where something is imported could be solved |
13:58:53 | krux02 | I can imagine some colorful highlighting that emits a differnt color for each imported package so that you instantly see it. Or you use jump to definition. |
13:59:25 | krux02 | And the permissiveness of the syntax, you get used to it. |
13:59:44 | krux02 | So did I get used ot indentation based syntax |
14:05:10 | * | dom96|w joined #nim |
14:10:46 | * | yglukhov quit (Remote host closed the connection) |
14:19:29 | * | yglukhov joined #nim |
14:19:58 | * | yglukhov quit (Remote host closed the connection) |
14:23:00 | * | couven92 quit (Quit: Client disconnecting) |
15:01:52 | * | yingjun joined #nim |
15:03:07 | * | koranza joined #nim |
15:06:05 | * | yingjun quit (Ping timeout: 240 seconds) |
15:06:21 | * | yglukhov joined #nim |
15:06:26 | krux02 | well I have problems with nimsuggest |
15:06:43 | krux02 | in emacs I always get the following error message |
15:06:56 | * | Trustable joined #nim |
15:07:24 | krux02 | http://ix.io/yFD |
15:07:26 | krux02 | it sucks |
15:07:38 | krux02 | because it there is constantly broken with nim-mode |
15:12:17 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
15:13:07 | * | tankfeeder joined #nim |
15:19:48 | * | v17d quit (Ping timeout: 240 seconds) |
15:28:38 | krux02 | Araq: can you help me to get he epc nimsuggest working again? |
15:32:36 | * | v17d joined #nim |
15:33:05 | * | yglukhov quit (Remote host closed the connection) |
15:36:44 | * | yglukhov joined #nim |
15:41:52 | * | yglukhov quit (Ping timeout: 276 seconds) |
15:50:40 | demi- | krux02: that is weird; i don't get that error on my systems |
15:51:15 | krux02 | demi-: I don't know what the problem for this can be |
15:51:38 | demi- | :( |
15:51:48 | krux02 | I try to improve nim-mode but I did not change anything epc mode related |
15:56:04 | * | couven92 joined #nim |
15:57:40 | krux02 | well aparently it has something to do with my local changes to nim-mode |
15:57:45 | krux02 | but I can't explain it :/ |
15:58:03 | koranza | Hi everyone, newbie question about the times module |
15:58:16 | koranza | I have a string as input following ISO 8601 format and I wish to print it to the console in my local time zone (which is CDT). How do I go about doing that? |
15:58:36 | koranza | I created an example here: https://glot.io/snippets/es11d5cfrb |
15:58:47 | koranza | I'm not sure if everyone can see it though |
16:00:11 | krux02 | well there is a parse procedure in the times module |
16:00:13 | krux02 | try using that |
16:00:24 | koranza | these 2 lines return the same result: |
16:00:25 | koranza | echo format(parse(INPUT, INPUT_FORMAT),OUTPUT_FORMAT) |
16:00:30 | koranza | echo format(getLocalTime(parse(INPUT, INPUT_FORMAT).toTime),OUTPUT_FORMAT) |
16:00:39 | koranza | where INPUT = "2017-07-11T20:20:06.964230Z" |
16:00:44 | koranza | INPUT_FORMAT = "yyyy-mm-ddTHH:mm:ssZ" |
16:00:48 | koranza | OUTPUT_FORMAT = "ddd d MMMM yyyy HH:mm" |
16:02:58 | krux02 | well there is a dot before the Z |
16:03:07 | krux02 | or should be |
16:03:11 | krux02 | and why is it capital z |
16:03:16 | * | endragor quit (Remote host closed the connection) |
16:03:34 | krux02 | what is capital Z in format? |
16:09:03 | FromGitter | <Varriount> Timezone? |
16:10:45 | krux02 | demi-: are you using nimsuggest? |
16:11:01 | krux02 | or are you doing default flycheck? |
16:11:23 | koranza | as I understand it, the "dot" in the input is fractions of a second. removing the decimal places doesn't seem to make a difference |
16:12:41 | koranza | and I believe a capital letter "Z" is shorthand for a timezone offset from UTC of 0 |
16:13:57 | koranza | in javascript, when i print to console I get the desired outcome of printing 15hr instead of 20hr on a 24hr clock |
16:13:59 | koranza | console.log(new Date("2017-07-11T20:20:06Z")); |
16:17:44 | * | nsf quit (Quit: WeeChat 1.9) |
16:26:09 | * | yglukhov joined #nim |
16:28:43 | * | endragor joined #nim |
16:31:16 | * | yglukhov quit (Ping timeout: 276 seconds) |
16:32:54 | * | endragor quit (Ping timeout: 240 seconds) |
16:47:53 | * | UxerUospr joined #nim |
16:48:37 | * | UxerUospr quit (Client Quit) |
16:49:08 | * | UxerUospr joined #nim |
16:54:24 | * | yglukhov joined #nim |
16:58:35 | * | Sentreen quit (Ping timeout: 240 seconds) |
17:00:05 | * | itseris joined #nim |
17:05:43 | * | eldiz quit (Ping timeout: 276 seconds) |
17:09:39 | * | sz0 joined #nim |
17:11:35 | * | Sentreen joined #nim |
17:20:43 | * | Jesin quit (Quit: Leaving) |
17:25:35 | * | dankrad joined #nim |
17:54:50 | * | nsf joined #nim |
17:57:52 | * | itseris quit (Quit: Konversation terminated!) |
18:04:07 | * | yingjun joined #nim |
18:08:17 | * | yingjun quit (Ping timeout: 246 seconds) |
18:09:41 | krux02 | still somebody online? |
18:12:29 | Araq | yes |
18:19:34 | krux02 | Araq: what do you think about my pull requests? |
18:19:48 | krux02 | I still have two pull requests open where all tests pass |
18:34:59 | dom96 | hi guys, how are things? |
18:35:46 | * | arnetheduck quit (Ping timeout: 255 seconds) |
18:36:26 | FromGitter | <zacharycarter> o/ dom96 |
18:38:43 | dom96 | sup zacharycarter? |
18:39:11 | FromGitter | <zacharycarter> not much dom96, working on that Nim aws lambda project I got going last thursday |
18:39:14 | FromGitter | <zacharycarter> along with zengine |
18:39:15 | FromGitter | <zacharycarter> you? |
18:39:36 | dom96 | reviewing my books index :) |
18:39:42 | dom96 | Almost in print! |
18:39:51 | dom96 | I can almost smell the pages... |
18:40:29 | FromGitter | <zacharycarter> YES! |
18:41:07 | Araq | krux02: reading it again ... |
18:43:42 | dom96 | also got together with federico3 last Saturday (we are both in Dublin now :)) and we worked on his Nimble package site. |
18:44:17 | dom96 | I improved the frontend design and he worked on getting more info out of GitHub (and still is working on that). |
18:44:32 | Araq | cool, I have a prototype to get rid of forwarding requirements, kind of |
18:47:37 | FromGitter | <zacharycarter> awesome |
18:49:34 | FromGitter | <zacharycarter> I need to work more on aws lambda + Nim this week |
18:49:56 | FromGitter | <zacharycarter> might be able to start writing lambda jobs at Carfax in Nim soon |
18:52:31 | krux02 | Araq: I am using macros a lot. Does the getting rid of worward requirements change the way macros are evaluated in any way? |
18:52:54 | FromGitter | <zacharycarter> someone linked to http://primitive.io/ at work - looks like the worst thing ever |
18:53:10 | Araq | krux02: the idea is: |
18:53:23 | Araq | - sort the declartions by their dependency requirements |
18:53:29 | Araq | - proceed as before |
18:53:52 | Araq | so ... yeah, macros are affected but it's still predicatable |
18:54:23 | Araq | and code that works today will not be affected |
18:54:59 | krux02 | with macros, the declarations are not yet known before macro evaluation |
18:55:16 | Araq | also you can see the order via some switch --dumpReorderedAst |
18:55:20 | krux02 | and befor macro evaluation some symbols might be required to be known |
18:55:43 | krux02 | that is what I always liked in nim, that all symbols that were before the macro could be used in a typed macro |
18:55:43 | Araq | oh yeah I know, it sorts by their "superficial" dependencies |
18:56:12 | Araq | so you can trick it easily, but it covers 95% of the code out there, afaict |
18:56:41 | krux02 | So I can still think of Nim like it was before? |
18:56:56 | Araq | I hope so, it's a research project |
18:57:00 | Araq | we'll see. |
18:57:14 | Araq | I mean my .noforward idea is a research project |
18:57:43 | krux02 | I am still a bit skeptical, not that I don't think it's cool, but I prefer to understand things than to have things that are convenient |
18:58:07 | Araq | I've seen it work for stuff like: |
18:58:17 | Araq | when defined(windows): proc foo = ... |
18:58:24 | Araq | when not declared(foo): proc foo = ... |
18:58:35 | Araq | so I'm quite optimistic it works out :-) |
18:59:28 | krux02 | So when I am correct it is a trivial reorder preprocess? |
19:00:31 | dom96 | Araq: Awesome. I'm still 100% behind this. |
19:00:35 | * | Trustable quit (Remote host closed the connection) |
19:00:40 | dom96 | Of course, time will tell how well it works :) |
19:00:55 | Araq | krux02: yup, a preorder pass |
19:10:53 | * | v17d quit (Ping timeout: 240 seconds) |
19:12:21 | krux02 | I hope it doesn't preorder the sideffects of macros |
19:12:34 | krux02 | but yea when you release it, I will break it :P |
19:13:03 | Araq | krux02: it only reorders top level declarations |
19:13:11 | Araq | before macro invocations |
19:13:16 | Araq | nothing else. |
19:18:49 | * | dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
19:20:12 | * | Sembei joined #nim |
19:25:55 | * | UxerUospr quit (Quit: Lost terminal) |
19:33:09 | euantor | Out of interest, what other things are you looking to pull from GitHub for the Nimble project site federico3/dom96? Are we eventually going to have an NPM/crates.io site that allows submitting the packages to it rather than just having a flat JSON file on GitHub? |
19:33:29 | dom96 | that's the plan indeed |
19:33:42 | euantor | Nice. Sounds good to me |
19:33:45 | dom96 | federico3 wants package signatures of some sort as well |
19:33:50 | * | ipjk joined #nim |
19:34:03 | euantor | Yes, that would be great, so that versions can't be silently changed |
19:35:08 | euantor | Liking the simple issue of "Improve design and layout" |
19:37:12 | * | krux02 quit (Remote host closed the connection) |
19:49:12 | crem | When compiling to js, are strings still of 8-bit chars? To which js data structure are they mapped? |
19:49:33 | yglukhov | crem: yes, arrays of numbers |
19:50:57 | * | Sentreen quit (Ping timeout: 240 seconds) |
19:51:21 | crem | Is there anything mapped to javascript strings? cstring? |
19:52:03 | * | PMunch joined #nim |
19:53:20 | Araq | crem: yeah and it kinda sucks :-) |
20:00:53 | crem | yeah unicode support in general could be better. :-\ There's no "unicode string" objects anywhere in library, is there? |
20:02:36 | PMunch | crem, well string is unicode |
20:03:00 | crem | No it's not. |
20:03:38 | crem | I've just tried readLine(stdin) (windows) and returned string is in some single-byte encoding. |
20:04:38 | * | Sentreen joined #nim |
20:05:41 | * | yingjun joined #nim |
20:07:40 | crem | Also while utf-8 is probably the best encoding for storage and data exchange, for string processing it's not that good. In python and go I believe they change the string on the fly, it's 1 byte per char while it's all ascii (possibly they even remap non-ascii ranges to keep it 1-byte) and then it's either 2 or 4. |
20:08:05 | Araq | yeah pretty sure Go doesn't do that |
20:08:36 | crem | ah go is also utf-8 |
20:08:47 | crem | yeah, now I remember. |
20:09:09 | crem | Then it's python for sure. :) |
20:09:21 | * | mahtob joined #nim |
20:09:53 | * | yingjun quit (Ping timeout: 240 seconds) |
20:11:40 | crem | Are there plans of separating unicode strings from strings of bytes, making both first class citizens? :) I really like how it's done in python3. |
20:12:08 | Araq | I really hate Python3's way of doing things, so no. |
20:16:35 | * | v17d joined #nim |
20:21:27 | * | dankrad quit (Ping timeout: 240 seconds) |
20:25:53 | PMunch | crem, Unicode is just a way of reading a string of bytes. They are not fundamentally different in how they are stored. |
20:29:15 | crem | yeah I know. It's just sometimes easier to manipulate them when they are in UTF-16 or UTF-32 that UTF-8. Actually it's not much of a problem indeed, just need to remember not to address characters by index, to use special iterator etc. |
20:30:11 | crem | In sublime's nimlime, now to prevent it to spawn "nimlime" tab on every save? Turns out I have a habit to hit Ctrl+S a lot. |
20:31:01 | * | sz0 quit (Quit: Connection closed for inactivity) |
20:32:35 | * | Snircle joined #nim |
20:33:32 | * | Matthias247 joined #nim |
20:43:07 | * | arnetheduck joined #nim |
20:44:38 | * | itseris joined #nim |
20:45:30 | * | Vladar quit (Remote host closed the connection) |
20:51:58 | * | rauss quit (Quit: WeeChat 1.9) |
20:54:41 | * | krux02 joined #nim |
20:58:22 | krux02 | crem: well the entire point of utf8 is that it is compatible with all ASCII libraries that don't treat characters in the range 128-255 at all. |
20:58:49 | crem | Is there more canonical way to pass a proc with bound parameters, than to create a closure function which calls that proc with parameters? |
20:59:20 | krux02 | you want to do currying? |
20:59:46 | krux02 | well there are several things you can do |
20:59:54 | krux02 | one thing is a template |
21:00:05 | crem | Yes. But I don't need partial application, full application is fine. |
21:00:25 | krux02 | but you don't want to execute the function? |
21:00:37 | crem | correct |
21:01:01 | krux02 | I don't think there is a canonical way of doing it |
21:01:18 | krux02 | I even think it's a dangerous method of programming |
21:01:47 | krux02 | I assume you don't want to execute the function before you pass it, because you want the side effects |
21:02:12 | krux02 | and an anonymous function that has (side-)effects I consider as dangerous |
21:02:31 | krux02 | Therefore I would give that function a name |
21:02:47 | Araq | crem: default parameters? |
21:03:01 | krux02 | proc do-something(): void = foo(arg1,arg2,arg3) |
21:03:51 | * | koranza_ joined #nim |
21:03:53 | crem | It doesn't really matter whether it has a name or not. Default params... Probably won't work. I wanted to try a callback pattern. |
21:04:16 | krux02 | well you can still do this |
21:04:44 | krux02 | anonymous functions |
21:04:59 | krux02 | proc(): void = f(arg1,arg2,arg2) |
21:05:08 | krux02 | now you have bound arguments to f |
21:05:41 | crem | Yes, that's what I said, classical closure would work. I just wanted to confirm there's no syntaxic sugar for that. nim seems to be pretty sweet language in terms of amount of sugar. :) |
21:06:12 | krux02 | well I don't know of any std::bind equivalent |
21:06:23 | krux02 | and even in c++ bind is something that afaik should not be used |
21:07:35 | * | koranza quit (Ping timeout: 240 seconds) |
21:08:35 | dom96 | A curry proc is always welcome in the stdlib |
21:12:00 | Araq | future.nim has more sugar for anon procs |
21:12:14 | Araq | (a, b) => foo(2, a, 4, b) |
21:14:43 | * | dankrad joined #nim |
21:17:12 | * | koranza_ quit (Quit: leaving) |
21:24:39 | * | rauss joined #nim |
21:34:07 | * | madmalik quit (Quit: Connection closed for inactivity) |
21:37:21 | * | Jesin joined #nim |
21:44:52 | * | arnetheduck quit (Ping timeout: 268 seconds) |
21:49:37 | * | v17d quit (Ping timeout: 260 seconds) |
22:00:58 | * | ipjk quit (Quit: Leaving) |
22:03:24 | * | krux02 quit (Remote host closed the connection) |
22:07:11 | * | yingjun joined #nim |
22:11:23 | * | yingjun quit (Ping timeout: 240 seconds) |
22:27:52 | * | Matthias247 quit (Read error: Connection reset by peer) |
22:27:58 | * | nsf quit (Quit: WeeChat 1.9) |
22:42:18 | * | itseris quit (Read error: Connection reset by peer) |
22:42:38 | * | itseris joined #nim |
23:02:38 | * | tankfeeder quit (Quit: Connection closed for inactivity) |
23:23:22 | * | mfx joined #nim |
23:30:47 | * | yglukhov quit (Remote host closed the connection) |
23:31:00 | * | yglukhov joined #nim |
23:31:02 | * | yglukhov quit (Remote host closed the connection) |
23:42:37 | * | mfx quit (Quit: Leaving) |
23:43:53 | * | mfx joined #nim |