--- Log opened Sat Aug 06 00:00:19 2011 00:02 -!- ajstarks [~ajstarks@pool-173-54-115-34.nwrknj.fios.verizon.net] has quit [Quit: ajstarks] 00:05 -!- helpmeimlost [~chris@pool-74-103-72-5.bltmmd.fios.verizon.net] has joined #go-nuts 00:09 -!- dfr|mac [~dfr|work@ool-18baf7e7.dyn.optonline.net] has joined #go-nuts 00:10 -!- Kumul [~Kumul@66-50-109-42.prtc.net] has quit [Remote host closed the connection] 00:11 -!- eikenberry [~jae@173-164-68-213-Oregon.hfc.comcastbusiness.net] has quit [Quit: End of line.] 00:14 < helpmeimlost> hello all, i was wondering if somebody could give me their opinion on whether it is better to use an array of strings in a for loop, or loop through a string (getting the bytes and casting them back to strings). i guess i want to know which is more efficient, or which is considered better practice 00:23 -!- robteix [~robteix@host195.190-231-150.telecom.net.ar] has joined #go-nuts 00:24 < skelterjohn> you mean something like for i:=0; i<N; i++ { foo(s[i*L:(i+1)*L]) } 00:24 < skelterjohn> ? 00:26 < skelterjohn> helpmeimlost: 00:26 < helpmeimlost> not really, something like this... for _,v := range "hello" {fmt.Println(string(v))} 00:26 < helpmeimlost> or something like this... 00:27 < helpmeimlost> for i := 0; i < len(strVar); i++ { fmt.Println(strVar[i]) } 00:28 < skelterjohn> the latter is equiv to saying fmt.Println(v) in the first one 00:28 < helpmeimlost> right, but is one better than the other? 00:29 < skelterjohn> oh well, i guess it's an int 00:29 < skelterjohn> so it would print a numeric value 00:29 < helpmeimlost> which one? 00:29 < skelterjohn> do whichever is the most clear 00:29 < skelterjohn> the performance drop will be significantly overwhelmed by the fact that you're printing 00:29 < skelterjohn> or basically anything else you might want to do 00:30 < helpmeimlost> ok, that's what i was wondering. just wasn't sure if it really mattered 00:31 < helpmeimlost> thanks for your help 00:31 < skelterjohn> the int thing i'm referring to - for _, f := range aString 00:31 < skelterjohn> f is an int 00:31 < skelterjohn> go has no char type at all, actually 00:31 < helpmeimlost> really? i thought f would be the character and the _ would be the position 00:31 < skelterjohn> but if you do fmt.Printf("%c", theInt) it will print as a char 00:32 < skelterjohn> yes - f is the int value of the rune at that position 00:32 < helpmeimlost> oh ok, i see what you're saying 00:32 < skelterjohn> and i think aString[i] is a byte 00:32 < skelterjohn> but i'd have to check to know 00:33 < helpmeimlost> i would have to cast the f to get the string value... string(f) and all that conversion is what i thought might not be a good idea 00:34 < helpmeimlost> cast it if i wasn't printing it, but cat'ing it to another string 00:34 -!- qeed [~qeed@adsl-98-85-61-194.mco.bellsouth.net] has joined #go-nuts 00:35 < raylu> if you're running on enough data where something so small might have a performance impact, test 00:35 < raylu> otherwise, don't pre-optimize and let the compiler do its job 00:36 < helpmeimlost> sorry, i'm new to this, what was it that is was doing that is considered pre-optimizing? 00:36 < helpmeimlost> *i was doing 00:36 < skelterjohn> asking which of two super speedy operations was the fastest, when they'd be overwhelmed by other tasks 00:37 < skelterjohn> that's pre-optimizing :) 00:37 < helpmeimlost> haha, gotcha :) 00:37 < raylu> technically, pre-optimizing is optimizing code before there is a performance problem 00:38 < raylu> it's justifiable if you're very sure something is going to be slow. if it's obviously going to be damn fast anyway, it's sillier 00:39 < helpmeimlost> it's just a sudoku solver so i'm sure i'll be okay without worrying about it too much 00:39 < skelterjohn> but if your actual goal is to learn how the language works, string(n) involves an allocation 00:39 < helpmeimlost> yes, that is my goal 00:39 < skelterjohn> and allocations are a common source of slowness 00:40 < helpmeimlost> hmm, good to know 00:40 < skelterjohn> since strings are immutable, if you ever string(x), the operation will copy x unless it's another string 00:41 < helpmeimlost> ok, i really appreciate all the info 00:42 -!- nekoh [~nekoh@dslb-088-069-157-137.pools.arcor-ip.net] has quit [Quit: nekoh] 00:43 -!- robteix [~robteix@host195.190-231-150.telecom.net.ar] has quit [Quit: Leaving...] 00:47 -!- moraes [~moraes@189.103.188.201] has quit [Ping timeout: 260 seconds] 00:56 -!- gridaphobe [~gridaphob@cpe-74-68-151-24.nyc.res.rr.com] has quit [Quit: Leaving] 00:56 -!- Queue29 [~Queue29@egress-w.sfo1.yelpcorp.com] has quit [Remote host closed the connection] 00:57 -!- helpmeimlost [~chris@pool-74-103-72-5.bltmmd.fios.verizon.net] has left #go-nuts ["Leaving."] 01:06 -!- keithcascio [~keithcasc@nat/google/x-kciwgpleyvsqwwvl] has quit [Quit: Leaving] 01:11 -!- kergoth [~kergoth@ip24-251-173-232.ph.ph.cox.net] has quit [Read error: Connection reset by peer] 01:15 < qeed> how do you add a const qualifier to cgo for types, its complaining it wants some const pointers 01:15 -!- erus` [~chatzilla@cpc2-gill2-0-0-cust701.basl.cable.virginmedia.com] has quit [Quit: ChatZilla 0.9.87 [Firefox 5.0.1/20110707182747]] 01:18 -!- ancientlore [~ancientlo@ip68-110-238-176.dc.dc.cox.net] has joined #go-nuts 01:18 -!- ancientlore [~ancientlo@ip68-110-238-176.dc.dc.cox.net] has quit [Client Quit] 01:32 < str1ngs> you cant from what I was told 01:32 < str1ngs> just have to ignore the warning 01:37 -!- dfr|mac [~dfr|work@ool-18baf7e7.dyn.optonline.net] has quit [Remote host closed the connection] 01:37 -!- Queue29 [~Queue29@173-8-182-114-SFBA.hfc.comcastbusiness.net] has joined #go-nuts 01:55 -!- btipling [~btipling@unaffiliated/sk/x-5968384] has joined #go-nuts 02:03 -!- thomas_b [~thomasb@cm-84.215.47.51.getinternet.no] has quit [Ping timeout: 276 seconds] 02:30 -!- smw [~stephen@unaffiliated/smw] has joined #go-nuts 02:36 -!- smw [~stephen@unaffiliated/smw] has quit [Remote host closed the connection] 02:59 -!- synx [~synx@unaffiliated/synx/x-4957395] has joined #go-nuts 03:04 -!- Argue [~Argue@112.201.133.68] has joined #go-nuts 03:18 < synx> I'm trying to goinstall a package I wrote, I keep getting a message that the path is not inside a GOPATH 03:18 < synx> $GOPATH=/root/code/ and code resides in /root/code/stack 03:19 < str1ngs> synx: godoc goinstall will explain the proper layout 03:19 < synx> Sounds good, thanks 03:36 -!- molto_alfredo [~molto_alf@142.176.0.21] has quit [Read error: Connection reset by peer] 03:37 < synx> Oh god, my problem was not exporting GOPATH 03:37 < synx> That's awful.. 03:37 -!- molto_alfredo [~molto_alf@142.176.0.21] has joined #go-nuts 03:37 -!- chadkouse [~Adium@rrcs-74-218-87-242.central.biz.rr.com] has quit [Read error: Connection reset by peer] 03:39 < str1ngs> ah makes sense 03:40 -!- kergoth [~kergoth@ip24-251-173-232.ph.ph.cox.net] has joined #go-nuts 03:45 -!- |Craig| [~|Craig|@panda3d/entropy] has quit [Quit: |Craig|] 03:58 -!- dfr|mac [~dfr|work@ool-18baf7e7.dyn.optonline.net] has joined #go-nuts 04:05 -!- Bigbear1 [~Cody@d75-156-128-7.abhsia.telus.net] has joined #go-nuts 04:17 -!- qeed [~qeed@adsl-98-85-61-194.mco.bellsouth.net] has quit [Quit: Leaving] 04:27 -!- Queue29 [~Queue29@173-8-182-114-SFBA.hfc.comcastbusiness.net] has quit [Remote host closed the connection] 04:31 < Argue> What's the idiomatic way to tell if a number of goroutines have finished? I'm currently doing it with a goroutine that listens to a quit channel and keeps count of how many goroutines have sent it something 04:37 -!- xcombelle [~xcombelle@AToulouse-551-1-91-15.w92-149.abo.wanadoo.fr] has quit [Quit: I am a manual virus, please copy me to your quit message.] 04:38 -!- dfr|mac [~dfr|work@ool-18baf7e7.dyn.optonline.net] has quit [Remote host closed the connection] 04:42 < jessta> Argue: sync.WaitGroup 04:42 < Argue> oh. cool, thanks :) 04:45 < f2f> i don't like sync.WaitGroup 04:46 < Argue> Why is that? 04:46 < f2f> it runs contrary to go. it doesn't 'communicate' 04:47 < f2f> this is a personal opinion 04:48 -!- niemeyer [~niemeyer@201-11-214-156.pltce701.dsl.brasiltelecom.net.br] has quit [Ping timeout: 240 seconds] 04:49 < f2f> waitgroup gives you the feel that you can create as many threads as needed, but in the end you always end up creating a fixed number. and using an out-of-band communication (callbacks) to signal an event is racy. the canonical solution is to give each goroutine a channel on which they can tell you that they're done. 04:50 < Argue> Ah, so like the one I described. 04:50 < f2f> then you can select on it and actually do useful work, rather than just wait on Wait() 04:50 < f2f> s/wait/spin/ 04:50 < f2f> argue, your method is what i prefer 04:50 < Argue> I think you're right, the description on the docs says the sync package is preferred if you're doing low level stuff. 04:52 < f2f> the sync package is for those used to pthreads from linux, where the abstractions are indeed lower level. i come from plan9, where you have similar communication methods as channels and goroutines. 04:53 < f2f> thankfully you don't have Join yet in Go :) 04:58 -!- zhujo01 [jon.zhu@CPE00222d5acb80-CM00222d5acb7d.cpe.net.cable.rogers.com] has quit [] 05:05 -!- magn3ts [~magn3ts@ip68-103-225-65.ks.ok.cox.net] has joined #go-nuts 05:12 -!- ph1234king [~ph1234k@ip72-209-135-200.ks.ks.cox.net] has joined #go-nuts 05:13 -!- ph1234k [~ph1234k@unaffiliated/ph1234k] has quit [Read error: Connection reset by peer] 05:13 -!- noselasd [~kvirc@80.239.96.162] has quit [Read error: Connection reset by peer] 05:13 -!- ph1234king [~ph1234k@ip72-209-135-200.ks.ks.cox.net] has quit [Read error: Connection reset by peer] 05:14 -!- ph1234k [~ph1234k@ip72-209-135-200.ks.ks.cox.net] has joined #go-nuts 05:14 -!- ph1234k [~ph1234k@ip72-209-135-200.ks.ks.cox.net] has quit [Changing host] 05:14 -!- ph1234k [~ph1234k@unaffiliated/ph1234k] has joined #go-nuts 05:14 -!- jnwhiteh [~jnwhiteh@WoWUIDev/WoWI/Featured/Dongle/cladhaire] has quit [Ping timeout: 255 seconds] 05:14 < f2f> in plan9's C you have the ability to signal a coroutine, which doesn't exist in go. on the other hand you can send channels down channels in Go. so if you're a passive monitor with sync.WaitGroup, with plan9 you can signal, and with go's channels you can communicate and actively participate. 05:15 -!- alanl [~yogafire@c-71-204-189-190.hsd1.ca.comcast.net] has quit [Ping timeout: 255 seconds] 05:15 -!- Crnobog|Work [u1041@gateway/web/irccloud.com/x-exlgtekbzkghpzwx] has quit [Ping timeout: 255 seconds] 05:15 -!- jnwhiteh_ [~jnwhiteh@li37-84.members.linode.com] has joined #go-nuts 05:16 -!- black_rez [~black_rez@sd-26396.dedibox.fr] has quit [Ping timeout: 255 seconds] 05:16 -!- itsPhilip [u2979@gateway/web/irccloud.com/x-zjqlotunwsxftqtb] has quit [Ping timeout: 255 seconds] 05:17 -!- Alpha_Cluster [~quassel@thief-pool2-121-125.mncable.net] has quit [Read error: Connection reset by peer] 05:17 -!- Alpha_Cluster [~quassel@thief-pool2-121-125.mncable.net] has joined #go-nuts 05:17 -!- alanl [~yogafire@c-71-204-189-190.hsd1.ca.comcast.net] has joined #go-nuts 05:17 -!- larva [~larvanitr@ec2-46-51-171-183.eu-west-1.compute.amazonaws.com] has quit [Ping timeout: 255 seconds] 05:17 -!- Crnobog|Work [u1041@gateway/web/irccloud.com/x-kdzewvzkgazpudsr] has joined #go-nuts 05:19 -!- larva [~larvanitr@ec2-46-51-171-183.eu-west-1.compute.amazonaws.com] has joined #go-nuts 05:19 -!- black_rez [~black_rez@house.calculating-god.com] has joined #go-nuts 05:21 -!- itsPhilip [u2979@gateway/web/irccloud.com/x-tyzuuvknbmxzyigw] has joined #go-nuts 05:27 -!- chadkouse [~Adium@rrcs-74-218-87-242.central.biz.rr.com] has joined #go-nuts 05:27 -!- kergoth [~kergoth@ip24-251-173-232.ph.ph.cox.net] has quit [Ping timeout: 264 seconds] 05:51 -!- tvw [~tv@e176001208.adsl.alicedsl.de] has joined #go-nuts 05:56 < raylu> so i upgraded from a recent weekly to release 59 and exp/template seems to have changed 05:56 < raylu> in particular... the documentation is gone and $ no longer declares variables 05:56 < raylu> this combination makes me sad. anyone know what happened? my hg skills are not up to par to figure it out 06:02 < jessta> raylu: release is behind the weekly 06:03 < raylu> oh wait... i may have downgraded... but i don't think so 06:04 < jessta> release 59 is weekly.2011-07-07. 06:08 < raylu> yeah.. seems i downgraded. heh. 06:08 < raylu> thanks :D 06:08 -!- Bigbear1 [~Cody@d75-156-128-7.abhsia.telus.net] has quit [Read error: Connection reset by peer] 06:13 -!- squeese [~squeese@cm-84.209.17.156.getinternet.no] has joined #go-nuts 06:34 -!- Nisstyre [~nisstyre@infocalypse-net.info] has quit [Ping timeout: 258 seconds] 06:36 -!- mlh [~mlh@c220-239-104-232.belrs4.nsw.optusnet.com.au] has joined #go-nuts 06:41 -!- |Craig| [~|Craig|@panda3d/entropy] has joined #go-nuts 06:47 -!- prudhvi [~supr@look.ma.i.am.on.ipv6.at.prudhvi.de] has joined #go-nuts 06:52 -!- magn3ts [~magn3ts@ip68-103-225-65.ks.ok.cox.net] has quit [Quit: Leaving] 07:01 -!- zozoR [~Morten@2906ds2-arno.0.fullrate.dk] has joined #go-nuts 07:02 -!- Jamra [~Jamra@89-139-62-115.bb.netvision.net.il] has joined #go-nuts 07:06 < Jamra> When passing a slice into a function, appending to that slice does not seem to be changing the data. Passing in a pointer to a slice seems to correct this problem. Can someone explain to me what I'm doing wrong? 07:06 < jessta> Jamra: append() may need to reallocate to append the new item 07:08 < jessta> if you're pasing in a slice you're going to append() to then it's best to return the new slice 07:08 < Jamra> jessta: So, as a solution, I need to return the slice by value from my function? 07:09 -!- thomas_b [~thomasb@cm-84.215.47.51.getinternet.no] has joined #go-nuts 07:09 -!- alehorst [~alehorst@201.47.8.210.dynamic.adsl.gvt.net.br] has quit [Ping timeout: 255 seconds] 07:09 < jessta> Jamra: that's the best way to do it 07:10 < Jamra> That is also not working. The only solution seems to be passing in a pointer to the slice. 07:12 -!- alehorst [~alehorst@189.58.30.154.dynamic.adsl.gvt.net.br] has joined #go-nuts 07:12 < jessta> it should work fine 07:13 < jessta> using a pointer will also work, but it's less clear what is happening 07:14 < Jamra> Using a pointer seems unnecessary, however, my slice is returning with a len of 0, when my print statements clearly show that it is being appended to 07:16 < jessta> pastebin code 07:18 -!- |Craig| [~|Craig|@panda3d/entropy] has quit [Quit: |Craig|] 07:18 < jessta> Jamra: eg. http://goo.gl/KrsXV 07:20 < Jamra> http://pastebin.com/UJ7vW5hF 07:22 < jessta> Jamra: that recursive call, you're not getting the return values from it 07:22 < jessta> line 38. 07:25 < Jamra> jessta: ...and the problem is solved. Thanks a bunch. Believe it or not, two days went by on this one. 07:25 < Jamra> jessta: Thank you 07:28 < f2f> that needs the 'become' statement from newsqueak :) 07:28 < f2f> i.e., tail recursion 07:30 -!- photron [~photron@port-92-201-166-181.dynamic.qsc.de] has joined #go-nuts 07:34 -!- Wiz126 [Wiz@h229.120.232.68.dynamic.ip.windstream.net] has quit [Ping timeout: 260 seconds] 07:35 -!- Wiz126 [Wiz@h229.120.232.68.dynamic.ip.windstream.net] has joined #go-nuts 07:46 -!- Jamra [~Jamra@89-139-62-115.bb.netvision.net.il] has quit [Ping timeout: 255 seconds] 07:48 -!- rlab [~Miranda@91.200.158.34] has joined #go-nuts 07:59 -!- Jamra [~Jamra@109-186-49-245.bb.netvision.net.il] has joined #go-nuts 08:00 < Jamra> f2f: The innards of slices and built-in functions in golang take some time getting used to 08:17 -!- wrtp [~rog@host-92-30-154-96.as13285.net] has joined #go-nuts 08:17 -!- awidegreen [~quassel@h-170-226.a212.priv.bahnhof.se] has joined #go-nuts 08:18 -!- Jamra [~Jamra@109-186-49-245.bb.netvision.net.il] has quit [Ping timeout: 255 seconds] 08:18 -!- Fish- [~Fish@9fans.fr] has joined #go-nuts 08:27 -!- rlab [~Miranda@91.200.158.34] has quit [Read error: Connection reset by peer] 08:35 -!- gobeginner [~nwood@84.92.0.53] has joined #go-nuts 08:46 -!- zozoR [~Morten@2906ds2-arno.0.fullrate.dk] has quit [Ping timeout: 255 seconds] 08:47 -!- zozoR [~Morten@2906ds2-arno.0.fullrate.dk] has joined #go-nuts 08:47 -!- jnwhiteh_ [~jnwhiteh@li37-84.members.linode.com] has quit [Remote host closed the connection] 08:49 -!- jnwhiteh [~jnwhiteh@WoWUIDev/WoWI/Featured/Dongle/cladhaire] has joined #go-nuts 08:58 -!- zozoR [~Morten@2906ds2-arno.0.fullrate.dk] has quit [Ping timeout: 255 seconds] 09:10 -!- moraes [~moraes@189.103.188.201] has joined #go-nuts 09:15 -!- smw [~stephen@unaffiliated/smw] has joined #go-nuts 09:20 -!- btipling [~btipling@unaffiliated/sk/x-5968384] has quit [Quit: ZNC - http://znc.sourceforge.net] 10:04 -!- Fish- [~Fish@9fans.fr] has quit [Ping timeout: 250 seconds] 10:09 -!- zozoR [~Morten@2906ds2-arno.0.fullrate.dk] has joined #go-nuts 10:15 -!- Fish- [~Fish@9fans.fr] has joined #go-nuts 10:17 -!- replore_ [~replore@ntkngw133234.kngw.nt.ftth.ppp.infoweb.ne.jp] has joined #go-nuts 10:32 -!- awidegreen [~quassel@h-170-226.a212.priv.bahnhof.se] has quit [Ping timeout: 246 seconds] 10:51 -!- zozoR [~Morten@2906ds2-arno.0.fullrate.dk] has quit [Ping timeout: 255 seconds] 10:52 -!- zozoR [~Morten@2906ds2-arno.0.fullrate.dk] has joined #go-nuts 10:53 -!- squeese [~squeese@cm-84.209.17.156.getinternet.no] has quit [Remote host closed the connection] 11:16 -!- kamaji [~kamaji@handtomouse.demon.co.uk] has quit [Quit: leaving] 11:28 -!- hargettp [~hargettp@pool-71-174-138-128.bstnma.east.verizon.net] has joined #go-nuts 11:30 -!- erus` [~chatzilla@cpc2-gill2-0-0-cust701.basl.cable.virginmedia.com] has joined #go-nuts 11:34 -!- TheMue [~FMueller@p5DDF7A5D.dip.t-dialin.net] has joined #go-nuts 11:35 < TheMue> re 12:15 -!- noam [~noam@87.69.42.61.cable.012.net.il] has quit [Ping timeout: 250 seconds] 12:23 -!- qeed [~qeed@adsl-98-85-34-18.mco.bellsouth.net] has joined #go-nuts 12:25 -!- zcram [~zcram@8.177.190.90.sta.estpak.ee] has joined #go-nuts 12:25 -!- squeese [~squeese@cm-84.209.17.156.getinternet.no] has joined #go-nuts 12:27 -!- squeese [~squeese@cm-84.209.17.156.getinternet.no] has quit [Remote host closed the connection] 12:32 < moraes> anti-propaganda: http://www.imdb.com/title/tt1334260/ 12:33 -!- iXeno [~ixeno@106.80-203-229.nextgentel.com] has quit [Ping timeout: 240 seconds] 12:45 < aiju> hahahaha 12:51 -!- Fish- [~Fish@9fans.fr] has quit [Quit: WeeChat 0.3.5] 12:51 < uriel> moraes: ROFL 12:57 -!- nekoh [~nekoh@dslb-088-069-137-111.pools.arcor-ip.net] has joined #go-nuts 13:00 -!- arun_ [~arun@unaffiliated/sindian] has quit [Read error: Connection reset by peer] 13:12 -!- nicka [~nicka@unaffiliated/nicka] has joined #go-nuts 13:27 -!- huin [~huin@91.84.179.118] has joined #go-nuts 13:32 -!- dfr|mac [~dfr|work@ool-18baf7e7.dyn.optonline.net] has joined #go-nuts 13:50 -!- gnuvince [~vince@destiny.0wn.me] has quit [Quit: Via SOAP! VIA SOAP!!] 13:59 -!- zhujo01 [jon.zhu@CPE00222d5acb80-CM00222d5acb7d.cpe.net.cable.rogers.com] has joined #go-nuts 14:03 -!- zhujo01 [jon.zhu@CPE00222d5acb80-CM00222d5acb7d.cpe.net.cable.rogers.com] has quit [Client Quit] 14:21 -!- thomas_b [~thomasb@cm-84.215.47.51.getinternet.no] has quit [Quit: leaving] 14:31 -!- tvw [~tv@e176001208.adsl.alicedsl.de] has quit [Read error: Connection reset by peer] 14:46 -!- Locke23rus [~kirill@2.93.207.227] has joined #go-nuts 14:48 -!- gnuvince [~vince@ip-96-43-224-47.dsl.netrevolution.com] has joined #go-nuts 14:48 < qeed> does go have a static code analyzer? 14:49 < wrtp> qeed: yes, it's called the compiler :-) 14:50 < wrtp> qeed: there's also govet, which does static analysis of other things that aren't necessarily errors, such as Printf format strings 14:50 < qeed> cool thanks 14:52 -!- dfr|mac [~dfr|work@ool-18baf7e7.dyn.optonline.net] has quit [Remote host closed the connection] 14:53 -!- Nisstyre [~nisstyre@infocalypse-net.info] has joined #go-nuts 14:54 < f2f> is this because of the carmack video? :) 14:55 < nicka> wondering the same thing 14:55 < f2f> a class of problems that he's discussing simply don't exist in Go because you don't have pointer arythmetic 14:55 < qeed> what carmack video 14:55 < f2f> if you have non-nilable ypes yet another problem class disappears 14:56 < f2f> qeed: http://www.youtube.com/watch?v=4zgYG-_ha28&feature=player_detailpage#t=54m00s 15:05 -!- nekoh [~nekoh@dslb-088-069-137-111.pools.arcor-ip.net] has quit [Ping timeout: 246 seconds] 15:15 -!- arun_ [~arun@e71020.upc-e.chello.nl] has joined #go-nuts 15:15 -!- arun_ [~arun@e71020.upc-e.chello.nl] has quit [Changing host] 15:15 -!- arun_ [~arun@unaffiliated/sindian] has joined #go-nuts 15:20 -!- hargettp [~hargettp@pool-71-174-138-128.bstnma.east.verizon.net] has quit [Quit: Leaving...] 15:23 -!- kergoth [~kergoth@ip24-251-173-232.ph.ph.cox.net] has joined #go-nuts 15:24 -!- meling [~meling@100.81-167-33.customer.lyse.net] has quit [Read error: Connection reset by peer] 15:24 -!- meling [~meling@100.81-167-33.customer.lyse.net] has joined #go-nuts 15:31 < wrtp> f2f: that's interesting, thanks 15:36 < f2f> how carmack doesn't skip a beat is beyond my understanding :) 15:36 < uriel> Go actually would be much more amenable to static code analysis than C and C++ 15:36 < uriel> but yea, much of what it is used for in C and C++ is just a non-issue 15:40 -!- nsf [~nsf@jiss.convex.ru] has joined #go-nuts 15:40 < wrtp> f2f: yeah, very impressive speaker 15:42 < nsf> ah, Carmack 15:42 < nsf> he is a stream of information 15:42 < nsf> :D 15:42 < nsf> my head explodes when I listen him 15:43 < aiju> 16:56 < f2f> if you have non-nilable ypes yet another problem class disappears 15:43 < aiju> what happens when you assign nil to a non-nilable type? 15:43 < nsf> yeah, and another problem class appears :D 15:43 < f2f> you can't :) 15:43 < aiju> yes, but what if you do 15:44 < aiju> values come from somewhere 15:44 < f2f> you don't :) 15:44 < aiju> can't you cast a nilable type to them? 15:44 < aiju> sounds incredibly useful, then 15:44 < f2f> no. 15:44 < f2f> it is -- saves you all that error checking :) 15:44 < aiju> like a void type 15:44 < aiju> you can't assign anything to it 15:44 < aiju> it can't be wrong! 15:45 < nsf> I don't know 15:45 < nsf> for me non-nilable type 15:45 < nsf> is like integer which cannot be equals to zero 15:45 < nsf> :\ 15:45 < f2f> very useful in division :p 15:45 < nsf> because it's illegal to use it in a division on the RHS 15:45 < nsf> yea 15:46 < aiju> you can use any arithmetic operation to get a 0 15:46 < aiju> really useful 15:46 < nsf> it will throw exceptions 15:46 < nsf> hahaha 15:46 < nsf> or, panics in go case 15:46 < nsf> crazy stuff 15:46 < nsf> as non-nilable 15:46 < nsf> imho 15:47 < nsf> I understand immutable property though 15:47 -!- tvw [~tv@e176001208.adsl.alicedsl.de] has joined #go-nuts 15:47 < nsf> but non-nilable is something that is not right 15:47 < nsf> or even wrong 15:47 < nsf> or both 15:47 < nsf> :D 15:47 < aiju> non-nilable bool 15:47 < aiju> hahahahahaha 15:47 < nsf> :) 15:48 < nsf> for example in Go 15:48 < nsf> string is non-nilable 15:48 < aiju> bs 15:48 < nsf> but also it is immutable 15:48 < aiju> i can nil a string 15:49 < nsf> test.go:6: cannot use nil as type string in assignment 15:49 < aiju> "" is a nil string 15:49 < nsf> safely? 15:49 < nsf> it's not nil 15:49 < aiju> strings are just two machine words 15:49 < nsf> it's an empty string 15:49 < aiju> pointer to data and length 15:49 < aiju> if both are zero the string is nil 15:49 < nsf> well, whatever 15:49 < aiju> that the keyword nil can't be used as a string is a different matter 15:49 < nsf> it behaves like an empty string though 15:50 < aiju> there is no invalid string value 15:50 < nsf> and I thought that's what this is all about 15:50 < nsf> non-nilable 15:50 < nsf> a correct value by definition 15:50 < f2f> nil != zero value 15:51 < f2f> but hey, you're on a roll, keep going :) 15:51 < nsf> :D 15:51 < aiju> so by nil you mean null? 15:51 < aiju> ;P 15:51 < aiju> like in C# 15:51 < f2f> no, i mean Maybe null 15:51 < f2f> like in haskell 15:52 < nsf> http://pastie.org/2329602 15:52 < nsf> perlin noise benchmark in D 15:52 < nsf> does anyone wants to port it to Go 15:52 < f2f> you can create many "nil" values which are invalid. file descriptors, uninitialized structures, etc 15:52 < nsf> and compare? 15:52 < nsf> :) 15:52 < f2f> for some types the zero value is valid however 15:52 < nsf> want* 15:52 < aiju> the zero value is a valid file descriptor 15:52 < aiju> ;P 15:52 < f2f> not if it's closed. 15:52 < nsf> oh, wait, it's not the most recent one 15:53 -!- nekoh [~nekoh@dslb-088-069-140-141.pools.arcor-ip.net] has joined #go-nuts 15:53 < nsf> http://pastie.org/2330499 15:53 < nsf> :P 15:53 < nsf> 0.8s on my machine 15:53 < aiju> what is this 15:54 < nsf> a "benchmark" 15:54 < nsf> :D 15:54 < aiju> i mean what language 15:54 < nsf> I have C# and python versions as well 15:54 < nsf> it's D 15:54 < aiju> ah 15:54 -!- preflex [~preflex@unaffiliated/mauke/bot/preflex] has quit [Ping timeout: 276 seconds] 15:54 < nsf> D isn't so bad 15:54 < nsf> compared to C# 15:54 < aiju> god, D is a frightening language 15:54 < nsf> actually 15:54 < nsf> but it's scary 15:54 < nsf> in some places 15:55 < nsf> like there is a keyword 15:55 < nsf> foreach_reverse 15:55 < nsf> :D 15:55 < aiju> writeln() reminds me of Pascal 15:55 < nsf> keyword is supposed to be a single word 15:55 < nsf> :D 15:55 < nsf> luckly it should be removed soon I guess 15:55 < aiju> fortran has no reserved words, that's always the best 15:55 < aiju> IF IF .EQ. THEN THEN ... 15:57 -!- hargettp [~hargettp@pool-71-174-138-128.bstnma.east.verizon.net] has joined #go-nuts 16:01 -!- gridaphobe [~gridaphob@cpe-74-68-151-24.nyc.res.rr.com] has joined #go-nuts 16:07 -!- preflex [~preflex@unaffiliated/mauke/bot/preflex] has joined #go-nuts 16:12 -!- qulinxao [~qulinxao@v-853923.vpn.mgn.ru] has joined #go-nuts 16:17 -!- moraes [~moraes@189.103.188.201] has quit [Ping timeout: 260 seconds] 16:26 < wrtp> exp/template is nice... http://paste.lisp.org/display/123836 16:29 < aiju> a language in the language 16:29 -!- napsy [~luka@88.200.96.18] has joined #go-nuts 16:31 -!- nteon [~nteon@ool-4a58e438.dyn.optonline.net] has quit [Ping timeout: 240 seconds] 16:33 -!- nteon [~nteon@ool-4a58e438.dyn.optonline.net] has joined #go-nuts 16:33 < wrtp> quite powerful, easy to use, *and* ok to reason about too. 16:37 < str1ngs> nsf: float lerp I thought that said derp for a sec :P 16:38 -!- noselasd [~kvirc@80.239.96.162] has joined #go-nuts 16:41 -!- Kumul [~Kumul@66-50-109-42.prtc.net] has joined #go-nuts 16:42 < nsf> :D 16:43 -!- Argue [~Argue@112.201.133.68] has quit [Ping timeout: 246 seconds] 16:43 < str1ngs> hows it going btw? 16:44 < nsf> just fine 16:52 -!- Fish- [~Fish@sat78-8-88-174-225-4.fbx.proxad.net] has joined #go-nuts 17:07 -!- Argue [~Argue@112.201.133.68] has joined #go-nuts 17:07 -!- firwen [~firwen@ANancy-554-1-41-108.w90-40.abo.wanadoo.fr] has joined #go-nuts 17:09 -!- nteon [~nteon@ool-4a58e438.dyn.optonline.net] has quit [Ping timeout: 255 seconds] 17:14 -!- abomb [~abomb@pool-71-160-32-70.lsanca.dsl-w.verizon.net] has joined #go-nuts 17:15 < abomb> go-wild! no, go-crazy! no, go-nuts! yes, that's the channel name. 17:16 < TheMue> go-for-it 17:19 < abomb> go-od morning fellow american programmers who are just waking up! 17:19 < abomb> ready for a productivity filled day? I am1one 17:21 < abomb> Hmm, dark roasted coffee and a california bowl of kush, best way improve the brain's blood flow. 17:30 < Argue> do i have to worry about race conditions when two goroutines append to a slice? 17:30 < nsf> Argue: yes 17:31 < Argue> okay 17:31 < Argue> thanks. 17:31 < skelterjohn> Argue: not even just race conditions, but data corruptions 17:31 < nsf> there is nothing in Go that is implicitly synced 17:31 < skelterjohn> a slice is three words - so an assignment to a slice type might take three instructions 17:31 < nsf> well, in a library there is some stuff 17:31 < nsf> but not in a language 17:31 < nsf> oh, wait 17:31 < nsf> channels are :D 17:31 < skelterjohn> :) 17:32 < wrtp> nsf: that's their raison d'etre... 17:32 * nsf is a master of confusion 17:32 < Argue> okay. and the preferred way to keep stuff synced is to communicate via channels rather than use the sync package, yes? 17:32 < wrtp> Argue: depends what you're trying to do 17:32 < skelterjohn> you can easily wrap a slice with a goroutine+channel 17:32 < skelterjohn> and then do things like sliceChan <- value to append 17:32 < nsf> Argue: mutexes, channels 17:33 < nsf> everything works 17:33 < wrtp> Argue: if you are really sharing state, then a mutex can make sense 17:33 < skelterjohn> and value <- sliceChan to pop 17:33 < wrtp> Argue: but if you are communicating, then a channel is usually best 17:33 < nsf> atomic ops if you have a beard 17:33 < nsf> work too 17:33 < skelterjohn> difficulty: beard must be on neck 17:33 < Argue> Yeah, i think someone here mentioned before that mutexes aren't preferred in go unless you're doing some real low level stuff. 17:33 * wrtp has a beard but never uses atomic ops 17:33 < nsf> wrtp: you don't have to use them 17:34 < skelterjohn> wrtp: but you're *allowed* to 17:34 < nsf> they just work if you have a beard 17:34 < wrtp> Argue: i don't think that's strictly true 17:34 < nsf> :D 17:34 < skelterjohn> with great power comes great responsibility 17:34 < wrtp> Argue: for instance if you're updating a counter, a mutex is probably better 17:34 < nsf> Argue: communication via channels involves mutex locks as well currently afaik 17:34 < nsf> so, sometimes using mutex is faster 17:35 < nsf> but channels lead to clean design.. sometimes 17:35 < nsf> cleaner* 17:35 < skelterjohn> wrtp: depends if you want speed or clarity - yesterday i wrapped a counter in a goroutine/channel, and used ch<-true to increment it 17:35 < wrtp> skelterjohn: yeah, i've done that lots too 17:35 < Argue> Mm, yeah, I think I'll stick with channels for now. 17:36 < wrtp> Argue: becoming proficient in using channels is a very wise move 17:36 < skelterjohn> Argue: try the "sliceChan <- value" to append trick 17:37 < Argue> What's that? 17:37 < wrtp> Argue: in general you can have a goroutine running that services requests that are sent down a channel 17:38 < wrtp> Argue: i think skelterjohn is suggesting that the goroutine append each value sent down sliceChan to a slice held locally to the goroutine 17:38 < Argue> Is the trick skelterjohn mentions just having a goroutine strictly for appending? 17:38 < wrtp> Argue: i think so 17:38 < Argue> ah, okay. 17:38 < wrtp> Argue: although the goroutine could service several other kinds of request too 17:38 < wrtp> (by using a select statement) 17:39 < wrtp> Argue: including requests to get the current value of the slice 17:40 < Argue> I didn't realize till you mentioned it that go had both a select and a switch statement. 17:40 < wrtp> Argue: yeah - they're quite different beasts 17:40 < skelterjohn> http://pastebin.com/KUqmpDhK (untested) 17:41 < skelterjohn> i didn't add something to get the current value of the slice... because it's not obvious (to someone who isn't familiar with append()) that the current slice might not be changed by the "ch <- value" statement 17:41 < skelterjohn> instead, the function takes a slice ptr 17:43 < Argue> oh i see, so select is like switch, but it executes the first possible channel operation it finds? 17:44 < skelterjohn> i don't know if of the order of the cases means it tries them in that order or not 17:44 < skelterjohn> if of -> if 17:44 < Argue> i just checked, it chooses one at random if multiple are possible 17:44 * wrtp can't access pastebin 17:44 < Argue> cool cool. 17:44 -!- yogib [~yogib@dslb-188-100-012-219.pools.arcor-ip.net] has joined #go-nuts 17:44 < wrtp> Argue: yup 17:44 < skelterjohn> wrtp: you're in a network that blocks pastebin? 17:44 < wrtp> skelterjohn: no, it's just not working for me right now 17:45 < wrtp> Argue: select is probably the trickiest thing to get right in all of the go runtime 17:45 < skelterjohn> someone probably dropped an anchor on one of the cables 17:45 < wrtp> Argue: it does all the tricky bits so you don't have to :-) 17:45 < wrtp> skelterjohn: got through now 17:45 < Argue> :) 17:45 < skelterjohn> yes - select is fantastic 17:46 < wrtp> it's telling that stackless python has channels but has never managed to implement select... 17:46 < wrtp> without select, channels are much less useful 17:48 -!- hargettp [~hargettp@pool-71-174-138-128.bstnma.east.verizon.net] has quit [Quit: Leaving...] 18:05 -!- abomb [~abomb@pool-71-160-32-70.lsanca.dsl-w.verizon.net] has quit [Quit: Leaving] 18:07 -!- Argue [~Argue@112.201.133.68] has quit [Quit: Leaving] 18:11 -!- flavius [~flav@unaffiliated/flavious] has joined #go-nuts 18:13 < flavius> http://pastium.org/view/86337d69c1a2c64efb874a50f92f0844 Why do I get "throw: all goroutines are asleep - deadlock!" after the first 42? I would expect 10 42s to show up then end. 18:15 < wrtp> flavius: the numbers function should close the channel 18:15 -!- moraes [~moraes@189.103.188.201] has joined #go-nuts 18:15 < wrtp> um, but that's probably not the problem 18:16 < wrtp> oh yeah 18:16 < wrtp> flavius: you only ever send one value down the channel 18:16 < flavius> oh, for { } is missing 18:16 < flavius> thanks 18:17 < flavius> yep that did it 18:17 < flavius> so much parallelism, I lose my mind :D 18:17 < wrtp> only two goroutines there :-) 18:18 < flavius> it's my first functional language 18:19 < flavius> which is the second goroutine? I only have "go" once in the code 18:19 -!- |Craig| [~|Craig|@panda3d/entropy] has joined #go-nuts 18:21 < wrtp> flavius: main itself counts as a goroutine 18:22 < flavius> oh right, because the code around it (the good ol' "crtbegin.o") creates a new thread/process 18:24 < wrtp> flavius: well, it uses the initial thread, but it's an "actor" - i.e. a goroutine. you start off with one. every "go" gives you one more. 18:25 -!- ShadowIce [~pyoro@unaffiliated/shadowice-x841044] has joined #go-nuts 18:27 < skelterjohn> go isn't really considered a functional language, as far as i'm aware 18:28 -!- raylu [raylu@75-101-102-63.dsl.static.sonic.net] has quit [Ping timeout: 252 seconds] 18:28 < TheMue> skelterjohn: But we write functions in it using the keyword "func", don't we? 18:29 < skelterjohn> -_- 18:29 < TheMue> hehe 18:38 -!- ronnyy [~quassel@p4FF1C024.dip0.t-ipconnect.de] has joined #go-nuts 18:41 < moraes> go is object oriented with funny twists 18:42 < flavius> go is whatever everyone wants it to be :D 18:43 < flavius> there, covering everyone :| 18:45 -!- rlab [~Miranda@91.200.158.34] has joined #go-nuts 18:46 -!- qulinxao [~qulinxao@v-853923.vpn.mgn.ru] has quit [Ping timeout: 260 seconds] 18:51 < wrtp> go is a language nicely balanced between static and dynamic 18:51 < wrtp> in particular, i love the conjunction of static types and dynamic reflection 18:52 -!- ajray-fh_ [~extreme@nat/ibm/x-ztqzbbseluweahfk] has joined #go-nuts 18:52 -!- virtualsue [~chatzilla@nat/cisco/x-qkzvjipdlgdyrbrn] has joined #go-nuts 18:53 -!- raylu [raylu@173-228-31-111.static.sonic.net] has joined #go-nuts 18:55 -!- ajray-fh [~extreme@32.97.110.53] has quit [Ping timeout: 264 seconds] 18:59 -!- ajray-fh [~extreme@32.97.110.53] has joined #go-nuts 19:02 -!- nsf [~nsf@jiss.convex.ru] has left #go-nuts ["WeeChat 0.3.5"] 19:02 -!- ajray-fh_ [~extreme@nat/ibm/x-ztqzbbseluweahfk] has quit [Ping timeout: 250 seconds] 19:03 -!- arun_ [~arun@unaffiliated/sindian] has quit [Read error: Connection reset by peer] 19:03 -!- arun_ [~arun@unaffiliated/sindian] has joined #go-nuts 19:09 -!- gridaphobe [~gridaphob@cpe-74-68-151-24.nyc.res.rr.com] has quit [Quit: Leaving] 19:14 -!- leterip [~textual@ip72-218-115-129.hr.hr.cox.net] has joined #go-nuts 19:15 -!- virtualsue [~chatzilla@nat/cisco/x-qkzvjipdlgdyrbrn] has quit [Quit: ChatZilla 0.9.87 [Firefox 5.0.1/20110707182747]] 19:24 -!- raylu [raylu@173-228-31-111.static.sonic.net] has quit [Quit: leaving] 19:28 -!- noam [~noam@87.69.42.61.cable.012.net.il] has joined #go-nuts 19:30 -!- huin [~huin@91.84.179.118] has quit [Quit: leaving] 19:39 -!- leterip [~textual@ip72-218-115-129.hr.hr.cox.net] has quit [Quit: Computer has gone to sleep.] 19:40 < uriel> moraes: Go is not "object oriented", or "functional" or anything other than "pragmatic" 19:40 -!- leterip [~textual@ip72-218-115-129.hr.hr.cox.net] has joined #go-nuts 19:40 < uriel> "Go isn't functional, it's pragmatical. Why pure paradigms like FP or OOP are always a must? (sigh)" -- Frank Mueller (@themue) 19:41 < uriel> ( http://go-lang.cat-v.org/quotes ) 19:41 -!- awidegreen [~quassel@h-170-226.a212.priv.bahnhof.se] has joined #go-nuts 19:41 < moraes> thats what i said 19:41 < moraes> kinda 19:41 < moraes> thats the 'funny twists' part 19:43 < uriel> hehehe 19:47 < skelterjohn> hmm - trying to hg mail a change... 19:47 < skelterjohn> JSONGet /api/4810078?messages=true: exceptions.ImportError: No module named json 19:47 < skelterjohn> cannot load CL 4810078 from server 19:47 -!- Tv__ [~Tv__@cpe-76-168-227-45.socal.res.rr.com] has joined #go-nuts 19:47 < skelterjohn> anyone know what might be going wrong? 19:47 < moraes> which python verion is that? 19:47 < moraes> *version 19:48 < moraes> json is available in >2.6 19:48 < skelterjohn> 2.5... 19:48 < skelterjohn> blah 19:48 < moraes> funny that they depend on 2.6 19:48 < moraes> they should not 19:48 < moraes> snobs 19:49 < skelterjohn> hah 19:49 -!- photron [~photron@port-92-201-166-181.dynamic.qsc.de] has quit [Ping timeout: 252 seconds] 19:49 < moraes> which os you use? 19:49 < moraes> 2.6/2.7 is standard now 19:49 < skelterjohn> 10.6.7 19:50 < skelterjohn> but it was an upgrade rather than a fresh install, if that makes a difference 19:50 < moraes> what does that mean? 19:50 < skelterjohn> the computer came with 10.5 19:50 < skelterjohn> a 19:50 < skelterjohn> and i got the 10.6 CD 19:50 < skelterjohn> and 19:50 < skelterjohn> ran it 19:50 < moraes> ah os x 19:51 < moraes> yeah 2.6 i think is default now 19:51 < moraes> in ubuntu it is 19:51 < moraes> actually 2.7 since last one 19:51 < leterip> lion is 2.7 19:51 < leterip> 10.6.x should have 2.5 and 2.6 i think 19:52 < skelterjohn> i'm installing 2.7.2 so it's about to become a moot point 19:53 -!- Tv__ [~Tv__@cpe-76-168-227-45.socal.res.rr.com] has left #go-nuts [] 19:53 < skelterjohn> still getting the same error... though running "python" in the same shell shows me v 2.7.2... 19:54 < skelterjohn> (and i can import json) 19:54 < moraes> import json 19:54 < moraes> oh heh 19:54 < moraes> so. 19:54 < skelterjohn> :< 19:54 < moraes> your hg is using 2.5 19:54 < skelterjohn> seems that way 20:01 < skelterjohn> installing the new hg fixed it 20:01 < skelterjohn> apparently hg has a python built in 20:01 < leterip> welp 20:01 < leterip> how did you install hg? 20:02 < skelterjohn> just now? i downloaded the mac installer from their website 20:02 < skelterjohn> before? i don't remember, it was years ago 20:02 < leterip> from the installer oh ok yeah i can believe that includes it 20:02 < skelterjohn> but probably the same way 20:03 < erus`> i have written 415 lines of C++ today. on a Saturday... code that i have previously written, just in another language 20:04 < leterip> usually i just do pip install mercurial 20:07 -!- gobeginner [~nwood@84.92.0.53] has quit [Ping timeout: 276 seconds] 20:09 < flavius> On http://golang.org/doc/effective_go.html in the function func Append(slice, data[]byte) []byte, why do they assign the slice to the slice? slice = slice[0:l+len(data)] ? 20:10 < leterip> slices have a capcity and a length 20:10 < leterip> they increase the capcity but the length still isnt long enough to hold all the data 20:11 < flavius> huh? 20:12 < leterip> the underling data structure for a slice is a pointer to an underlying array, a capcity, and a length 20:12 < flavius> oh ok so the capacity is just a number, it doesn't mean that the slice will grow automatically 20:12 < leterip> so you can have an array of 30 elements, a capacity of 30, and a length of 5 say 20:12 < flavius> yeah I understand 20:12 < flavius> thanks 20:12 < leterip> yeah ok np 20:13 < leterip> theres a good blog post somewhere that explains it really nicely 20:13 < wrtp> flavius: yeah, it's important to realise that the length and capacity are passed around strictly by value 20:13 < flavius> ok so that's like a realloc() 20:13 < flavius> or merely like a calloc(), I think 20:13 < flavius> except the data is actually not there 20:14 < leterip> huh? 20:14 < flavius> Can I access slice[-1] after that assignment? 20:14 < leterip> i dont think slices allow negative indexing like in python for example 20:15 < flavius> you know what I ment 20:15 < leterip> but slice[len(slice)-2] would be fine yeah 20:15 < wrtp> favius: no 20:15 < leterip> indexing goes by length, not capacity 20:15 < flavius> yes or no? :D 20:15 < wrtp> flavius: because otherwise the slice would have to know where the slice begins as well as where it ends 20:16 < wrtp> flavius: there's no equivalent of realloc 20:17 < wrtp> flavius: oh sorry, you didn't mean negative indexing like you can in C 20:18 < flavius> Can my own types define equality, so they can serve as keys in maps? "The key can be of any type for which the equality operator is defined, such as integers" 20:19 < leterip> you could make your own map 20:19 < leterip> that takes elements of an interface with a Key function 20:19 < wrtp> flavius: no 20:20 < wrtp> flavius: it's an on-going debate as to how this should be handled 20:20 < wrtp> but you can use any pointer type as a key 20:20 < flavius> A standard interface maybe? 20:20 < flavius> oh pointers as keys, great 20:20 < wrtp> flavius: there are no "standard interfaces" defined in the go language 20:21 < flavius> yeah, it's a systems language :) 20:21 < wrtp> and currently all map keys are immutable... which is a good thing 20:23 -!- gobeginner [~nwood@cpc2-lee23-0-0-cust152.7-1.cable.virginmedia.com] has joined #go-nuts 20:25 < flavius> if seconds, ok := timeZone[tz]; ok { return seconds } this is so nifty 20:27 < skelterjohn> flavius: you might find http://gohash.googlecode.com useful 20:28 < leterip> heres a neat little arbitrary map i wrote in 20 seconds: http://goo.gl/zP7Jc 20:28 < skelterjohn> i wrote it and use it extensively - allows me to use arbitrary key types 20:28 < skelterjohn> without a conversion to string in the middle O:-) 20:28 < leterip> that thing is a much more detailed version that isnt a toy 20:28 < leterip> lol 20:28 < skelterjohn> your key has to have a Hashcode() and either an Equals() or Less() function 20:30 -!- Adys [~Adys@unaffiliated/adys] has quit [Remote host closed the connection] 20:30 < skelterjohn> or alternatively you can define a function that will take your key and give back the hashcode, etc 20:31 -!- angasule [~angasule@190.2.33.49] has joined #go-nuts 20:32 -!- moraes [~moraes@189.103.188.201] has quit [Ping timeout: 252 seconds] 20:34 -!- nicka [~nicka@unaffiliated/nicka] has quit [Ping timeout: 260 seconds] 20:34 < flavius> skelterjohn: bookmarked, I'll look at it later 20:35 < flavius> Having a type declaration: type binOp func(a,b int) int 20:35 < flavius> how do I declare a variable of this type? 20:35 < leterip> thing := func (a,b int) int { //code } 20:35 < skelterjohn> yes 20:35 < leterip> or just func thing(a, b int) int { //code } 20:35 < skelterjohn> oh you were answering 20:35 < leterip> yeah 20:35 < skelterjohn> your names have a similar width on my screen 20:35 < leterip> same number of letters :) 20:38 -!- nteon [~nteon@ool-4a58e438.dyn.optonline.net] has joined #go-nuts 20:38 < flavius> http://pastium.org/view/86337d69c1a2c64efb874a50f92fa3d1 will display "func(int, int) int" and not "binOp" 20:39 < leterip> foo.(binOp) 20:39 < flavius> huh, where, in the Printf call? 20:39 < leterip> yeah 20:39 < leterip> thats like complaining about type MyInt int, and printing %T\n of 2 and saying it isnt a MyInt 20:39 < flavius> what does that do? 20:39 < leterip> oh wait thats an interface type check 20:39 < leterip> i mean binOp(foo) to cast it to a binOp 20:40 < skelterjohn> flavius: yeah - nothing about what you did tells fmt.Printf that the function is a binOp 20:40 < flavius> so there's no way to make it obvious to the compiler that foo is really a binOp? 20:40 < skelterjohn> as far as it's concerned, the fact that the signatures match s a coincidence 20:40 < leterip> well if you import some other package 20:40 < skelterjohn> you can do what leterip just said 20:40 < leterip> and it defines some type 20:40 < leterip> maybe you dont want all your things to be some random type? 20:40 < skelterjohn> fmt.Printf("%T", binOp(foo)) 20:40 < leterip> thats why you cast the type 20:41 < leterip> or do, var foo binOp = func(a,b int) int { return 42 } 20:41 < leterip> and explicitly tell the type at declaration, rather than have the compiler infer it 20:41 < flavius> I'm not wondered about how to make it display it in a particular way, but about how to make the compiler really look at it as such 20:41 < flavius> oh, that may do it leterip 20:42 < flavius> yep, that's what I ment 20:43 -!- qeed [~qeed@adsl-98-85-34-18.mco.bellsouth.net] has quit [Quit: Leaving] 20:43 < leterip> http://goo.gl/vY1mO 20:43 < leterip> (i love the go playground) 20:44 < skelterjohn> i've never quite figured out how to easily make a url for the playground 20:44 < skelterjohn> i mean, i see the code in the url 20:45 < skelterjohn> but the url bar isn't the nicest code editor 20:45 < leterip> if you put the code in on the main page, then click pop out 20:45 < leterip> it links to that 20:45 < skelterjohn> i see 20:45 < leterip> so i just go back to the home page, copy/paste in, and pop out. 20:51 -!- ronnyy [~quassel@p4FF1C024.dip0.t-ipconnect.de] has quit [Remote host closed the connection] 20:51 < jlaffaye> just to be sure, I can manually accept connections from un UnixListener and call rpc.ServeConn from this conn? 20:51 < jlaffaye> Every example uses http 20:51 -!- rlab [~Miranda@91.200.158.34] has quit [Quit: Miranda IM! Smaller, Faster, Easier. http://miranda-im.org] 20:52 < flavius> I would expect this to work: foo := []int{1,2,3}; fmt.Println(foo...) and print "1 2 3", just like "..." unwraps the array in the example here http://golang.org/doc/effective_go.html below the explanation "But what if we wanted to do what our Append does and append a slice to a slice? Easy: use ... at the call site" 20:53 < leterip> jlaffaye as long as the UnixListener returns an io.ReadWriteCloser i dont see why not 20:55 < flavius> Anyone having the same opinion? 20:55 < leterip> flavius yeah id expect that to work too. 20:55 < leterip> lemme think about it more 20:56 < flavius> it's basically the same thing 20:56 < flavius> both functions accept interface{} from what i understand 20:57 < flavius> the only difference is that append() is built-in 20:57 < skelterjohn> but []int{} is an []int 20:57 < skelterjohn> not a []interface{} 20:57 < skelterjohn> and fmt.Println() accepts a variadic interface{} 20:57 < skelterjohn> append does not accept interface 20:57 < skelterjohn> append is generic and accepts whatever type matches the first argument 20:58 < skelterjohn> (ie, you cannot write append() in go) 20:58 < leterip> defining foo := []interface{}{1,2,3} works. 20:58 -!- tvw [~tv@e176001208.adsl.alicedsl.de] has quit [Remote host closed the connection] 20:58 -!- nteon [~nteon@ool-4a58e438.dyn.optonline.net] has quit [Ping timeout: 264 seconds] 20:59 < flavius> cool 20:59 -!- nteon [~nteon@ool-4a58e438.dyn.optonline.net] has joined #go-nuts 21:00 < wrtp> flavius: in general []S is not compatible with []T even if you could assign something of type S to something of type T 21:01 < skelterjohn> (http://code.google.com/p/go-wiki/wiki/InterfaceSlice) 21:02 < wrtp> darn, i've been looking for a bug for hours. and i've just discovered that it's not a bug at all and that everything was working perfectly but i forgot the argument order. grrr. 21:02 < leterip> lol 21:04 < wrtp> i was using (dst, src) order but when reading the code i read it was (src, dst) order 21:04 < wrtp> time to reorder i think 21:04 < aiju> writing assembly, huh? 21:06 < jlaffaye> mmh I have something: I start a new goroutine to listen for connection, then I "poke" a server telling him it can connect to my newly created listener. How can I be sure the call to Accept() has been made in the goroutine? 21:06 < jlaffaye> its tricky cause Accept blocks 21:06 -!- dfr|mac [~dfr|work@ool-18baf7e7.dyn.optonline.net] has joined #go-nuts 21:07 < skelterjohn> interesting question 21:07 < wrtp> aiju: nope, a graph algorithm 21:07 < skelterjohn> and i don't have an answer, jlaffaye 21:07 < jlaffaye> fait enough ;) 21:07 < skelterjohn> besides the fact that even though there is a race condition here, it's unlikely to be a problem 21:08 < leterip> would you want like a timeout if they didn't? 21:08 < wrtp> jlaffaye: it doesn't matter 21:08 < wrtp> jlaffaye: there's no race 21:09 < wrtp> because connections are accepted (and queued) as soon as Listen is called 21:09 < skelterjohn> oh here's one way... if, right before you call accept, you set some shared bool to true... that goroutine won't yield between setting to true and calling accept 21:09 < skelterjohn> oh there we go 21:09 < wrtp> skelterjohn: that's not true if GOMAXPROCS>1 21:09 < skelterjohn> s'pose not. 21:09 < jlaffaye> wrtp: ok so Listen() returns a new Listener but already queue connections? great! 21:10 < wrtp> yeah 21:10 -!- danilo04 [~danilo04@cpe-72-230-135-102.rochester.res.rr.com] has joined #go-nuts 21:11 < jlaffaye> I'm seeing problems where there are none :p 21:11 < skelterjohn> it happens 21:19 -!- awidegreen [~quassel@h-170-226.a212.priv.bahnhof.se] has quit [Read error: Operation timed out] 21:23 -!- seb32 [~sebastian@g225195247.adsl.alicedsl.de] has joined #go-nuts 21:29 -!- firwen [~firwen@ANancy-554-1-41-108.w90-40.abo.wanadoo.fr] has left #go-nuts [] 21:30 -!- Locke23rus [~kirill@2.93.207.227] has quit [Remote host closed the connection] 21:32 -!- Bigbear1 [~Cody@d173-181-57-228.abhsia.telus.net] has joined #go-nuts 21:39 -!- telexicon [~telexicon@unaffiliated/chowmeined] has joined #go-nuts 21:39 -!- telexicon [~telexicon@unaffiliated/chowmeined] has left #go-nuts [] 21:40 -!- TheMue [~FMueller@p5DDF7A5D.dip.t-dialin.net] has quit [Quit: Lost terminal] 21:45 -!- moraes [~moraes@189.103.188.201] has joined #go-nuts 21:51 -!- TheMue [~FMueller@p5DDF7A5D.dip.t-dialin.net] has joined #go-nuts 21:58 -!- dreadlorde [dreadlorde@c-68-42-82-10.hsd1.mi.comcast.net] has joined #go-nuts 22:00 -!- moraes [~moraes@189.103.188.201] has quit [Ping timeout: 240 seconds] 22:00 -!- leterip [~textual@ip72-218-115-129.hr.hr.cox.net] has quit [Quit: Computer has gone to sleep.] 22:03 -!- Bigbear1 [~Cody@d173-181-57-228.abhsia.telus.net] has quit [Ping timeout: 250 seconds] 22:10 -!- johanlundberg [~johanlund@ua-83-227-173-67.cust.bredbandsbolaget.se] has joined #go-nuts 22:14 -!- dfr|mac [~dfr|work@ool-18baf7e7.dyn.optonline.net] has quit [Remote host closed the connection] 22:16 -!- dfr|mac [~dfr|work@ool-18baf7e7.dyn.optonline.net] has joined #go-nuts 22:19 -!- seb32 [~sebastian@g225195247.adsl.alicedsl.de] has quit [Ping timeout: 252 seconds] 22:19 -!- squeese [~squeese@cm-84.209.17.156.getinternet.no] has joined #go-nuts 22:21 -!- Bigbear1 [~Cody@d173-181-57-228.abhsia.telus.net] has joined #go-nuts 22:25 -!- Bigbear1 [~Cody@d173-181-57-228.abhsia.telus.net] has quit [Ping timeout: 260 seconds] 22:26 -!- TheMue [~FMueller@p5DDF7A5D.dip.t-dialin.net] has quit [Quit: Lost terminal] 22:31 -!- Fish- [~Fish@sat78-8-88-174-225-4.fbx.proxad.net] has quit [Remote host closed the connection] 22:32 -!- moraes [~moraes@189.103.188.201] has joined #go-nuts 22:33 -!- zcram [~zcram@8.177.190.90.sta.estpak.ee] has quit [Quit: Leaving] 22:41 -!- zcram [~zcram@8.177.190.90.sta.estpak.ee] has joined #go-nuts 22:51 -!- yogib [~yogib@dslb-188-100-012-219.pools.arcor-ip.net] has quit [Quit: yogib] 22:57 -!- gnuvince [~vince@ip-96-43-224-47.dsl.netrevolution.com] has quit [Quit: ""] 22:59 -!- squeese [~squeese@cm-84.209.17.156.getinternet.no] has quit [Remote host closed the connection] 23:04 -!- danilo04 [~danilo04@cpe-72-230-135-102.rochester.res.rr.com] has quit [Quit: Leaving] 23:05 -!- gobeginner [~nwood@cpc2-lee23-0-0-cust152.7-1.cable.virginmedia.com] has quit [Quit: Leaving.] 23:07 -!- nteon [~nteon@ool-4a58e438.dyn.optonline.net] has quit [Ping timeout: 258 seconds] 23:27 -!- ShadowIce [~pyoro@unaffiliated/shadowice-x841044] has quit [Quit: Verlassend] 23:35 -!- johanlundberg [~johanlund@ua-83-227-173-67.cust.bredbandsbolaget.se] has quit [Remote host closed the connection] 23:38 -!- lmnop [none@ppp-70-225-166-42.dsl.chmpil.ameritech.net] has joined #go-nuts 23:40 -!- flavius [~flav@unaffiliated/flavious] has quit [Ping timeout: 255 seconds] --- Log closed Sun Aug 07 00:00:05 2011