<< 07-01-2016 >>

00:02:23Araq_ldlework: Rust does the same ... I've never heard that Rust is full of implicit stuff, quite the contrary
00:02:36ldleworkdom96: #reddit-gamedev
00:03:12ldleworkI forgot how much continuous type casting there is in nim
00:09:11*^aurora^ joined #nim
00:10:01dom96Such a mature channel.
00:17:05Araq_it's reddit, what did you expect?
00:37:06*brson quit (Ping timeout: 240 seconds)
00:43:12ldleworkdom96: its a mixed bag for sure
00:43:22ldleworkCan someone help me write a weighted choice function?
00:45:11ldleworklike lets say I have some sort of mapping structure that maps arbitrary ints to procs
00:45:21ldleworkAnd I want to call a proc randomly based on the associated weights
00:56:46ldleworkCan you have procs as table values?
00:58:17ldleworkdom96: poke
01:06:40dom96Table[string, proc ()] might work
01:06:46dom96I need to go, see you later
01:14:31*brson joined #nim
01:20:17*vikaton joined #nim
01:38:08*^aurora^ quit (Quit: My Mac has gone to sleep. ZZZzzz…)
01:40:00*Jesin joined #nim
01:56:34ldleworkwhy is abs not in the math module?
02:48:52Araq_it's in system.nim
02:51:54ldleworkAraq_: can you help me with some nim thinking?
02:52:18ldleworkwell actually I'm onto something maybe I don't need that
02:52:21Araq_if it can be done in 8 minutes
02:53:03ldleworkhehe dunno, I'll just keep at it
02:59:17ldleworkhmm am I dumb? How do I sort a sequence?
02:59:47ldleworkah, random stdlib module
03:01:28ldleworkI wonder if I can just do values.sort(cmp)
03:02:34Araq_import algorithm
03:03:05ldlework map = initTable[float, proc()]
03:03:23ldleworkError: 'initTable' cannot be passed to a procvar
03:03:42ldleworknot sure what that means
03:04:52ldleworkanyone around know how to create a table to procs?
03:05:35ldlework:/
03:06:16ldleworkdef-: you around?
03:06:33Araq_initTable[float, proc()]()
03:06:48Araq_you need to call it. create an issue we can easily improve the error message
03:06:55Araq_and now I have to sleep sorry.
03:08:39ldlework map[rn] = redColor
03:08:47ldleworkmaxnoise.nim(46, 6) Error: could not resolve: map[rn]
03:12:15*vendethiel joined #nim
03:13:03Araq_import tables
03:15:04ldleworkAraq_: I did
03:15:57ldleworkhere's the snippet, https://gist.github.com/dustinlacewell/4799028d8c145386e6ae
03:17:47ldleworkhere's the whole file: https://gist.github.com/dustinlacewell/54ded16bfaabbb9a7de9
03:18:47ldleworknim communityyyyyyyy
03:19:00ldleworkhalp, I'm trying the simple act of making a float->callable hash mapppp
03:22:08ldleworkBlaXpirit: any chance you can help me out
03:23:41ldleworkonionhammer: you around maybe?
03:23:44Araq_ldlework: it's strange, I'm looking at it
03:27:34Araq_ah ok
03:27:56ldleworkphew
03:28:07Araq_ map = initTable[float, proc(diff:float): Color]()
03:28:17Araq_your proc types are incompatible
03:28:28Araq_it needs to have the proper return type
03:28:33Araq_good night.
03:29:53ldleworkthank youuuuu
03:30:45ldleworkit seems strange that it needs the name of the argument to the proc
03:30:47ldleworkie 'diff'
03:35:18*brson quit (Ping timeout: 256 seconds)
03:36:06*vendethiel quit (Ping timeout: 265 seconds)
03:47:56Araq_from future import `->`
03:56:06*pregressive joined #nim
03:59:31ldleworkhow do you specify return type with => ?
03:59:59ldleworkoh
04:00:13ldleworkwoah I crashed gcc
04:19:20*vqrs quit (Ping timeout: 255 seconds)
04:23:11*vqrs joined #nim
04:37:50onionhammerldlework what's up?
04:38:40onionhammeroh good u resolved it ;)
04:38:43onionhammerbbl
05:30:02ldlework:( https://gist.github.com/dustinlacewell/9a9bf21cdc8ee5bf8e9b
05:30:55ldleworkoh
05:31:11ldleworknice
05:31:28ldleworknot sure why it can't infer the type of 'd' there though
05:33:44*darkf joined #nim
05:42:28ldleworkhi darkf
05:44:06darkfhello
05:47:53ldlework:)
05:47:59*BitPuffin|osx quit (Ping timeout: 255 seconds)
05:50:34ldleworkhow do I iterate over a sequence of generic objects?
05:54:07reactormonkldlework, what's a "generic" object?
05:54:16ldleworkan instance of a generic type
05:54:30ldleworkbut I'm guessing you just do "for i in sequence" and it infers
05:54:32reactormonkWhat do you know about this generic?
05:54:49ldleworkeverything I guess
05:55:16reactormonkWhat does the compiler know about this generic - no constraits, so I assume nothing?
05:57:00ldleworkits just a "type Foo[T] = object attr: T" like thing
06:05:49ldleworkwat, Error: type mismatch: got (typedesc[Biome[getBiomeValue.T]]) but expected 'typedesc[Biome[getBiomeValue.T]]'
06:07:21ldleworkon this line: proc getBiomeValue[T](x, y: int, biomes: @[Biome[T]]): T =
06:07:39ldleworkreactormonk: what might be wrong here?
06:07:43ldleworkI can paste the whole file if needed
06:08:27reactormonkI don't know, looks good to me.
06:08:34ldlework:(
06:09:26ldleworkreactormonk: I wonder if the parens around the first part of the error means anything
06:09:33ldleworkno idea what that could be though..
06:10:08reactormonkbtw, I'd put the binomes first in the argument list, so you can go binomes.getBinomeValue(x, y)
06:10:23reactormonkalso, [] might be a simpler name here
06:10:23*def- quit (Ping timeout: 264 seconds)
06:10:24ldleworkoh
06:10:33ldleworkreactormonk: what do you mean
06:11:03reactormonkYou could call your method `[]`, so you can binomes[x, y]
06:11:09reactormonk... IIRC that's how it works
06:11:14ldleworkhuh
06:11:37ldleworkwould that be
06:11:51ldleworkbiomes[x,y][Color] ?
06:11:56ldleworksince I need to specify the type?
06:13:01reactormonkI think then you'd have to do binomes.`[]`[Color](x, y)
06:13:10reactormonkbut you don't really need to specify the type
06:15:04ldleworkreactormonk: mind if I gist the file?
06:15:10*def- joined #nim
06:16:01reactormonkCan't promise to take a look
06:17:01ldleworkwell, if you change your mind, https://gist.github.com/dustinlacewell/a63e69ab20bd4c802ab3
06:22:11ldleworkbaffling
06:24:21ldleworkdef-: ever seen anything like this?
06:26:51*ldlework pokes onionhammer
06:29:27ldleworksolved it
06:29:32ldleworkI think?
06:32:02ldleworkcool segfault
06:32:04ldlework:D
06:32:48ldleworkyay
06:32:50ldleworkit works
06:35:26*nastavnic joined #nim
06:48:06*vikaton quit (Quit: Connection closed for inactivity)
06:53:35*nastavnic quit (Ping timeout: 240 seconds)
06:54:49*buMPnet quit (Quit: No Ping reply in 180 seconds.)
06:56:02*buMPnet joined #nim
06:58:08*nastavnic joined #nim
07:06:37*desophos quit (Read error: Connection reset by peer)
07:18:24*krux02 quit (Remote host closed the connection)
07:55:10*nastavnic quit (Ping timeout: 276 seconds)
07:55:50*Demon_Fox quit (Quit: Leaving)
07:56:30*Demon_Fox joined #nim
08:00:02*nastavnic joined #nim
08:12:23*yglukhov joined #nim
08:52:42*yglukhov quit (Remote host closed the connection)
08:53:21*yglukhov joined #nim
08:57:35*yglukhov quit (Ping timeout: 240 seconds)
09:02:36*zepolen quit (Read error: Connection reset by peer)
09:03:11*zepolen joined #nim
09:12:35*nastavnic quit (Ping timeout: 240 seconds)
09:16:55*coffeepot joined #nim
09:19:47*Demon_Fox quit (Quit: Leaving)
09:34:41*darkf quit (Read error: Connection reset by peer)
09:35:23*darkf joined #nim
09:50:04*jaco60 quit (Ping timeout: 250 seconds)
09:56:14*octoploid quit (Quit: WeeChat 1.3-rc1)
09:57:33*octoploid joined #nim
09:58:13*coffeepot quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
09:58:42*coffeepot joined #nim
10:03:55*jaco60 joined #nim
10:04:28*yglukhov joined #nim
10:05:14*themagician quit (Ping timeout: 250 seconds)
10:08:46*yglukhov quit (Ping timeout: 240 seconds)
10:32:52*yglukhov joined #nim
10:40:35*jaco60 quit (Ping timeout: 240 seconds)
10:41:04*jaco60 joined #nim
10:57:52*ephja joined #nim
10:58:15*jaco60 quit (Ping timeout: 240 seconds)
10:58:40*jaco60 joined #nim
11:02:10*pregressive quit (Remote host closed the connection)
11:20:33*Sornaensis quit (Max SendQ exceeded)
11:21:06*Sornaensis joined #nim
11:30:36*jaco60 quit (Ping timeout: 250 seconds)
11:31:03*jaco60 joined #nim
11:34:41*drewsrem joined #nim
11:42:11*exebook joined #nim
11:47:56drewsremAre there compiler options in nim that help me cross-compiling on a linux-system producing windows executables?
11:56:13*yglukhov_ joined #nim
11:56:14*yglukhov quit (Read error: Connection reset by peer)
11:58:10drewsremnvm. just saw --os
11:58:15*jaco60 quit (Ping timeout: 260 seconds)
11:59:11*jaco60 joined #nim
12:03:12*Gonzih quit (Quit: WeeChat 1.3)
12:05:42*jaco60 quit (Ping timeout: 250 seconds)
12:09:59*xet7 quit (Ping timeout: 276 seconds)
12:18:13*lcm quit (Quit: Page closed)
12:24:55*xet7 joined #nim
12:36:08*yglukhov_ quit (Remote host closed the connection)
12:44:59*zepolen quit (Read error: Connection reset by peer)
12:45:48*zepolen joined #nim
13:09:15*Guest10472 quit (Changing host)
13:09:15*Guest10472 joined #nim
13:09:15*Guest10472 quit (Changing host)
13:09:15*Guest10472 joined #nim
13:09:22*Guest10472 is now known as Heartmender
13:22:42*themagician joined #nim
13:27:33*BitPuffin joined #nim
13:49:12*BlaXpirit quit (Quit: Bye)
14:10:39*ephja quit (Quit: WeeChat 1.3)
14:14:52*coffeepot quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
14:15:02*coffeepot joined #nim
14:21:17*yglukhov joined #nim
14:25:35*yglukhov quit (Ping timeout: 260 seconds)
14:28:41*BlaXpirit joined #nim
14:49:22*kerze joined #nim
14:56:50*BlaXpirit quit (Quit: Bye)
14:59:19*doxavore joined #nim
14:59:49*BlaXpirit joined #nim
15:00:33*BlaXpirit quit (Client Quit)
15:01:04*BlaXpirit joined #nim
15:04:26*drewsrem quit (Quit: Leaving)
15:19:18federico3sounds like theduke disappeared and never came back - we lost another one - again.
15:40:11dom96It happens unfortunately. You don't know though, maybe theduke will come back. Maybe theduke is just busy.
15:51:28*AckZ quit (Ping timeout: 250 seconds)
15:52:19*AckZ joined #nim
16:04:50*jaco60 joined #nim
16:23:39*BlaXpirit left #nim ("Bye")
16:23:41*BlaXpirit joined #nim
16:33:34*Jesin quit (Quit: Leaving)
16:42:32*zepolen quit (Remote host closed the connection)
16:46:06coffeepotjust looked at the github updates - is assert begin changed to doAssert?
16:46:34coffeepotif so, how come?
16:46:35*brson joined #nim
16:47:16coffeepotjust curious
16:58:04*nastavnic joined #nim
17:07:41*coffeepot quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
17:13:47*nastavnic quit (Ping timeout: 255 seconds)
17:24:40*Jesin joined #nim
17:32:05dom96coffeepot: No. doAssert and assert are similar but slightly different
17:32:13dom96the latter is removed in release mode
18:14:36*gmpreussner quit (Ping timeout: 264 seconds)
18:19:27*brson quit (Quit: leaving)
18:19:53*gmpreussner joined #nim
18:35:44*BitPuffin quit (Ping timeout: 256 seconds)
18:39:13*krux02 joined #nim
18:41:00krux02Araq_: I've problems implementing a getTypeImpl, but getType2 works pretty solid
18:41:49Araq_krux02: yay. now what does that mean?
18:42:33krux02I've tried a lot, but I'haven't found a way, where getTypeImpl, always goes exactly one level deeper
18:42:43*darkf quit (Quit: Leaving)
18:43:25krux02Simple structures work very good, but as far as I define something like this:
18:44:04krux02type MyName = MyGeneric[T], it creates problems
18:44:57krux02A call to getType2 should resolve MyName, if the variable is declared with that name
18:45:12krux02getTypeImpl should return MyGeneric[T]
18:46:30krux02I could make my function work on that case, that it would return MyGeneric, but not without destroying a case that worked so far
18:47:51krux02I've tried a lot, but each fix broke something else in a circulating way
18:49:02krux02 can send you what I've done so far, maybe you can see it better than me, because you are more familiar with the nim type system.
18:49:03*pregressive joined #nim
18:51:01*vendethiel joined #nim
18:52:56Araq_sure
18:55:10krux02https://github.com/krux02/Nim/blob/3816513d4705c3b2a853fc1dc3502a9cb9e8f0d4/tests/macros/tgettype.nim
18:55:38krux02that's the test file
18:56:42krux02Araq_: https://github.com/krux02/Nim/blob/3816513d4705c3b2a853fc1dc3502a9cb9e8f0d4/compiler/vmdeps.nim
18:57:28krux02at the end is opMapTypeToAst2, that's the function I implemented
19:03:55*aziz joined #nim
19:04:46*asterite joined #nim
19:16:12*kerze quit (Remote host closed the connection)
19:18:05*Demon_Fox joined #nim
19:30:06*gunn_ joined #nim
19:31:52*BlaXpirit_ joined #nim
19:32:56*nastavnic joined #nim
19:34:12*nastavnic quit (Client Quit)
19:34:15*BlaXpirit quit (Killed (verne.freenode.net (Nickname regained by services)))
19:34:15*BlaXpirit_ is now known as BlaXpirit
19:37:12*Lea2 joined #nim
19:37:18*SirCmpwn_ joined #nim
19:38:34*SirCmpwn quit (*.net *.split)
19:38:34*Learath2 quit (*.net *.split)
19:38:34*gunn quit (*.net *.split)
19:42:15*NimBot joined #nim
19:44:36*ray- joined #nim
19:45:19*SirCmpwn_ is now known as SirCmpwn
19:58:43*M-max quit (Ping timeout: 265 seconds)
20:00:56*M-max joined #nim
20:01:56*ray- quit (Ping timeout: 250 seconds)
20:04:27*ray- joined #nim
20:23:03*xet7 quit (Read error: Connection reset by peer)
20:40:58*nsf quit (Quit: WeeChat 1.3)
20:47:46*M-max quit (Ping timeout: 256 seconds)
20:49:10*M-Quora quit (Ping timeout: 250 seconds)
20:55:10*^aurora^ joined #nim
20:59:33*brson joined #nim
21:09:15*M-Quora joined #nim
21:23:40*M-Quora quit (Quit: node-irc says goodbye)
21:28:36*Jesin quit (Quit: Leaving)
21:31:44*M-Quora joined #nim
21:33:43*Trustable joined #nim
21:34:00*yglukhov joined #nim
21:35:06*desophos joined #nim
21:39:52*M-Quora quit (Ping timeout: 250 seconds)
21:50:15*ray- quit (*.net *.split)
21:50:16*aziz quit (*.net *.split)
21:50:16*dv- quit (*.net *.split)
21:51:34*ray- joined #nim
21:51:34*aziz joined #nim
21:51:34*dv- joined #nim
21:59:59*desophos quit (Remote host closed the connection)
22:00:52*bigfondue quit (Ping timeout: 256 seconds)
22:03:11*bigfondue joined #nim
22:13:55Araq_krux02: can you create a PR from that please? I will clean up and merge it if you ask for it
22:16:53krux02yes I can do it, but I have to clean a bit up by myself before that
22:24:05*desophos joined #nim
22:32:44*Trustable quit (Remote host closed the connection)
22:34:47*desophos quit (Remote host closed the connection)
22:37:17*pregressive quit (Remote host closed the connection)
22:58:46*xet7 joined #nim
23:15:13*desophos joined #nim
23:17:13*desophos_ joined #nim
23:20:32*Demon_Fox quit (Ping timeout: 255 seconds)
23:21:46*Jesin joined #nim
23:21:54*desophos_ quit (Ping timeout: 256 seconds)
23:22:21*Demon_Fox joined #nim
23:24:53ldleworkI'm going to try to port my JS data-driven entity system to Nim today. I'm nervous :(
23:25:13*ldlework has never had great luck doing data-driven anything in statically typed languages.
23:36:45*M-max joined #nim
23:38:41ldleworkis there a working repl
23:40:00*vendethiel quit (Ping timeout: 260 seconds)
23:43:18*brson quit (Ping timeout: 272 seconds)