<< 04-02-2014 >>

00:00:15Araqecho system.nimrodversion iirc
00:00:28filwitk, good to know
00:00:35Araqfilwit: why does it fail on master too?
00:00:43Araqmaster doesn't use the new vm
00:01:05renesacAraq, I was in the right place
00:01:16filwitAraq: idk, haven't tried in awhile, maybe that was based on bad work on my end
00:01:31renesacchanging what you suggested now makes "var y:int64 = 2; var x:byte = 5 + y" work....
00:01:40filwitAraq: but i remember it crashing after i pulled the latest changes to master and built, but not before
00:01:48renesacI want the inverse
00:02:28Araqrenesac: I'm tired, I could be wrong
00:02:55BlueProtomanHm, I can't link to a particular source file...
00:03:00Araqalso I never get any subtype/type conversion relations right
00:03:04BlueProtoman*source file on compileonline.com
00:03:13renesac:/
00:03:44Araqin fact I've given up on getting the subtype relation right, I implement it somehow and then test it and then flip a,b
00:04:05Araqthat's much more reliable than thinking about it
00:04:08filwitBlueProtoman: email code + url to your TA/instructor
00:04:44renesacBlueProtoman, can't you ask for IDEOne update their version of the compiler?
00:04:58BlueProtomanrenesac: How fast would they comply?
00:05:06renesacI have no idea
00:05:11filwit2.8234 minutes exactly
00:05:20renesacbut it don't hurt to try
00:05:24filwit^
00:06:00AraqBlueProtoman: why do you need to use some webservice stuff?
00:06:42BlueProtomanAraq: The TAs will not have Nimrod installed. What I was going to do is have the code on my (paper) submission, and include a short link to a webservice that will run the code with arbitrary input.
00:08:40AraqBlueProtoman: send them the generated C code then :P
00:08:56Araqnah, just kidding ... or am I not?
00:09:13BlueProtomanAraq: Doesn't it depend on what platform you compile for?
00:09:37BlueProtomanI suppose I could just use 0.8.8...reversing a singly-linked list doesn't need advanced features, right?
00:10:29Araqright
00:10:45Araqright
00:10:52Araqgood night, guys
00:10:55renesachttp://dpaste.dzfl.pl/ <-- this thing from D community is cool, and let's you select the compiler version (good to see if your bug is already fixed in devel HEAD w/o needing to compile it)
00:12:26renesacwish nimrod community could have something like that...
00:13:30AraqDAddYE wanted to build something like that
00:13:39filwitAraq: found the bug
00:13:45Araqand also a web frontend for c2nim
00:13:59Araqto help people learn nimrod, iirc
00:14:11filwitAraq: pfft.. spoke too soon, sorry
00:14:20Araqfilwit: I'm sleeping
00:14:22Araqgood night
00:14:26filwitlater
00:14:34Araqfilwit: you can try to simply disable the 'unused' check
00:14:42Araqand see if it fixes it already
00:14:53Araqspeaking from experience ... it usually does
00:15:00Araqbye
00:15:44renesachum, the main use I found for dpaste was to test on different compilers (LDC, GDC, etc had different bugs than DMD)
00:16:37renesacand different versions
00:19:33*BlueProtoman left #nimrod ("Leaving")
00:20:29*JStoker quit (Excess Flood)
00:24:13*JStoker joined #nimrod
00:32:30*icebattle quit (Read error: Connection reset by peer)
00:44:55Varriountdom96: Does babel support multiple versions of a single package?
00:46:04VarriountI can see a neew where you might be working on some programs that need one version of "Foo", and some programs needing another version of "Foo"
01:00:34reactormonk_renesac, how exactly do you imagine the semantics for varargs[openarray[int]] ?
01:01:47*JStoker quit (Excess Flood)
01:02:26*reactormonk_ is now known as reactormonk
01:03:57*brihat quit (Read error: Connection reset by peer)
01:04:08Varriountreactormonk, renesac: Or even how such a thing would work.
01:04:22*DAddYE quit (Remote host closed the connection)
01:05:19*JStoker joined #nimrod
01:07:37*JStoker quit (Excess Flood)
01:08:48*JStoker joined #nimrod
01:13:17EXetoC[1, 2, 3], [4, 5, 6]?
01:16:49EXetoCnvm
01:30:12*xenagi quit (Quit: Leaving)
02:03:47*XAMPP joined #nimrod
02:03:47*XAMPP quit (Changing host)
02:03:47*XAMPP joined #nimrod
02:05:22*DAddYE joined #nimrod
02:06:35renesacreactormonk, Varriount: an seq with pointers to other seqs/arrays?
02:06:36renesac:P
02:07:16renesacis there any way to parametrize the size of an array?
02:08:04renesaclike 'proc foo[N](varargs[array[N, int]]): array[N, int]'
02:08:04renesac?
02:09:49*DAddYE quit (Ping timeout: 265 seconds)
02:11:58EXetoCyes
02:24:30*aruniiird quit (Quit: Leaving)
02:47:27*dope joined #nimrod
02:47:33*dope left #nimrod (#nimrod)
02:55:14*Puff quit (Disconnected by services)
02:55:44*BitPuffi1 joined #nimrod
03:42:11*Demos joined #nimrod
04:02:13*BitPuffi1 quit (Ping timeout: 248 seconds)
04:15:40Demosis there any problem with having the compiler output a "no generic parameters allowed for X" when you go X[type] for something that is not generic. The only code change is replaceing an internalAssert with an error. I think the assert is wrong but I am not sure. Is it an error for a malformed generic instantiation like that to get all the way to the check if the instantiated generic code is correct?
04:20:25*DAddYE joined #nimrod
04:57:34*DAddYE quit (Remote host closed the connection)
05:23:45*FireBeyond joined #nimrod
05:24:27*FireBeyond left #nimrod ("Textual IRC Client: www.textualapp.com")
05:30:18*xtagon quit (Quit: Leaving)
05:49:15*DAddYE joined #nimrod
06:06:39*brson quit (Ping timeout: 265 seconds)
06:32:34*DAddYE quit (Remote host closed the connection)
06:33:05*DAddYE joined #nimrod
06:33:46*bstrie_ joined #nimrod
06:37:09*DAddYE_ joined #nimrod
06:37:35*DAddYE quit (Ping timeout: 265 seconds)
06:38:45*filwit quit (*.net *.split)
06:38:46*bstrie quit (*.net *.split)
06:38:46*musicalchair quit (*.net *.split)
06:38:48*psquid quit (*.net *.split)
06:40:15*fowl quit (Read error: Operation timed out)
06:42:05*shodan45 quit (Remote host closed the connection)
06:43:07*shodan45 joined #nimrod
06:44:36*shodan45 quit (Remote host closed the connection)
06:45:54*filwit joined #nimrod
06:50:15*musicalchair joined #nimrod
06:59:55*fowl joined #nimrod
07:31:53*DAddYE_ quit (Remote host closed the connection)
07:32:19*DAddYE joined #nimrod
07:37:17*DAddYE quit (Ping timeout: 272 seconds)
07:44:18*DAddYE joined #nimrod
07:51:43*Demos quit (Read error: Connection reset by peer)
07:56:13*delian1 joined #nimrod
07:56:21*delian1 quit (Client Quit)
08:00:42*filwit quit (Ping timeout: 252 seconds)
08:01:46*psquid joined #nimrod
08:06:05*zahary joined #nimrod
08:43:43*krusipo joined #nimrod
09:17:15NimBotAraq/Nimrod devel ebfbc39 Charlie Barto [+0 ±1 -0]: added good error for stuff like string[int] or int[int]
09:17:15NimBotAraq/Nimrod devel bd91447 Charlie Barto [+0 ±1 -0]: deleted assert that would never fire because it turned into an error message
09:17:15NimBotAraq/Nimrod devel e9c0367 zah [+0 ±1 -0]: Merge pull request #870 from barcharcraz/templaterr... 2 more lines
09:29:30*Mat3 joined #nimrod
09:29:33Mat3hi all
10:16:01*DAddYE quit (Remote host closed the connection)
10:16:36*DAddYE joined #nimrod
10:21:19*DAddYE quit (Ping timeout: 272 seconds)
10:23:31*wan_ quit (Quit: leaving)
10:35:02*Mat3 quit (Quit: Verlassend)
11:16:57*DAddYE joined #nimrod
11:19:51*BitPuffin quit (Ping timeout: 265 seconds)
11:21:48*DAddYE quit (Ping timeout: 265 seconds)
11:21:51*zahary quit (Quit: Leaving.)
11:39:51*zahary joined #nimrod
11:42:29*DAddYE joined #nimrod
11:46:51*DAddYE quit (Ping timeout: 250 seconds)
12:02:38*BitPuffin joined #nimrod
12:43:16*DAddYE joined #nimrod
12:47:50*DAddYE quit (Ping timeout: 265 seconds)
13:11:06*zahary quit (Quit: Leaving.)
13:11:56*ddl_smurf joined #nimrod
13:41:19*[1]Endy joined #nimrod
13:44:13*DAddYE joined #nimrod
13:48:37*DAddYE quit (Ping timeout: 250 seconds)
14:03:24*darkf quit (Quit: Leaving)
14:05:05*BitPuffin quit (Ping timeout: 250 seconds)
14:08:53*BitPuffin joined #nimrod
14:44:48*DAddYE joined #nimrod
14:49:38*DAddYE quit (Ping timeout: 265 seconds)
14:54:47*[2]Endy joined #nimrod
14:54:55*BitPuffin quit (Ping timeout: 250 seconds)
14:58:05*[1]Endy quit (Ping timeout: 272 seconds)
15:13:06*io2 joined #nimrod
15:16:33*io2 quit (Client Quit)
15:19:27*io2 joined #nimrod
15:23:40*BitPuffin joined #nimrod
15:42:25*BitPuffin quit (Ping timeout: 272 seconds)
15:45:28*DAddYE joined #nimrod
15:48:20*zahary joined #nimrod
15:50:03*DAddYE quit (Ping timeout: 265 seconds)
16:04:30*BitPuffin joined #nimrod
16:23:48*shodan45 joined #nimrod
16:46:14*filwit joined #nimrod
16:46:22*DAddYE joined #nimrod
16:50:57*DAddYE quit (Ping timeout: 265 seconds)
17:20:32EXetoCthere's no support for non-standard unescaped xml/html ampersands, right? I'm trying to fix that
17:21:07EXetoCspecifically in attribute values
17:45:47*mietek_ joined #nimrod
17:46:16*mietek quit (Read error: Operation timed out)
17:46:42*Discolod1 quit (Read error: Operation timed out)
17:46:49*Discoloda joined #nimrod
17:47:03*DAddYE joined #nimrod
17:47:09*Trixar_za quit (Ping timeout: 252 seconds)
17:47:47*Trixar_za joined #nimrod
17:48:46AraqEXetoC: no idea what you're talking about
17:49:50*BitPuffin quit (Ping timeout: 240 seconds)
17:50:30EXetoCAraq: href="x=1&y=2"
17:50:37EXetoCI don't know how common that is
17:50:47Araqvery
17:51:17*DAddYE quit (Ping timeout: 250 seconds)
17:51:21EXetoCyou mean they're rarely escaped in values? &amp
17:52:17Araqyes
17:52:57EXetoCso much for standards
17:53:17Araqit was completely forseeable
17:54:29Araqyou got urls, html, http, email addresses, all with its own escaping rules
17:55:08Araqin a nice "layered approach" package
17:55:46*DAddYE joined #nimrod
17:56:17Araqand then they wonder everybody gets it wrong ...
17:57:20EXetoCthat makes sense. string literals contains arbitrary data, so it shouldn't be so complicated
17:57:48Araqyou might as well wonder why the oceans are full of pastic, given that it doesn't rot ...
17:58:13EXetoCc(:)-<
17:59:35*brihat joined #nimrod
17:59:57*DAddYE quit (Ping timeout: 250 seconds)
18:02:14*brson joined #nimrod
18:07:32filwitAraq: i removed the 'unused' check from vmgen:1319 like you suggested, and now it's assert-failing at vm:425, and there's a comment "XXX: this is not correct" by the line.
18:07:54filwitAraq: i tried a couple different things, with no luck. Wondering if you have any ideas.
18:07:57*Mat3 joined #nimrod
18:07:59Mat3hi all
18:08:02filwithey
18:08:07Mat3hi filwit
18:08:12filwit:)
18:08:49filwitAraq: i'm sure you're probably busy, but if you get a minute to look at the problem I would appreciate any feedback.
18:09:35filwitAraq: I'll be trying different things myself for awhile and I'll let you know if I've made any progress
18:18:25Araqfilwit: actually removing the 'unused' check in line 1319 doesn't cut it
18:18:41Araqyou need to free the register as a workaround
18:19:50Araqnah, forget that
18:19:52Araqit doesn't matter
18:19:58filwitAraq: what's wrong with the register though? That's what I don't understand. I change the assert at vm:425 to a tell me what the register kind was, and it's a nkMetaNode
18:22:09filwitsomething is generating the stmt list wrong or the stack-frame, but I'm still hunting to find what exactly that is. If i completely remove the assert at vm:425, it works but hits a different assert later (goes through vm:850 to assert fail on vm:82)
18:23:48filwitone thing I was going to try is removing the 'var Type' param from my functions to see if that helps
18:24:13*BitPuffin joined #nimrod
18:24:23filwitsince it's failing at the dereference nkRefType assert
18:25:01Araqthat sounds about right
18:25:13Araq'var Type' could cause the problems
18:26:10filwitOkay, I'll try that, though that's not a good solution for me (really will be unoptimized if I can't use var params). Quick question fisrt, nkMetaNode means what kind of Nimrod syntax?
18:27:37AraqnkMetaNode is a PNimrodNode
18:27:58filwitokay, i see
18:28:11*DAddYE joined #nimrod
18:28:14Araqcool cause I don't :P
18:28:26Araqthe invariants make me crazy
18:29:18filwitwell i'm passing around "node:var PNimrodNode" as my first param of the problem proc
18:30:01Araqit's amazing how good the old vm worked ...
18:30:35filwitwhy did you change?
18:30:52filwitperformance?
18:30:56Araqyes
18:31:13Araqalso it has its own nasty bugs
18:36:08filwiti didn't realize this before, but my code is failing at [parseutils]
18:36:19filwitinteresting..
18:36:45filwitthat makes more sense why it's always the first line after 'else' statements that's failing then
18:38:41*zahary quit (Quit: Leaving.)
18:44:49*shodan45 quit (Quit: Konversation terminated!)
18:46:12filwitAraq: dope, fixed it. though i'm not quite sure exactly why yet
18:47:44filwitAraq: i removed the assert at vm:425, and changed the assert at vm:82 to "assert n.kind in { nkMetaNode, nkStmtList }" and now my program works.
18:48:28filwithmm... i see what's going on i think
18:49:05filwiti think my macro code was wrong and trying to add a proc node too a type stmt list
18:50:00reactormonkrenesac, so you want your varargs to be of type seq[seq[T]] ?
18:50:43filwitwell, no, the compiler is working cause now it's giving the "illformed AST" error, so at least it's giving errors
18:50:51reactormonkrenesac, I'd just overload it with varargs: seq[seq[T]] and varargs seq[T]
18:52:54*shodan45 joined #nimrod
18:54:51filwitbbl
19:01:26*io2 quit (Ping timeout: 264 seconds)
19:31:52reactormonkhttp://genericlanguage.wordpress.com/2014/02/04/advice-on-writing-a-programming-language/ cute
19:37:03*xtagon joined #nimrod
19:50:31*zahary joined #nimrod
19:53:23EXetoC<a id="id" href="/bla?x=1&y=2" class="class">title</a>
19:53:57EXetoCAraq: I've managed to keep the ampersand, but it causes innerText to evaluate to: class="class">title
19:54:03EXetoCany idea where to go from there?
20:08:29AraqEXetoC: nope, sorry
20:09:27EXetoCI'm lost. will report it instead
20:13:28EXetoCit might be utf thing
20:15:50EXetoCchars like å gets their own xnText nodes
20:19:45Araqdom96: how can the tester get a list of all babel packages?
20:20:39dom96Read this https://github.com/nimrod-code/packages/blob/master/packages.json
20:21:33Araqand then? should I download it every time?
20:21:52AraqI think babel needs a 'list' option
20:22:17dom96If you want to depend on babel then you may as well read ~/.babel/packages.json
20:22:27dom96Babel has a list option.
20:22:56dom96Easier to parse the JSON than the output of 'babel list' though
20:23:40Araqtrue
20:23:52Araqhow can I find the .babel directory?
20:24:24dom96It's always in ~
20:24:41Araqos.getHomeDir()?
20:24:47dom96yes
20:25:00dom96That will become configurable though
20:26:07*mietek_ is now known as mietek
20:26:16dom96You could make the tester depend on ``babelpkg``
20:26:32dom96There is a getPackageList function in packageinfo.nim
20:41:14*Demos joined #nimrod
20:42:13reactormonkno dependencies?
20:42:50Araqdom96: how will it become configurable?
20:44:40Araqping DAddYE
20:46:13dom96Araq: Not sure yet.
20:48:52Araqzahary: fyi tests/misc/tgenconstraints.nim now fails
20:51:59*[2]Endy quit (Ping timeout: 250 seconds)
20:59:49DAddYEAraq: bbs in 5
21:01:49*Mat3 http://ootbcomp.com/docs/encoding/
21:12:40AraqMat3: excellent link
21:21:38DAddYEAraq: here I'm
21:25:26AraqDAddYE: now where is the c2nim web service? :-)
21:25:44DAddYEAraq: monday will be ready
21:26:05Araqit's tuesday already here in europe ...
21:26:08DAddYEthis weekend I had to see some new houses (eol for my rent)
21:26:16DAddYE*next monday
21:26:31Araqlol alright
21:29:32*zahary quit (Quit: Leaving.)
21:34:22renesacit would be nice If I could just " importc: "xlib.h" " at the top of my program and have a low level wrapper constructed for me
21:35:57renesacbut I guess that c2nim needs some manual preprocessing on the .h file to be able to correctly handle it
21:36:07EXetoCnot the previous monday? oh well. better late than never I guess
21:36:17renesacin "normal' (complex) cases
21:36:57renesacI haven't tried c2nim yet, though I will soon
21:37:33renesacbut that was the impression I got reading the docs, and from other languages with similar FFI
21:38:43Araqimportc: "xlib.h" is a pipe dream
21:39:13Araqthe only language that can do that are supersets of C or C itself
21:39:13Araqand for good reasons
21:39:13renesacreactormonk, I was actually thinking about something that can work on both arrays and seqs
21:39:58EXetoCtype parameters?
21:40:33renesacwell, I read that openarray[] is the thing for it
21:41:13Araqrenesac: you can't nest openarrays for technical reasons
21:42:03renesachum, it isn't clear what are those techical reasons
21:42:13renesacis it because some arrays may be on the stack?
21:42:43Araqarray [4, array [3, int]] is packed in memory, seq[seq[int]] is not
21:43:03Araqso how can openarray[openarray[int]] take both?
21:43:23Araqthat requires some pointer mungling defeating the purpose
21:43:23renesacright, but what I wanted was "vararg[openarray[T]]"
21:43:38Araqvarargs is the same as openarray
21:43:38renesacbut vararg seems to be implemented as openarray
21:43:38renesacright..
21:44:18Araqyou can instead use a generic
21:44:38renesacwell, I don't see why vararg must be an packed array in case of arrays
21:45:18renesacit must behave like an openarray, or it is just an implementation choice?
21:45:58AraqI'm not sure what the choice here is
21:46:08Araqwhat's the alternative you have in mind?
21:48:33renesacseq[array[3,int]]?
21:53:33Araqmakes no sense
21:54:58Mat3I think that means sequence of fixed integer array-elements with dimension 3
21:55:18AraqMat3: yes that is what it means
21:55:18EXetoCyou'd lose the syntactic sugar, that's all
21:55:28EXetoCsort of
21:55:28Araqbut you can't pass an array to a seq
21:55:43Araqso there is no openarray like functionality left
21:56:38renesachum
21:56:53renesacwell, I learned that I can do "proc arr[N](a: array[N, int]): array[N, int] ="
21:57:03renesacthis is already pretty helpful
21:58:43Mat3is this an example of Fortran code you want to convert ?
21:59:43renesacno use for this yet, I just hit this limitation trying to write a too generic function for that ParticleBench code
22:00:43*BitPuffi1 joined #nimrod
22:01:03Mat3hi BitPuffin
22:02:43*BitPuffin quit (Ping timeout: 250 seconds)
22:03:13Mat3Araq: Do you think sequences of arrays are useful ?
22:03:23*apotheon joined #nimrod
22:03:23*apotheon quit (Changing host)
22:03:23*apotheon joined #nimrod
22:03:43Araqsure
22:03:58Mat3I see some application for GPU programming
22:04:43Mat3get some sleep, ciao
22:04:43Araqbye
22:05:03*Mat3 quit (Quit: Verlassend)
22:07:43*brihat quit (Ping timeout: 245 seconds)
22:08:53renesacAraq, the problem I hit yesterday could be solved if there is someway to tell that uint64, for example, is preferable over Int if uint8 is conversible to both and both are acceptable
22:08:53DemosI am having some trouble with winlean failing to compiler
22:09:23Demosrather OS is failing to compiler but it says it is missing the definition of FILE_ATTRIBUTE_REPARSE_POINT, which I clearly see in winlean
22:16:03Araqmaybe you use -d:useWinAnsi ?
22:16:13DemosI did not do that
22:17:20Demosand on os.nim line 1248 it can not find FILE_ATTRIBUTE_REPARSE_POINT but it can find FILE_ATTRIBUTE_DIRECTORY, which is declared right above REPARSE_POINT
22:17:46Araqwell I constantly bootstrap on windows
22:17:58Araqand this uses winlean
22:18:28Demoshm createSymbolicLinkW and createSymbolicLinkA are also not found (depending on useWinAnsi ofc
22:18:36Demosyeah I just bootstrapped the compiler just fine
22:43:40dom96Varriount: Sorry, forgot to answer you. Yes, babel supports multiple versions of the same package. However, a single package may not depend on two different versions of some package.
22:44:16*brson quit (Quit: leaving)
22:44:29*brson joined #nimrod
22:45:19Demoswhat is the exact name of the sanespaces pragma
22:47:22Araq'strongSpaces'
22:47:28Araqbut it is not implemented yet
22:47:38Demosnuts
22:48:25Araqhey, most people loved the name when I came up with it ...
22:49:04Demoswhat? I like sanespaces. much nicer than having to deal with so many parens, and easy to change later
22:49:53AraqI'm talking about the *name*, not the *feature*
22:50:02Araqyou just said the name is nuts
22:50:05Araqand I wonder why
22:53:41VarriountHi guys
22:54:17Demosoh I was saying nuts like "nuts I wish that was implemented"
22:54:23VarriountDemos: Something off about winlean?
22:54:29Demosyeah little bit
23:07:27*apotheon left #nimrod (#nimrod)
23:11:33renesaca template must return a "stmt"?
23:11:44renesacI'm trying to return a float, like a function, but it won't let me
23:12:28renesac*like a procedure
23:15:24renesacalso, looks like no implicit "result" variable is declared for templates
23:16:28Varriountrenesac: Templates are akin to C/C++ defines
23:17:07VarriountThe entire body of the macro is inserted into it's calling context
23:17:34renesachum
23:18:07renesacso it can only return "expr" or "stmt"
23:18:11renesac?
23:18:32VarriountYes, which is the body of the template
23:19:23renesacok, so they are not the right tool to implement a "timeit" like call
23:19:55renesaclike "echo timeit: \n stmts"
23:20:33Varriountrenesac: Why not?
23:20:33renesacto print the time to execute the following stmts
23:20:45renesacwell, i couldn't make it work
23:20:50VarriountCode?
23:21:00renesacI will try to return a expr then
23:22:59renesachttps://gist.github.com/ReneSac/715730359e06c472f683
23:23:15renesacwait a minute
23:23:23renesacI will edit it with the call and result
23:23:25VarriountWhy are you using a stmt?
23:23:59VarriountWhy not allow an expr? That way you can time bodies of code.
23:24:18renesacupdated
23:24:41renesacexpr is more general than stmt?
23:24:47VarriountYes
23:24:55Varriountiirc
23:25:07renesacwell, the result is the same
23:25:17renesacmaybe I should't use "return"?
23:25:39Varriountrenesac: What is a "stopWatch"?
23:26:02renesaca object I defined: https://github.com/ReneSac/Benchmark
23:28:04Araqrenesac: returning a float from a template is fine
23:28:31Araqbut 'return' cannot be used for obvious reasons
23:28:58Araqand it doesn't have 'result' either, how could it? :P
23:29:51Varriountrenesac: You could use the template to generate a proc though
23:30:59renesacso, how I return a float?
23:31:38VarriountPossibly through a statement list?
23:31:53EXetoC1.0?
23:31:57renesacis there any example out there?
23:32:17renesacI could't find anything on the manual or tutorial
23:33:12EXetoCtemplate x: expr = echo 1; 2; echo x
23:33:40Varriountrenesac: What happens if you remove the return, and just leave a dangling "sw.peek"?
23:34:06renesacthe same error, it seems
23:34:54Varriountrenesac: If you were willing to give up the procedure call syntax style, there's another way
23:34:55EXetoCit might have something to do with that block
23:35:25EXetoCused as an expr rather than a stmt
23:35:49renesacI changed the header to "template timeit*(code: stmt): float = " and it still gives the same error
23:37:16renesacVarriount, what way would be that? Inserting a variable?
23:37:23Varriountrenesac: Yep
23:37:24renesacthat is unhigienic...
23:37:42VarriountNot if it's an argument
23:38:04renesachum
23:38:11*darkf joined #nimrod
23:38:20Varriountrenesac: Or you could use a closure
23:38:24renesacso, like "timeit(res): code" ?
23:38:39Varriountrenesac: Something like that
23:38:40EXetoCVarriount: arg + immediate?
23:39:00VarriountI've no idea.
23:39:25Araqrenesac: it works like this:
23:39:34Araqtemplate timeit*(code: stmt): float =
23:39:35Araq var sw = 4.0
23:39:37Araq code
23:39:38Araq sw - 2.0
23:39:40Araqvar x = timeit do:
23:39:41Araq echo "bazz"
23:39:43Araqecho x
23:40:08VarriountI just spent 3 hours on a calc test. My brain is as deflated as a blow-out tire
23:40:15renesacI would rather not use a closure, because if I need to do: "for i in 0 .. 9999: code" it will make 9999 function calls, wont't it?
23:40:36Araqit doesn't produce a closure
23:41:03renesacoh, I need "do" to call a template?
23:41:29Araqthere is some rather badly documented block<->closure abstraction involving 'do'
23:42:05Araqwell the ':' sometimes is too ambiguous and so you have to use 'do:' instead
23:42:17Araqtimeit:
23:42:21Araq echo "foo"
23:42:56Araqis it when 'timeit' returns a 'stmt' and is as such a statement itself
23:44:18renesacoh, it worked
23:44:28renesacso, it was only the missing "do"
23:44:49Araqin fact, I would make 'timeit' output it already and make it a stmt template
23:45:23Araqwhen you use it as an expression, you have to use 'do:' instead to pass a block of code
23:45:48renesacoutput how? "timeit(output): " way?
23:45:50AraqPRs for the docs welcome *wink*
23:46:01Araqno, simply echo the time
23:46:21*brihat joined #nimrod
23:46:29AraqI need to sleep now, good night
23:46:38renesacI wanted to give the flexibility of what to do to the caller
23:47:02renesacjust adding a echo (and now a 'do' too) if he wants to immediately printing
23:47:07renesacgood night
23:57:51*filwit quit (Quit: Leaving)