<< 30-11-2014 >>

00:00:13ldleworkEXetoC: does Nim have like a lightweight coroutine I can use as a timer or something?
00:01:54Araqldlework: there are "closure iterators" but since they are syncronous I fail to see how they can act as timers
00:02:18Stefan_Salewski{.warning[SmallLshouldNotBeUsed]: off.} works fine. Bye.
00:02:21Araqon the other hand ... they certainly give you coroutines
00:02:36AraqStefan_Salewski: why not use a real ident instead? oh wait, generated code
00:02:40ldleworkI guess I can just use a thread
00:03:47Stefan_SalewskiYes, still glib. But nearly finished now...
00:03:51*Stefan_Salewski quit ()
00:04:29Araqldlework: I fail to see the need. nobody has to use timers who has control over the main event loop
00:04:46EXetoCglib?
00:05:00EXetoCwhat about that glib2 module?
00:05:23TriplefoxWhat kind of timer are we talking about
00:06:08ldleworkTriplefox: in 5 seconds, flip a bool
00:06:22ldleworkbut I suppose I need a full event framework
00:06:33ldleworkI did see an async io framework thing
00:06:40*Stefan_Salewski joined #nimrod
00:06:46Araqno, you need some basics wrt game loop design :P
00:07:17EXetoCloop, store the frame delta, etc
00:07:18ldleworkSure, I could implemented based on a loop and track time but so much easier with a scheduler :P
00:08:36TriplefoxThere's nothing completely ideal since it feeds into how much determinism you need in the execution
00:09:17Stefan_Salewskiexotic: latest glib2.40.2 with bigreak names scheme -- cairo is already done this way, gtk3/gdk3 needs some small fixes, remainder pango/gtksourceview will follow...
00:09:41*Stefan_Salewski quit (Client Quit)
00:09:44EXetoCwhy not run nimfix on it?
00:09:57EXetoCor good old search and replace
00:10:51Araqldlework: it's not easier. it sucks for debugging. determinism is king for games
00:12:27*Stefan_Salewski joined #nimrod
00:13:02ldleworkEXetoC: https://github.com/dustinlacewell/nimbots
00:13:39EXetoCok
00:13:53Stefan_Salewskiexetoc: When I did Gtk3 in summer, I discovered that there is some stuff missing from cairo, glib2 and others. And there are some bugs.
00:13:58EXetoCthere's a package now. just got to request inclusion in packages.json
00:14:05EXetoCStefan_Salewski: ok
00:14:53ldleworkEXetoC: heh sorry, I'm just excited
00:14:54Stefan_SalewskiSo doing it from scratch it for me the simpler and cleaner solution. We discussed that already in the Forum.
00:14:57ldleworkI'll stop pinging you about it :P
00:15:53EXetoCabout what? I'm just saying that I've added a nimble package file
00:17:20EXetoCping away
00:19:02*Stefan_Salewski quit ()
00:24:45*superfunc joined #nimrod
00:26:41ldleworkthis language is so flipping awesome
00:26:58ldleworktime to learn about typeclasses
00:27:34superfuncjust so you know, typeclasses are really experimental right now iirc
00:27:43EXetoCuser-defined ones are
00:28:11superfuncldlework: here's an article on it you might find helpful: http://vocalbit.com/posts/exploring-type-classes-in-nimrod.html
00:28:34ldleworkWhatever happened to that "oop" library I heard about before
00:28:37ldleworkthat provided traits
00:31:00ldleworkOne thing I miss in Rust is the ability to do default implementations
00:32:59EXetoCthat issue present in C++?
00:34:07ldleworkDunno
00:34:26EXetoCnm
00:34:34superfuncYou mean default implementation for a trait?
00:34:38ldleworksuperfunc: yeah
00:34:43EXetoCoop? traits?
00:34:50EXetoChaven't seen such a lib. when was that?
00:35:08superfuncA trait is essentially an interface in C++, so it has a way to do a default implementation
00:35:25ldleworklast post on this page, http://forum.nimrod-lang.org/t/278/2
00:35:27ldleworkEXetoC: ^
00:35:55ldleworkBasically I'm going to try to build a simple finite state machine
00:36:21Araqfinite state machine = closure iterator
00:36:24ldleworkAnd I'm wondering how to model it. Should I use typeclasses? Well then I don't get any default behavior for the states.
00:36:32ldleworkThen I could use inheritance
00:36:32Araqor a 'case' statement
00:37:01Araqnobody who hasn't lost his mind models state machines with inheritance
00:37:25ldleworkAraq: I don't want to use inheritance from the user perspective of the library
00:37:35ldleworkjust provide a base class which some book-keeping functionality built in
00:37:41*Trustable quit (Quit: Leaving)
00:37:47ldleworkand you inherit from that and override one or two methods
00:38:36Araqyeah I've heard that before
00:38:46Araqdid that ever work? :P
00:38:58ldleworkSure, I've used that pattern for many years in Python
00:39:35Araqso the answer is 'no'
00:40:07*ldlework shrugs
00:55:20EXetoCldlework: I should've patched the existing lib though
00:56:02EXetoChe seems to be using int sometimes when it should be cint
00:57:36*wire_s joined #nimrod
00:57:58ldleworkEXetoC: We never know if that guy is ever going to maintain that thing
00:58:02ldleworkSo I'm glad you made a new one
00:58:25Araqhi wire_s welcome
00:59:09ldleworkHmm, I can't have a generic type as a struct attribute type?
00:59:12EXetoCit's easy to fork it
01:00:03ldleworkMy Game type should have a 'state' field, but it could be any one of the types satisfying GameState typeclass
01:00:06ldleworkhow do I model that?
01:00:08Araqgeneric doesn't do what you think it does, I think
01:00:32Araqwell you can use "object of GameState" aka inheritance
01:01:39Araqbut usually a closure is the better design
01:02:08EXetoCldlework: do I call this nim-libtcod2 then?
01:02:20Araqit's hard to explain though ... :P
01:02:48Araqyour way of thinking about 'state' is completely off IMHO
01:03:47ldleworkAraq: I mean that's fine, but this is how I've written games for a long time
01:04:02ldleworkgames that work that don't have some fundamental software design issue that causes them not to execute and perform their duty as a game
01:04:12ldleworkI'm totally fine with hearing a better model for them
01:05:09ldleworkHaving an object, which has some field which acts as a delegate for some functionality, which you can change to change the behavior is a pretty standard pattern
01:06:26Araqhttp://nimrod-lang.org/manual.html#first-class-iterators not sure if it fits your use case though
01:06:39Araqcheckout the "simple tasking" example
01:09:07ldleworkHmm I'm not sure how this solves anything
01:10:26ldleworkCan two types not refer to each other?
01:11:15EXetoCput them in the same type block
01:11:33ldleworkI tried that
01:11:35EXetoCcant refer to eachother by value though
01:11:42ldleworkError: illegal recursion in type 'BaseState'
01:11:47EXetoCbecause you then have infinite recursion
01:11:59EXetoCyou might want 'ref'
01:12:01ldleworkEXetoC: meaning one has to go through a pointer?
01:12:09ldleworkah that makes sense
01:12:35*will quit (Remote host closed the connection)
01:15:26ldleworkError: inheritance only works with non-final objects
01:16:01Araqthe language hates you, so you have to use "object of RootObj"
01:16:11ldleworkah okay
01:16:19Araqto make the object non-final
01:20:36ldleworkI have StaticState derriving from BaseState which is defined with "game: ref Game" however I cannot do "var state = StaticState(game: addr(game))"
01:20:45ldleworkI get, Error: undeclared field: 'game'
01:20:57ldleworkIs the inherited fields from BaseState not exposed somehow
01:21:18ldleworkoh right need the *
01:23:32Araqalso if you use 'addr game', you should use 'ptr Game', not 'ref Game'
01:23:45Araqand you better not allocate 'game' on the stack then
01:23:51ldleworktype mismatch: got (Game) but expected 'ref Game'
01:23:59ldleworkhow do I take a ref of Game if the param is defined as ref Game
01:24:10Araqsee above
01:24:31ldleworkaddr Game gives me a ptr as you say
01:24:33Araq'ref' means you new'ed it
01:24:46Araqyou didn't 'new' it, there is no way to get a 'ref' to it
01:24:53ldleworkI did var game = Game()
01:24:55ldleworkah
01:29:10ldleworkAraq: do you have to do anything special to override a base type's method?
01:29:25ldleworkI have a draw defined for StaticState, but BaseState's implementation is called
01:29:27ldleworkoh
01:29:31ldleworkbecause I'm taking BaseState
01:29:36ldleworkdo I have to... cast it?
01:29:36Araqwell it needs to be a 'method' to begin with
01:29:40ldlework oh
01:29:51*Matthias247 quit (Read error: Connection reset by peer)
01:30:22ldleworkhmm still calls the parent type's implementation
01:30:45Araqare you on devel?
01:30:47ldleworkAraq: is it because I have the type specified as BaseState, so even if I pass a StaticState (a subclass), it uses the BaseState impelmentation?
01:30:50ldleworkAraq: yeah
01:31:41ldleworkMaybe I need to define a typeclass for these state types
01:31:46Araqno
01:31:51ldleworkhmm but you can't specify a typeclass as a field
01:31:58Araqdon't use a typeclass
01:32:04ldleworkok
01:32:10Araqyou don't know what a typeclass is, don't use it
01:32:26ldleworkpretty sure its an interface contract of sorts
01:32:35ldleworkdefining what can be done to a type that satisfies the typeclass
01:33:10Araqthe thing is
01:33:36Araqwhat you are doing, is you slice the object because you don't use 'ref object'
01:33:56Araqand so it ends up calling the base, because that's what it is
01:34:14Araquse 'ref object' with inheritance
01:34:54ldleworkWhere am I typing "ref object", on my Game type that currently has a field "state: BaseState" ?
01:35:32Araqmake that 'state: ref BaseState'
01:37:18ldleworkThen, how do I pass a ref of that after instantiating it like "var state = StaticState(game: addr game)"
01:37:22*johnsoft joined #nimrod
01:37:31ldleworkI need to call "game.init( ... )" and pass the ref BaseState to that
01:39:25ldleworkYeah not sure how to pass a ref
01:39:50EXetoCnew(T) or new(your ref var)
01:40:54ldleworkEXetoC: when you initailze it like that, how do you initialize the fields?
01:40:56EXetoCthe former returns a 'ref T' of course. see the documentation for system
01:41:44EXetoCvar x = new(T); x.y = ...
01:42:18ldleworkI see
01:42:21ldleworkThat worked
01:42:50EXetoCvar x = (ref T)(field1: 1, ...)
01:43:59ldleworknot sure which I like better
01:44:20ldleworkIs there a live nim pastebin thing yet?
01:47:21AraqEXetoC: does (ref T)(field ...) work?
01:47:37Araqcause I think the testsuite is still missing it
01:48:09EXetoCyes
01:48:17Araqyay
01:48:41EXetoCI think I had to use #!strongSpaces for it to work before
01:48:54Araqthat makes no sense
01:49:21EXetoCI know I had to change some option
01:49:28EXetoCwhatever
01:49:35ldleworkIt worked for me without any change
01:49:48EXetoCyep
01:50:10*bjz quit (Read error: Connection reset by peer)
01:50:29*bjz joined #nimrod
01:50:47*irrequietus quit ()
01:52:24*AFKMorpork is now known as AMorpork
01:53:59Araqgood night
01:54:51ldleworkHow to deref a ptr?
01:55:38EXetoC[]
01:56:41NimBotAraq/Nimrod devel a1c217a Araq [+1 ±1 -0]: fixes #1684
01:56:47Araqgood night
01:57:04EXetoClater!
01:57:50ldleworkEXetoC: if I have my type has a ref to State and I create it like, var worker = Worker(), what is that reference set to right now?
01:58:41EXetoCit will be nil (pointing to 0)
02:05:04*wire_s left #nimrod ("WeeChat 1.0.1")
02:07:23*BitPuffin quit (Ping timeout: 240 seconds)
02:27:57ldleworkEXetoC: so is it just that ref is a GC'd pointer and ptr is an unmanaged one?
02:28:10ldlework(hence why you said 'better not be on the stack')
02:29:14EXetoCthat wasn't me, but yes
02:29:53*darkf joined #nimrod
02:30:37*superfunc quit (Ping timeout: 246 seconds)
02:33:25ldleworkEXetoC: I'm just instantiating it like "var worker = Worker()" and then using "addr worker"
02:33:33ldleworkIs my Worker on the stack or heap
02:34:41ldleworkAlso, when I have an overridden method in a subclass how can I call the parent implementation?
02:36:12EXetoCyou don't want GC allocation?
02:36:19EXetoConly the former is relevant, and it will be on the stack
02:36:43EXetoCassuming that Worker is 'object' and not 'ptr object' for example
02:36:50ldleworkIt is
02:36:57ldleworkSo 'ptr object' is how to get it onto the heap?
02:37:10ldlework(I don't want it on the heap I'm just wondering)
02:37:50EXetoCthat's just a shortcut
02:38:13EXetoCfor 'ptr Worker'
02:38:28ldleworkOkay I converted worker over to use a ref
02:39:01ldleworkEXetoC: minimal example thing, https://gist.github.com/412faf911e29e9dbf768
02:39:15ldleworko/
02:39:28EXetoCI've barely used inheritance. maybe you need to cast: cast[Base](obj)
02:39:49EXetoCref Base?
03:03:09*EXetoC quit (Ping timeout: 264 seconds)
03:05:43*flaviu quit (Ping timeout: 258 seconds)
03:12:43*perturbation quit (Quit: Leaving)
04:08:22*flaviu joined #nimrod
04:12:05*q66 quit (Quit: Leaving)
05:51:55*untitaker quit (Ping timeout: 272 seconds)
05:57:50*untitaker joined #nimrod
05:59:21*shodan45 quit (Quit: Konversation terminated!)
06:11:51dtsis there something in the standard nimrod library that would allow line 8? http://paste.ubuntu.com/9309992/
06:17:24*milosn joined #nimrod
07:13:13*gour joined #nimrod
08:28:02gokrldlework: Read my OO articles. You normally use "ref object" not pr.
08:28:04gokrptr.
08:28:23ldleworkThanks
08:33:42gokrhttp://goran.krampe.se/category/nim
08:33:56gokrAlso, the super call issue has been solved in devel - but I haven't had time to write a followup.
08:34:23gokrI mention Andreas intending to implement "static_call" - and he has done so, but its called "procCall". Works as I describe in the article though.
08:57:56*kapil__ joined #nimrod
09:07:33*milosn quit (Remote host closed the connection)
09:39:44Araqdts: no
09:40:04dtsdamn
09:40:26Araquse this instead:
09:40:28gokrdts: Thing is, "lines" is an iterator. You don't really know when its going to end.
09:40:43Araq if result.len == 0: result.add "\n"
09:40:48Araq result.add line
09:40:48gokrSince you don't know the number of lines in a file, until you have read them all.
09:41:10Araqbut there is also some readAll that already implements what you're after
09:41:11*milosn joined #nimrod
09:41:13gokrYeah, Araq is simply moving the "\n" to be done "before next line" instead of "after each line"
09:41:30*BlaXpirit joined #nimrod
09:41:50*gokr going back to carrying dinner table...
09:42:20dtsgokr, yeah good point. im just used to c++ where iterators have a known end
09:42:39dtsAraq, thanks!
10:00:19*Matthias247 joined #nimrod
10:03:02*dts is now known as usandenemies
10:03:17*usandenemies is now known as dts
10:13:08*gour quit (Quit: Konversation terminated!)
10:15:50*gour joined #nimrod
10:26:24*gour_ joined #nimrod
10:29:43*gour quit (Ping timeout: 258 seconds)
10:29:57*gour_ is now known as gour
10:42:40*Matthias247 quit (Read error: Connection reset by peer)
10:43:46*gokr quit (Quit: Leaving.)
10:55:38*gokr joined #nimrod
10:55:57*gokr_ quit (Ping timeout: 240 seconds)
11:03:43*BitPuffin joined #nimrod
11:04:39*EXetoC joined #nimrod
11:32:50*gokr1 joined #nimrod
11:44:23*Pisuke quit (Ping timeout: 240 seconds)
12:24:57*gokr1 quit (Ping timeout: 240 seconds)
12:35:17*Jesin quit (Quit: Leaving)
13:08:57*gokr_ joined #nimrod
13:11:00*gokr quit (Ping timeout: 258 seconds)
13:16:18*flaviu quit (Remote host closed the connection)
13:16:39*flaviu joined #nimrod
13:18:29*wan quit (Quit: WeeChat 1.0.1)
13:23:24*gokr joined #nimrod
13:35:54*BitPuffin quit (Ping timeout: 250 seconds)
13:38:30*EXetoC quit (Ping timeout: 250 seconds)
13:38:30*gokr_ quit (Read error: Connection reset by peer)
13:39:09*gokr_ joined #nimrod
13:43:57*bjz quit (Read error: Connection reset by peer)
13:44:03*bjz_ joined #nimrod
13:49:38*gokr_ quit (Remote host closed the connection)
13:54:04*EXetoC joined #nimrod
13:58:52*Pisuke joined #nimrod
13:59:28*milosn quit (Quit: Lost terminal)
14:07:23*EXetoC quit (Ping timeout: 240 seconds)
14:14:53*johnsoft quit (Ping timeout: 245 seconds)
14:16:03*johnsoft joined #nimrod
14:18:31*gokr_ joined #nimrod
14:36:52*gokr_ quit (Read error: Connection reset by peer)
14:37:50*gokr_ joined #nimrod
14:49:32*q66 joined #nimrod
15:11:23*kapil__ quit (Quit: Connection closed for inactivity)
15:22:48*darkf quit (Quit: Leaving)
15:27:15*flaviu quit (Remote host closed the connection)
15:27:54*yeye123 joined #nimrod
15:32:29yeye123hi everyone, whats the best library for getting some gui up and running with nimrod in a "short" time, I would like to try the language out, but I like to tinker with gui, thanks for helping out
15:33:11BlaXpiritthere aren't many options
15:33:20BlaXpiritgtk is the only one, or one of the very few
15:33:47yeye123ok
15:37:15yeye123so I need to install babel package manager and i'm all set?
15:41:07BlaXpiriti don't know :|
15:41:15*gour quit (Quit: Konversation terminated!)
15:41:40BlaXpiriti just ignore gtk's existence
15:42:16*vendethiel joined #nimrod
15:43:12*BitPuffin joined #nimrod
15:43:43yeye123so then theres no usable gui library for this language, what a shame...
15:44:03*gour joined #nimrod
15:49:56BlaXpiritwell it's still probaby the 2nd best GUI library
15:50:07BlaXpiritmaaaybe 3rd
15:52:25yeye123so what is numer 1
15:53:00BlaXpiritthis is subjective and off-topic
15:53:09BlaXpiritbut
15:53:10BlaXpiritQt
15:54:48yeye123is there any tutorial for a simple gui program?
15:54:57*flaviu joined #nimrod
15:55:32*j3rky joined #nimrod
16:03:04*strangelove joined #nimrod
16:03:27strangeloveyeye123: see https://github.com/nim-lang/gtk2/tree/master/examples for some gui examples
16:04:01strangeloveyeye123: some geezer is also making a gtk3 wrapper
16:04:52yeye123thanks
16:09:23*strangelove quit (Quit: Page closed)
16:11:13*flaviu quit (Quit: Leaving.)
16:11:22*flaviu joined #nimrod
16:21:14*xcombelle joined #nimrod
16:28:06*Demos joined #nimrod
16:31:37*gokr_ quit (Ping timeout: 240 seconds)
16:32:14*gokr_ joined #nimrod
16:46:44yeye123examples/ex1.nim(2, 2) Error: cannot open 'glib2' <-- sorry for newbie question, anything special i have to do to make the gtk2 examples run?
16:47:34*geezer joined #nimrod
16:49:59geezerBlaXpirit wrote; i just ignore gtk's existence
16:50:20geezerYes, not all is really fine for GTK+ ...
16:51:50geezerBlaXpirit: how long will it take you to finish your great Nim Qt wrapper?
16:52:06BlaXpirit
16:52:29BlaXpiritI'm distantiating from Nim anyway
16:54:30yeye123import glib2 where does it have to reside
16:56:02yeye123same goes for sdl
16:56:20geezeryeye123: for testing gtk2 you may install aporia, it is a good example.
16:57:00yeye123geezer: thanks, i was trying to run the gtk2 examples
16:57:19*EXetoC joined #nimrod
16:59:07geezerFor final GTK3 we will to have to wait at least some weeks still, a preliminary version is available, see the Forum. But unfortunately no examples yet, sorry.
16:59:46yeye123thats ok, i guess i have some issues with nim not finding my libraries through the import statement?
17:01:01yeye123how do i tell nim where to find these?
17:01:04geezerFor me the small Gtk2 examples worked after I installed aporia in summer.
17:01:11yeye123ok
17:03:42geezergeezer is now known as Salewski again.
17:03:45*geezer quit ()
17:04:50*gokr_ quit (Ping timeout: 258 seconds)
17:08:45*Matthias247 joined #nimrod
17:11:21*dom96_ quit (Ping timeout: 258 seconds)
17:13:02*j3rky quit (Quit: Konversation terminated!)
17:15:25yeye123ok, i guess it was a bit heavy getting started in nim, does anyone know of a similar language that i easier getting started in?
17:22:18*wan joined #nimrod
17:24:49*dom96_ joined #nimrod
17:25:38*will joined #nimrod
17:27:33willyeye123: you still struggling to get gtk2 working? afaik you need to install glib2 with nimble and install the gtk2 libs with your package manager
17:33:12EXetoCthere's no glib package, but it's included in the gtk2 package
17:46:34gourit seems that 13.2 can0t boot if the root and boot are under lvm2?
17:46:48gourahh, wrong channel
18:01:47*milosn joined #nimrod
18:13:57*BitPuffin quit (Ping timeout: 264 seconds)
18:23:44*BitPuffin joined #nimrod
18:42:30*yeye123 quit (Quit: Leaving)
18:54:46*AMorpork is now known as AFKMorpork
18:58:39EXetoCwas the behavior of ranges modified recently?
19:03:21EXetoCno, something else is going on
19:05:40*dts quit (Ping timeout: 250 seconds)
19:08:43*irrequietus joined #nimrod
19:30:39flaviuSomething like python's `enumerate()` seems like a better solution than having `pairs()` for each iterable data type
19:31:22*gokr_ joined #nimrod
19:33:24EXetoCit might not be feasible yet
19:34:27flaviuEXetoC: Not at this moment, no. But I just reported the bug that prevents it.
19:35:11EXetoCI've only tried to pass 'iterator'
19:35:50EXetoC*specify
19:42:47*yeye123 joined #nimrod
19:43:24*perturbation joined #nimrod
19:52:56*yeye123 quit (Quit: Leaving)
19:58:48flaviuIs there a way to transform a PNimrodNode into the original source?
20:00:41*BitPuffin quit (Read error: Connection reset by peer)
20:00:47flaviu`repr` seems to do that, ok
20:03:19*BitPuffin joined #nimrod
20:03:57*srlang joined #nimrod
20:05:06*dts joined #nimrod
20:10:23flaviulib/core/macros.nim(278, 10) Error: undeclared identifier: 'Node'
20:10:38flaviuBut line 278 is a comment, wtf?
20:11:59flaviuThe compiler blamed macros.nim for my broken AST output, weird
20:19:43gokrEvening folks
20:20:04flaviuhey gokr
20:20:14gokrHey :)
20:23:24dtswhats the type of stdin?
20:24:06flaviudts: TFile, http://nimrod-lang.org/system.html#stdin
20:24:11dtsty
20:24:33gokrAlthough its "File" in devel.
20:24:48gokrWe are dropping the Ts.
20:26:46*Trustable joined #nimrod
20:29:34*srlang quit (Ping timeout: 264 seconds)
20:32:22dtsis there a function for the string type to get the length of it?
20:32:31dtsother than something like this:
20:32:57flaviu`myString.len`, `len(myString)` are both valid.
20:33:07dtsok ty
20:33:09*johnsoft quit (Ping timeout: 264 seconds)
20:33:57*johnsoft joined #nimrod
20:35:30*dom96_ quit (Ping timeout: 244 seconds)
20:38:28flaviuhttps://gist.github.com/flaviut/53b7f1928c944c010605 if anyone is intersted
20:41:42gokrflaviu: Daft question: what is it for?
20:42:19flaviugokr: It's sugar for creating classes with inheritance
20:42:37flaviuLike Scala case classes, but less sophisticated ATM
20:42:38gokryes, i got that... but... what does it offer compared to the regular style?
20:42:53flaviuIt's more compact syntax
20:42:57gokrok :)
20:43:26flaviuI plan on defining lots of these, so it's much preferable to do it like this than over hundreds of lines.
20:43:48flaviuAnd I'll eventually modify the macro to do equality and pretty-printing.
20:45:05gokrSome mixin support?
20:45:32dtsare blocks like c++ namespaces?
20:45:40dtsor rather
20:45:44flaviuNope, blocks are like `{}`
20:45:46dtsunnamed namespaces?
20:45:54dtsoh ok... that makes sense
20:46:29flaviu`void foo() { int a; { int a; a++; } }`
20:47:01*vendethiel- joined #nimrod
20:47:23flaviugokr: unlikely, it seems like lots more work, and my application doesn't really need it.
20:48:07gokrJust think Nim needs relatively soon to get a "default OO package". So that there aren't too many experiments around "regular OO" stuff.
20:48:17gokrI would hate Nim to go the js route.
20:48:25*vendethiel quit (Ping timeout: 252 seconds)
20:48:33gokr(everyone invents their own style of OO)
20:48:39*dom96_ joined #nimrod
20:51:21*matkuki joined #nimrod
20:51:40dtsso one could use break and block [label] as goto couldnt they?
20:51:56dtsewiat no never mind
20:56:10*Pisuke quit (Ping timeout: 244 seconds)
20:58:57ldleworkgokr: +1
21:02:54ldleworkflaviu: can you write a small example using your classes?
21:03:02ldleworkLike animal->cat/dog something simple
21:05:30flaviuldlework: The first comment was supposed to do that, but I changed it to the Animal example you suggested.
21:06:09ldleworkflaviu: so in your macro methods/member procs are provided the normal way
21:06:18*superfunc joined #nimrod
21:06:22flaviuYep. It just shortens the declarations.
21:06:27ldleworkthe macro is only defining the type/inheritance
21:06:29ldleworkI see
21:06:45flaviuI plan on doing equality and pretty printing some time
21:07:05ldleworkflaviu: do the classes have to be on one line like that?
21:07:29ldleworkI don't know how fickle the macros are
21:07:39flaviuBut I don't need it at this moment, so it's not implemented yet.
21:07:40flaviuldlework: Nope, as long as a parses to the same thing
21:07:45ldleworkmakes sense
21:07:55EXetoCooooop
21:08:18flaviuBut as I noted, you can't omit the types. eg, Foo(Base)(field1, field2: string) is invalid.
21:13:44ldleworkflaviu: you should just create a straight up mixin system
21:14:02ldleworkwith explicit conflict resolution :)
21:14:04ldleworkkthx
21:15:04flaviuldlework: To be honest, I'm not sure what a mixin system is
21:16:31ldleworkflaviu: I'm thinking like, stateful traits
21:16:51ldleworkBasically partial classes, where the composing class must explicitly resolve any naming collisions
21:18:17flaviuMaybe if I find myself bored one day, I'll look at it.
21:19:55matkukiIs there a list type that can be accessed by index in Nimrod?
21:20:35flaviumatkuki: seq[T] isn't a linked list, but it's a variable size array.
21:20:56matkukiflaviu: thanks
21:21:09*gokr should get my article on seq out...
21:21:12flaviuif you know the size at compile-time, you can use an array
21:21:40gokrmatkuki: seq is the "work horse" collection in Nim I would say. A dynamic array basically.
21:22:03gokrldlework: There is also that macro for OOP on the nimbyexample page
21:22:29gokrhttp://nimrod-by-example.github.io/oop_macro/
21:22:34matkukigokr: is it a builtin or in a library?
21:22:47flaviumatkuki: Builtin
21:22:50gokrseq is in system.nim so its "builtin"
21:23:03matkukithanks
21:23:41gokrmatkuki: http://nimrod-lang.org/manual.html#array-and-sequence-types
21:24:07matkukigokr: was just looking at it :)
21:24:30gokrOne "issue" with Nim is that since it has grown up as an imperative language - a full description of what you can do with each type is typicall a bit "spread out".
21:24:40flaviuNot everything in system.nim is a builtin.
21:24:48gokrWhich is why I started hunting down all stuff about seq :)
21:24:55gokrBut haven't finished that article yet.
21:24:58flaviuI would only consider the things that are magic builtin.
21:25:09*dom96_ quit (Ping timeout: 265 seconds)
21:25:31gokrflaviu: That's why I used ""
21:26:07*xcombelle quit (Ping timeout: 265 seconds)
21:29:43*gour quit (Quit: Konversation terminated!)
21:30:20*milosn quit (Remote host closed the connection)
21:42:53*Trustable quit (Quit: Leaving)
21:45:14Araqflaviu: yeah, magic == builtin
21:45:22Araqthere is no other sane definition
21:47:13EXetoCseqs. I don't know about that abbreviation
21:48:09EXetoCflaviu: anyway, it would be a good idea to use the term 'sequence' at least once
21:48:40flaviuEXetoC: In Nim-by-example?
21:48:55EXetoCyes
21:57:24EXetoCand isn't that comment about "value semantics" unrelated to mutability?
22:00:01flaviuEXetoC: Thanks, that is confusing. I'll fix it.
22:07:12gokrOk, spat out a fourth article on OO (procCall): http://goran.krampe.se/2014/11/30/nim-and-oo-part-iv
22:09:34*flaviu quit (Read error: Connection reset by peer)
22:09:38*flaviu1 joined #nimrod
22:10:36Araqgokr: nice!
22:10:47gokrthanks
22:11:21*irrequietus quit ()
22:11:55NimBotAraq/Nimrod devel 866ce10 Araq [+0 ±1 -0]: fixes #1687
22:12:16Araqin case you wonder why some bugfixes don't get a test case
22:14:48Araqthe reason is simply that I estimate the likehood of the bug ever showing up again
22:15:15Araqand if it's too small, I might decide it's not worth bloating up the test suite
22:18:57*dts quit (Ping timeout: 240 seconds)
22:22:38*superfun1 joined #nimrod
22:23:34*j3rky joined #nimrod
22:33:40*johnsoft quit (Ping timeout: 250 seconds)
22:33:47*johnsoft joined #nimrod
22:41:14*matkuki quit (Quit: ChatZilla 0.9.91 [Firefox 33.1/20141106120505])
23:04:48flaviu1:/
23:04:57*flaviu1 is now known as flaviu
23:05:28flaviuI don't really like that, isn't most the test suite slowness from a few tests?
23:07:08flaviugokr: I found some issues with the line numbers around "As we can see the “syntactic..."
23:14:06flaviu procCall is interesting solution, I don't think I've seen it before
23:16:37*superfunc quit (Ping timeout: 246 seconds)
23:17:01EXetoCwhat was it again?
23:19:25flaviuEXetoC: Like super, but more powerful
23:19:30flaviuhttp://goran.krampe.se/2014/11/30/nim-and-oo-part-iv/
23:20:22flaviugokr: Another typo to report, "at least all procs _unless_ the concat", in http://goran.krampe.se/2014/11/03/squeak-to-nim/
23:36:50*BlaXpirit quit (Quit: Quit Konversation)
23:38:53*boydgreenfield joined #nimrod
23:53:28*dom96_ joined #nimrod