Go Language Resources Go, golang, go... NOTE: This page ceased updating in October, 2012

--- Log opened Fri Jul 09 00:00:13 2010
00:03 -!- nsf [~nsf@jiss.convex.ru] has quit [Ping timeout: 245 seconds]
00:04 -!- nsf [~nsf@jiss.convex.ru] has joined #go-nuts
00:11 -!- djanderson [~doug@12.182.140.4] has joined #go-nuts
00:11 -!- djanderson [~doug@12.182.140.4] has quit [Client Quit]
00:16 < nsf> done
00:16 < nsf> :P
00:19 < nsf> http://gist.github.com/468844
00:19 < nsf> that's what it generates
00:20 < nsf> you just write two functions that are on the top, and then in
the client you need to call Client_* functions
00:20 < nsf> I haven't checked it for errors yet though :)
00:21 < nsf> basically: a method for RPC registration, types for
args/replies, wrapper functions
00:21 < nsf> the generator itself: http://gist.github.com/468847
00:21 < nsf> :P
00:22 -!- kanru [~kanru@118-168-233-117.dynamic.hinet.net] has quit [Read error:
Operation timed out]
00:23 < nsf> oops, forget return statement in Client_ wrapper :D
00:23 < nsf> anyway, I hope the idea is clear
00:26 < nsf> now let's clean in it up and see how it works in real code
00:26 < nsf> :P
00:27 -!- getisboy [~Family@pool-173-76-228-217.bstnma.fios.verizon.net] has left
#go-nuts []
00:27 < nsf> oops, valve just have released an Engineer Update, coding
process has beed disrupted
00:27 < nsf> see ya :D
00:28 -!- nsf [~nsf@jiss.convex.ru] has quit [Quit: WeeChat 0.3.2]
00:32 -!- TR2N [email@89-180-179-16.net.novis.pt] has joined #go-nuts
00:40 -!- mikespook [~mikespook@219.137.233.222] has joined #go-nuts
00:44 -!- kanru [~kanru@61-30-10-70.static.tfn.net.tw] has joined #go-nuts
01:14 -!- rhelmer [~rhelmer@209.52.84.50] has joined #go-nuts
01:17 < incluye> Hey, I'm getting this error compiling gccgo on Snow Leopard
10.6.3
01:17 < incluye> http://pastebin.com/dPwkNn7n
01:24 -!- Bombe [~droden@freenet/developer/Bombe] has quit [Excess Flood]
01:24 -!- Bombe [~droden@weltgehirnmaschine.de] has joined #go-nuts
01:30 -!- WinstonSmith2600 [~Winston@67-61-99-230.cpe.cableone.net] has joined
#go-nuts
01:34 -!- beutdeuce [~beutdeuce@cpe-68-174-41-43.nj.res.rr.com] has joined
#go-nuts
01:35 -!- NfNitLoop [~bip@2001:470:b9cc:beef::1] has joined #go-nuts
01:40 -!- trustin [~trustin@redhat/jboss/trustin] has quit [Quit: Leaving]
01:56 -!- jchico [~jchico@cpe-98-14-12-209.nyc.res.rr.com] has quit [Quit:
Leaving]
02:00 -!- carllerche [~carllerch@208.87.61.203] has joined #go-nuts
02:05 < NfNitLoop> Hrmm.  I'm reading the docs and writing some code samples
to figure out if I understand things...
02:05 -!- Yappo__ [~yappo@221x243x122x124.ap221.ftth.ucom.ne.jp] has quit [Read
error: Connection reset by peer]
02:05 < NfNitLoop> It looks like if I declare an interface {String()
string}, for example...
02:06 < NfNitLoop> and I have func (x *mytype) String() string { ...  }
02:06 < NfNitLoop> only /pointers/ of mytype qualify as that interface.
02:07 < KirkMcDonald> Yes.
02:07 -!- Yappo__ [~yappo@221x243x122x124.ap221.ftth.ucom.ne.jp] has joined
#go-nuts
02:07 < KirkMcDonald> To use the jargon, we say that the type *mytype
satisfies the interface.
02:07 < KirkMcDonald> (And mytype does not.)
02:07 < NfNitLoop> Right.
02:08 < KirkMcDonald> Conversely, if the method were on mytype, then both
mytype and *mytype would satisfy the interface.
02:08 < KirkMcDonald> (Since the method set of *S includes the method set of
S.)
02:08 < NfNitLoop> errr...
02:09 < NfNitLoop> that's where I get lost.
02:09 < KirkMcDonald> Which part?  :-)
02:09 < NfNitLoop> "the method set of *S includes the method set of S"
02:09 < KirkMcDonald> The "method set" of a type refers to which methods may
be used on the type.
02:10 < KirkMcDonald> From the spec: "The method set of any other named type
T consists of all methods with receiver type T. The method set of the
corresponding pointer type *T is the set of all methods with receiver *T or T
(that is, it also contains the method set of T)."
02:11 < KirkMcDonald> So say you have type S int; func (s S) foo() {}
02:11 < KirkMcDonald> You could call x.foo() on a value of type S, or of
type *S.
02:13 < beutdeuce> why there error:
https://gist.github.com/3af9f8da251b9de16085 ?
02:13 < NfNitLoop> ok, I get that part.  But I would've sworn I just ran a
test that showed that you can also do the same thing if it's func (s *S)
02:13 -!- sioraiocht [~tomh@unaffiliated/sioraiocht] has joined #go-nuts
02:14 < KirkMcDonald> beutdeuce: 'interface' is not a valid declaration.
02:14 < beutdeuce> KirkMcDonald: oops, not supposed to be there, h/o
02:15 < beutdeuce> k, updated gist
02:15 < KirkMcDonald> beutdeuce: Oh, I think you want Number(5), not
Number{5}.
02:16 < beutdeuce> KirkMcDonald: oh, hm, that worked.  What is the
difference?
02:16 < KirkMcDonald> The syntax with the curly braces is a composite
literal, and is used for structs, arrays, slices, and maps.
02:16 < KirkMcDonald> http://golang.org/doc/go_spec.html#Composite_literals
02:17 < KirkMcDonald> But since it's just type Number int, it's just a type
conversion: http://golang.org/doc/go_spec.html#Conversions
02:17 < beutdeuce> ah, I see...  thanks
02:17 -!- sioraiocht [~tomh@unaffiliated/sioraiocht] has quit [Remote host closed
the connection]
02:19 < beutdeuce> Is it possible to have multiple receivers?  ie.  in the
form of a tuple, or that would have to be a composite type?
02:19 < KirkMcDonald> Multiple receivers?  No. I'm not even sure what the
syntax for calling that would look like.
02:20 < KirkMcDonald> You can just pass the other items as arguments.
02:21 < beutdeuce> func (x,y int) times(z int) int { return(x*y*z) }
(1,2).times(3) == 6
02:22 < KirkMcDonald> Go doesn't have tuples.
02:22 < KirkMcDonald> But you could e.g.:
02:22 < KirkMcDonald> type Point struct {x, y int}
02:22 < beutdeuce> yes
02:23 < KirkMcDonald> func (p Point) times(z int) { return p.x * p.y * z }
Point{1, 2}.times(3)
02:24 < beutdeuce> Does Go support higher-order functions?
02:25 < KirkMcDonald> There are function types, yes.
02:25 -!- scarabx [~scarabx@c-76-19-43-200.hsd1.ma.comcast.net] has quit [Quit:
This computer has gone to sleep]
02:25 < Eko> Put down the book and ask questions that pertain to how to
solve whatever problem you're actually trying to code, beutdeuce.
02:25 < KirkMcDonald> Including nested functions and closures.
02:25 < beutdeuce> Eko: i'm just playing around now, no book, no problem ;)
02:26 < Eko> I don't mean a textbook, I mean the book of "standard language
features" through which you appear to be enumerating
02:27 < beutdeuce> Eko: Is there anything wrong with that?
02:28 < Eko> beutdeuce: only that in my experience it ends with the asker
leaving the conversation unsatisfied and feeling like Go is lacking something
02:28 < Namegduf> Yes, there is.
02:28 < KirkMcDonald> Eko: Closures are a perfectly cromulent thing to
inquire about.
02:28 < beutdeuce> Eko: not at all
02:28 < beutdeuce> Namegduf: elaborate
02:28 < KirkMcDonald> (Not least because Go has them.) :-)
02:28 < KirkMcDonald> (Well, he didn't ask about closures.)
02:28 < KirkMcDonald> (Whatever.)
02:28 < Eko> KirkMcDonald: I was about to say, lol
02:29 < Namegduf> A language exists to solve problems, not to provide a
subset of standard features.  Variations in typical style and the precise
semantics of the features will cause sufficient variation in the ease of solving
problems that will not correlate precisely to featureset.
02:29 < KirkMcDonald> I could have said "yes, it has function pointers," but
closures are ever so much more interesting.
02:29 < Eko> a higher order function is a function factory, no?
02:29 < Namegduf> Equally, complexity of use will not correlate precisely to
featureset (Go technically has something exception-like, but they don't add
complexity to typical code due to strict conventions)
02:29 < NfNitLoop> Namegduf: so you can't ask about features of the
language?
02:30 < beutdeuce> Namegduf: My problem is an inquiry of illuminating a
subset of standard features.  Care to solve it now?
02:30 < Namegduf> No, you can, I just commented on the "enumerating standard
language features" thing as being unwise, not specific things.
02:30 < Namegduf> I'll admit I'm thinking of the guy who claimed that Go was
useless because it didn't have a protected keyword on the mailing list recently.
02:31 < beutdeuce> Namegduf: I dont see how asking if Go supports
higher-order functions is unwise
02:31 < Namegduf> It isn't.
02:31 < Eko> e.g.  func pow(n int) func(int)int { return func(x
int){p:=1;for i:=0;i<n;i++{p*=x}return p} }
02:31 < KirkMcDonald> Eko: As far as I understand it, it merely implies the
ability to pass functions around as values.
02:31 < Eko> which returns a function that will return its argument to the
original function's input
02:31 < KirkMcDonald> Meaning that function pointers suffice.
02:31 < Namegduf> I'm unfamiliar with the difference between first class
functions and higher order functions.
02:32 < Namegduf> (If any)
02:32 < Namegduf> Go certainly has the latter, and can through closures
create function factories.
02:32 < Eko> first class means you can pass a callable object representing a
function as a value
02:32 < beutdeuce> higher-order specifically refers to the ability of a
function to receive or return functions
02:32 < Namegduf> Er, certainly has the former
02:34 < beutdeuce> thanks for answering my question
02:35 < NfNitLoop> KirkMcDonald: I've elaborated on my sample and what's
confusing me here: (see comment @ bottom) http://gist.github.com/468961
02:35 < Eko> beutdeuce: in any case, be careful about asking "Does Go have X
feature?" When what you really mean is "How do I accomplish Y behavior (that is
implemented in some languages with X)?"
02:36 < beutdeuce> Eko: thanks for the heads up
02:36 < KirkMcDonald> NfNitLoop: That smells like a bug to me.
02:36 < Eko> a good example is "Does Go have mutexes?" (though it does) when
what you should ask is "How do I synchronize data access across goroutines?"
02:36 < Eko> the latter example will be far more educational.
02:37 < beutdeuce> Eko: indeed, though a short, informative response would
suffice in my case
02:37 < NfNitLoop> KirkMcDonald: ok.  It did seem a bit inconsistent.
02:37 < KirkMcDonald> NfNitLoop: Ah!
02:37 < KirkMcDonald> It is not a bug:
02:37 < KirkMcDonald> " If x is addressable and &x's method set contains m,
x.m() is shorthand for (&x).m():"
02:37 < KirkMcDonald> http://golang.org/doc/go_spec.html#Calls
02:37 < KirkMcDonald> Interesting.
02:38 < KirkMcDonald> But it is stricter when converting to an interface
type.
02:38 < NfNitLoop> aaaah.
02:38 < NfNitLoop> Grr.
02:39 < NfNitLoop> Does "addressable" mean "not an interface type"?
02:40 * NfNitLoop searches through docs.
02:40 < Eko> NfNitLoop: it means it's not an ideal value
02:40 < Eko> in other words.  1, 6.2, -6j, or "blah"
02:40 < NfNitLoop> That doesn't really clarify anything for me.  :p What is
an "ideal value"?
02:40 < NfNitLoop> aah.
02:41 < Eko> and I can never remember for the life of me if *x inherits x's
methods or x inherits *x's methods, I always have to look it up.
02:41 < Eko> though I usually assume it's the latter because I always write
methods with *x as the target.
02:42 < NfNitLoop> It seems like you might as well do that, since if you
have one, you're stuck with returning *x everywhere anyway to satisfy interfaces.
:p
02:43 < Eko> well, if you want your object to be modifiable
02:43 < NfNitLoop> *nod*
02:43 < Namegduf> Yeah
02:43 < Eko> it actually comes out rather nicely in the end
02:43 < KirkMcDonald> *x inherits x's method set.
02:43 < Namegduf> The problem is that methods on *x can assume they're able
to modify x
02:43 < Eko> it's a brilliant idea, and I would love to buy a beer for
whoever came up with it.
02:43 < Eko> KirkMcDonald: actually, I think x inherits *x's method set
02:43 < Namegduf> Which, if you're giving them an x, they can't.
02:44 < Namegduf> Because the x is copied, not referenced.
02:44 < NfNitLoop> *nod* I got that bit.
02:44 < KirkMcDonald> Eko: No.
02:44 < Namegduf> Methods on x, however, do not assume they're able to
modify x- but it won't hurt, really.
02:44 < Namegduf> Well, it's an automatic dereference, which is safe.
02:46 < beutdeuce> How do i accomplish passing a primitive as a receiver to
prevent spamming function with conversions?
02:47 < Eko> x.m() is shorthand for (&x).m() -> doesn't that imply that x
inherits *x's methods?
02:48 < Ginto8> Eko, sort of
02:48 < Ginto8> if x is a T
02:48 < Eko> beutdeuce: for that you'd have to type MyInt int and use MyInt
as the receiver, no?
02:48 < KirkMcDonald> Eko: Only when x is addressable.
02:48 < Ginto8> then you can use x.f() where x is a method for a T
02:49 < beutdeuce> Eko: can't, i get: cannot define new methods on non-local
type int
02:49 < KirkMcDonald> Eko: And this does not mean that it inherits the
method set.  This is why you could not convert x to an interface type when *x's
method set contains the necessary methods.
02:49 < Ginto8> but x doesn't complete interface{ f() }
02:49 < Ginto8> f is a method for *T **
02:50 < KirkMcDonald> (The return value of a function, for instance, is not
addressable.)
02:50 < Ginto8> basically, if it's addressable then it automatically gets
addressed so that you can call *T methods with it
02:50 < Ginto8> otherwise it can only use T methods
02:51 < KirkMcDonald> ("Addressable" == "lvalue")
02:51 < Ginto8> ^ that
02:51 < Ginto8> sorry couldn't figure out how to define addressable =/
02:51 < KirkMcDonald> http://golang.org/doc/go_spec.html#Address_operators
02:51 < KirkMcDonald> It is defined like that.  :-)
02:53 -!- carllerche [~carllerch@208.87.61.203] has quit [Quit: carllerche]
02:53 -!- lulu [~lulu@lo1-156.srmd01.resnet.ubc.ca] has joined #go-nuts
02:54 < Eko> beutdeuce: http://gist.github.com/468973
02:56 -!- esiroker [~esiroker@adsl-99-49-227-57.dsl.pltn13.sbcglobal.net] has
joined #go-nuts
02:56 -!- lulu [~lulu@lo1-156.srmd01.resnet.ubc.ca] has quit [Client Quit]
02:56 < beutdeuce> Eko: i see, so there is no way of passing a plain
primitive, right?
02:57 -!- halfie_ [~lulu@v-115-10.vpn.dhcp.ubc.ca] has quit [Ping timeout: 260
seconds]
02:59 < Eko> beutdeuce: unless it is a local type, you cannot define methods
for it, because that is the only way the compiler can construct the static
interface mapping tables for it
02:59 < Eko> and defining new methods for int is just as dangerous as
defining new methods for os.Error
02:59 < beutdeuce> Eko: makes sense, thnx
03:00 < Eko> creating a wrapper type forces you to forcibly convert it,
which then lets the compiler know what interface tables to map
03:00 < Eko> !golang conversions
03:00 < GoBIR> Eko: Spec Section Conversions -
http://golang.org/doc/go_spec.html#Conversions
03:00 < Eko> also, there's a good article on rsc if I can find it...
03:01 < Eko>
http://research.swtch.com/2009/12/go-data-structures-interfaces.html
03:01 < Eko> fascinating reading.
03:02 < beutdeuce> thanks
03:03 -!- mxweas [~max@c-98-225-102-170.hsd1.az.comcast.net] has joined #go-nuts
03:12 < beutdeuce> Does Go use the Boehm GC ?
03:12 < cw> no
03:12 < Eko> right now it's just mark and sweep, lol
03:13 < Eko> I think the google guys are working on the IBM in-situ
multithreaded GC though
03:17 -!- niemeyer [~niemeyer@201-11-213-235.pltce701.dsl.brasiltelecom.net.br]
has quit [Ping timeout: 265 seconds]
03:24 -!- beutdeuce [~beutdeuce@cpe-68-174-41-43.nj.res.rr.com] has quit [Quit:
beutdeuce]
03:30 -!- incluye [~inklewyay@NW-ESR1-74-215-114-218.fuse.net] has quit [Remote
host closed the connection]
03:42 -!- tsykoduk [~tsykoduk@2001:470:1f04:671:20d:93ff:fe77:1dc4] has quit [Ping
timeout: 260 seconds]
03:43 -!- tsykoduk [~tsykoduk@2001:470:1f04:671:20d:93ff:fe77:1dc4] has joined
#go-nuts
04:04 -!- incluye [~inklewyay@NW-ESR1-74-215-114-218.fuse.net] has joined #go-nuts
04:08 -!- gnuvince_ [~vince@72.0.215.102] has quit [Quit: What the fruit is goin'
on here!?]
04:30 -!- Tiger_ [~chatzilla@222.73.189.45] has joined #go-nuts
04:39 -!- nsf [~nsf@jiss.convex.ru] has joined #go-nuts
04:56 -!- kashia_ [~Kashia@port-92-200-151-85.dynamic.qsc.de] has joined #go-nuts
04:59 -!- Kashia [~Kashia@port-92-200-57-79.dynamic.qsc.de] has quit [Ping
timeout: 260 seconds]
05:00 -!- scm [justme@d071065.adsl.hansenet.de] has quit [Ping timeout: 265
seconds]
05:01 -!- carllerche [~carllerch@208.87.61.203] has joined #go-nuts
05:01 -!- scm [justme@d070110.adsl.hansenet.de] has joined #go-nuts
05:02 -!- beutdeuce [~beutdeuce@cpe-68-174-41-43.nj.res.rr.com] has joined
#go-nuts
05:26 -!- carllerche [~carllerch@208.87.61.203] has quit [Quit: carllerche]
05:34 -!- carllerche [~carllerch@208.87.61.203] has joined #go-nuts
05:39 -!- beutdeuce [~beutdeuce@cpe-68-174-41-43.nj.res.rr.com] has left #go-nuts
[]
05:48 -!- mxweas [~max@c-98-225-102-170.hsd1.az.comcast.net] has quit [Quit:
mxweas]
06:03 -!- belkiss [~belkiss@drn13-1-78-235-168-105.fbx.proxad.net] has joined
#go-nuts
06:05 -!- gmurphy [~gmurphy@124-171-170-137.dyn.iinet.net.au] has joined #go-nuts
06:09 -!- carllerche [~carllerch@208.87.61.203] has quit [Quit: carllerche]
06:10 -!- Eridius [~kevin@unaffiliated/eridius] has quit [Ping timeout: 248
seconds]
06:18 -!- napsy [~napsy@193.2.66.101] has joined #go-nuts
06:20 -!- MaybeSo [~jimr@lions.Stanford.EDU] has joined #go-nuts
06:23 -!- viirya [~viirya@cml506-25.csie.ntu.edu.tw] has quit [Ping timeout: 260
seconds]
06:23 -!- Eko [~eko@DHCP-159-138.caltech.edu] has quit [Quit: Leaving]
06:25 < nsf> with current rpc package is it possible to make a function that
has no arguments and has no replies?
06:26 < nsf> or should I use zero int values for that?
06:26 < nsf> (for example)
06:30 -!- viirya [~viirya@cml506-25.csie.ntu.edu.tw] has joined #go-nuts
06:31 -!- GoBIR [~gobir@DHCP-159-138.caltech.edu] has quit [Read error: Connection
reset by peer]
06:33 -!- GoBIR [~gobir@DHCP-159-138.caltech.edu] has joined #go-nuts
06:36 -!- emmanueloga [~emmanuelo@190.247.41.202] has quit [Ping timeout: 245
seconds]
06:38 -!- jA_cOp [~yakobu@unaffiliated/ja-cop/x-9478493] has joined #go-nuts
06:46 -!- Tiger_ [~chatzilla@222.73.189.45] has quit [Read error: Connection reset
by peer]
06:48 -!- Elems [~Jake@c-98-215-113-215.hsd1.il.comcast.net] has quit [Quit:
Leaving.]
06:49 -!- gmurphy [~gmurphy@124-171-170-137.dyn.iinet.net.au] has quit [Quit:
Laters]
06:49 -!- Tiger_ [~chatzilla@222.73.189.45] has joined #go-nuts
06:52 -!- unhygienix [~unhygieni@host86-177-113-38.range86-177.btcentralplus.com]
has quit [Quit: unhygienix]
06:54 -!- emmanueloga [~emmanuelo@190.247.41.202] has joined #go-nuts
07:01 -!- Bombe [~droden@weltgehirnmaschine.de] has quit [Changing host]
07:01 -!- Bombe [~droden@freenet/developer/Bombe] has joined #go-nuts
07:03 -!- hcatlin [~hcatlin@pdpc/supporter/professional/hcatlin] has joined
#go-nuts
07:06 -!- ExtraSpice [~ExtraSpic@88.118.32.225] has joined #go-nuts
07:08 -!- rlab [~Miranda@91.200.158.34] has joined #go-nuts
07:10 -!- hcatlin [~hcatlin@pdpc/supporter/professional/hcatlin] has quit [Quit:
hcatlin]
07:35 -!- sioraiocht [~tomh@unaffiliated/sioraiocht] has joined #go-nuts
07:37 < nf> nsf: use pointers to struct{}
07:37 -!- belkiss [~belkiss@drn13-1-78-235-168-105.fbx.proxad.net] has quit [Quit:
KVIrc Insomnia 4.0.0, revision: 4519, sources date: 20100519, built on: 2010-06-24
07:22:03 UTC http://www.kvirc.net/]
07:38 < nsf> nf: thanks
07:38 < nf> :)
07:39 -!- sioraiocht [~tomh@unaffiliated/sioraiocht] has quit [Remote host closed
the connection]
07:46 -!- zozoR [~zozoR@0x5da69cf2.cpe.ge-0-1-0-1105.hsnqu1.customer.tele.dk] has
joined #go-nuts
07:52 -!- visof [~visof@unaffiliated/visof] has joined #go-nuts
08:00 < nsf> http://nsf.110mb.com/gocomplete.swf <- check this out, an
early autocompletion daemon demo :)
08:00 < nsf> (terminal screencast, adobe flash format)
08:01 < nsf> and of course I want to know what do you think :)
08:05 < jessta> waiting for you to type is kind of annoying
08:05 < ender2070> jessta +1
08:06 < jessta> perhaps you could speed that section up a bit
08:06 < nsf> or completely remove
08:06 < nsf> :)
08:07 < nsf> anyway, I'll better make a usable example next time :)
08:08 -!- tvw [~tv@212.79.9.150] has joined #go-nuts
08:09 < jessta> also, some of those autocompletes seem wrong
08:09 < nsf> are they?
08:09 < nsf> I haven't noticed
08:09 < nsf> for example?
08:09 < jessta> oh, actually never mind
08:10 -!- esiroker [~esiroker@adsl-99-49-227-57.dsl.pltn13.sbcglobal.net] has quit
[Quit: esiroker]
08:11 < ender2070> it might not be so bad if there was a progress bar you
could use to jump around in the video
08:11 < nsf> ender2070: maybe, but I think a soundless console screencast is
a bad idea
08:12 < nsf> but I really suck at speaking english
08:12 < nsf> so..
08:12 < nsf> I'll just write code :D
08:12 < ampleyfly> show a text file?  o.o
08:12 < nsf> maybe..  :D
08:14 < nsf> or a screenshot: http://omploader.org/vNHZvdg/gocomplete.png
08:14 < nsf> it pretty much explains everything )
08:17 -!- yuval [~yuval@85-250-180-221.bb.netvision.net.il] has joined #go-nuts
08:17 < nsf> screencast just shows more about "daemon" thing
08:20 -!- yuval [~yuval@85-250-180-221.bb.netvision.net.il] has left #go-nuts []
08:20 -!- yuval2 [~yuval@85-250-180-221.bb.netvision.net.il] has joined #go-nuts
08:25 -!- nsf [~nsf@jiss.convex.ru] has quit [Quit: WeeChat 0.3.2]
08:26 -!- yuval2 [~yuval@85-250-180-221.bb.netvision.net.il] has quit [Remote host
closed the connection]
08:27 -!- yuz [~yuval@85-250-180-221.bb.netvision.net.il] has joined #go-nuts
08:27 -!- rlab [~Miranda@91.200.158.34] has quit [Read error: Connection reset by
peer]
08:28 -!- visof_ [~visof@41.238.234.128] has joined #go-nuts
08:29 -!- kashia_ [~Kashia@port-92-200-151-85.dynamic.qsc.de] has quit [Quit: This
computer has gone to sleep]
08:31 -!- photron_ [~photron@port-92-201-110-226.dynamic.qsc.de] has joined
#go-nuts
08:32 -!- visof [~visof@unaffiliated/visof] has quit [Ping timeout: 240 seconds]
08:38 -!- yuz [~yuval@85-250-180-221.bb.netvision.net.il] has quit [Remote host
closed the connection]
08:42 -!- temoto [~temoto@81.19.90.173] has joined #go-nuts
08:42 < temoto> How to set up signal handler?
08:47 < napsy> temoto: man 3 signal
08:47 < temoto> napsy, i mean in Go.
08:47 -!- ikaros [~ikaros@drms-4d014ccb.pool.mediaWays.net] has joined #go-nuts
08:52 < napsy> oh right, sorry
08:52 < napsy> didn't see the channel
08:53 < napsy> have you looked at the os or syscall packages?
09:00 < temoto> napsy, there's separate os/signal package, now i feel stupid
:)
09:02 -!- General1337 [~support@71-84-50-230.dhcp.mtpk.ca.charter.com] has joined
#go-nuts
09:04 -!- Project_2501 [~Marvin@82.84.75.14] has joined #go-nuts
09:05 -!- General13372 [~support@71-84-50-230.dhcp.mtpk.ca.charter.com] has quit
[Ping timeout: 240 seconds]
09:16 -!- zozoR [~zozoR@0x5da69cf2.cpe.ge-0-1-0-1105.hsnqu1.customer.tele.dk] has
quit [Quit: Morten.  Desu~]
09:21 -!- GeoBSD [~geobsd@lns-bzn-38-82-253-122-149.adsl.proxad.net] has joined
#go-nuts
09:24 -!- ikaros_ [~ikaros@drms-4d01517f.pool.mediaWays.net] has joined #go-nuts
09:27 -!- ikaros [~ikaros@drms-4d014ccb.pool.mediaWays.net] has quit [Ping
timeout: 240 seconds]
09:47 -!- Adys [~Adys@unaffiliated/adys] has quit [Read error: Connection reset by
peer]
09:50 -!- Adys [~Adys@unaffiliated/adys] has joined #go-nuts
10:03 -!- mikespook [~mikespook@219.137.233.222] has quit [Quit: Leaving.]
10:12 -!- wrtp [~rog@92.41.143.251.sub.mbb.three.co.uk] has joined #go-nuts
10:13 -!- antonkovalyov [~antonkova@94.141.87.132] has joined #go-nuts
10:21 -!- wrtp [~rog@92.41.143.251.sub.mbb.three.co.uk] has quit [Ping timeout:
245 seconds]
10:34 -!- kanru [~kanru@61-30-10-70.static.tfn.net.tw] has quit [Quit: WeeChat
0.3.2]
10:43 -!- rlab [~Miranda@91.200.158.34] has joined #go-nuts
10:44 -!- ibrahim [~user@c-98-217-246-212.hsd1.ma.comcast.net] has joined #go-nuts
10:45 -!- ibrahim [~user@c-98-217-246-212.hsd1.ma.comcast.net] has quit [Remote
host closed the connection]
10:51 -!- rv2733 [~ron@c-98-242-168-49.hsd1.fl.comcast.net] has joined #go-nuts
11:09 -!- skelterjohn [~jasmuth@c-76-116-181-134.hsd1.nj.comcast.net] has joined
#go-nuts
11:16 < temoto> for sig := range signal.Incoming is great
11:17 -!- skelterjohn [~jasmuth@c-76-116-181-134.hsd1.nj.comcast.net] has quit
[Quit: skelterjohn]
11:23 -!- artefon [~thiago@189.107.128.226] has joined #go-nuts
11:28 -!- visof_ [~visof@41.238.234.128] has quit [Ping timeout: 245 seconds]
11:43 -!- belkiss [~belkiss@drn13-1-78-235-168-105.fbx.proxad.net] has joined
#go-nuts
11:51 -!- belkiss [~belkiss@drn13-1-78-235-168-105.fbx.proxad.net] has quit [Quit:
KVIrc Equilibrium 4.1.0, revision: 4632, sources date: 20100519, built on:
2010-07-09 07:13:47 UTC http://www.kvirc.net/]
11:52 -!- nsf [~nsf@jiss.convex.ru] has joined #go-nuts
11:52 -!- Adys [~Adys@unaffiliated/adys] has quit [Quit: I ♥ Unicode]
12:22 -!- antonkovalyov [~antonkova@94.141.87.132] has quit [Ping timeout: 252
seconds]
12:26 -!- skelterjohn [~jasmuth@c-76-116-181-134.hsd1.nj.comcast.net] has joined
#go-nuts
12:35 -!- niemeyer [~niemeyer@201-11-213-235.pltce701.dsl.brasiltelecom.net.br]
has joined #go-nuts
12:36 -!- wrtp [~rog@92.17.79.60] has joined #go-nuts
12:36 -!- wrtp [~rog@92.17.79.60] has quit [Remote host closed the connection]
12:36 -!- wrtp [~rog@92.17.79.60] has joined #go-nuts
12:38 -!- nsf [~nsf@jiss.convex.ru] has quit [Quit: WeeChat 0.3.2]
12:41 -!- lmoura [~lmoura@187.78.130.104] has quit [Ping timeout: 265 seconds]
12:44 -!- crashR [~crasher@codextreme.pck.nerim.net] has joined #go-nuts
12:46 -!- djanderson [~doug@12.182.140.4] has joined #go-nuts
12:47 -!- djanderson [~doug@12.182.140.4] has left #go-nuts []
12:48 -!- sladegen [~nemo@unaffiliated/sladegen] has quit [Ping timeout: 265
seconds]
12:49 -!- rv2733 [~ron@c-98-242-168-49.hsd1.fl.comcast.net] has quit [Quit:
Leaving]
12:49 -!- sladegen [~nemo@unaffiliated/sladegen] has joined #go-nuts
12:49 -!- wrtp [~rog@92.17.79.60] has quit [Ping timeout: 265 seconds]
12:50 -!- nf [~nf@124-168-144-227.dyn.iinet.net.au] has quit [Remote host closed
the connection]
12:50 -!- nf [~nf@124-168-168-17.dyn.iinet.net.au] has joined #go-nuts
12:53 -!- Tiger_ [~chatzilla@222.73.189.45] has quit [Ping timeout: 240 seconds]
12:55 -!- wrtp [~rog@92.17.68.169] has joined #go-nuts
12:59 -!- scarabx [~scarabx@c-76-19-43-200.hsd1.ma.comcast.net] has joined
#go-nuts
13:00 -!- wrtp [~rog@92.17.68.169] has quit [Ping timeout: 276 seconds]
13:01 -!- Gracenotes [~person@wikipedia/Gracenotes] has quit [Ping timeout: 265
seconds]
13:06 -!- wrtp [~rog@92.16.127.173] has joined #go-nuts
13:10 -!- wrtp [~rog@92.16.127.173] has quit [Ping timeout: 252 seconds]
13:13 -!- crashR [~crasher@codextreme.pck.nerim.net] has quit [Quit: (◣_◢)
BigBrowser is watching ⓎⓄⓊ]
13:15 -!- Tiger_ [~chatzilla@222.73.189.45] has joined #go-nuts
13:16 -!- wrtp [~rog@92.17.27.37] has joined #go-nuts
13:22 -!- hcatlin [~hcatlin@pdpc/supporter/professional/hcatlin] has joined
#go-nuts
13:24 -!- skelterjohn [~jasmuth@c-76-116-181-134.hsd1.nj.comcast.net] has quit
[Quit: skelterjohn]
13:38 -!- Adys [~Adys@unaffiliated/adys] has joined #go-nuts
13:44 -!- napsy [~napsy@193.2.66.101] has quit [Quit: leaving]
13:48 -!- micrypt [~micrypt@94-195-127-212.zone9.bethere.co.uk] has joined
#go-nuts
13:52 -!- awidegreen [~quassel@62.176.237.78] has joined #go-nuts
13:58 -!- tvw [~tv@212.79.9.150] has quit [Remote host closed the connection]
14:03 -!- scarabx [~scarabx@c-76-19-43-200.hsd1.ma.comcast.net] has quit [Quit:
This computer has gone to sleep]
14:08 -!- hcatlin [~hcatlin@pdpc/supporter/professional/hcatlin] has quit [Quit:
hcatlin]
14:14 -!- hcatlin [~hcatlin@pdpc/supporter/professional/hcatlin] has joined
#go-nuts
14:23 -!- skelterjohn [~jasmuth@lawn-net168-in.rutgers.edu] has joined #go-nuts
14:24 -!- Soultaker [~maks@hell.student.utwente.nl] has quit [Read error:
Connection reset by peer]
14:35 -!- incluye [~inklewyay@NW-ESR1-74-215-114-218.fuse.net] has quit [Ping
timeout: 276 seconds]
14:36 -!- gr0gmint [~joebiden@87.60.23.38] has joined #go-nuts
14:38 -!- Kashia [~Kashia@port-92-200-151-85.dynamic.qsc.de] has joined #go-nuts
14:40 -!- gr0gmint [~joebiden@87.60.23.38] has quit [Quit: leaving]
14:46 -!- lmoura [~lmoura@187.78.130.104] has joined #go-nuts
14:46 -!- ikaros_ [~ikaros@drms-4d01517f.pool.mediaWays.net] has quit [Quit: Leave
the magic to Houdini]
14:51 -!- Adys [~Adys@unaffiliated/adys] has quit [Quit: I ♥ Unicode]
14:52 < temoto> use_url := *url does this create a deep/full copy of URL
struct?
14:54 < skelterjohn> if url is type *URL, then whatever data comprises a URL
will be copied
14:54 < skelterjohn> i don't know what's inside it, off the top of my head
14:54 -!- incluye [~inklewyay@NW-ESR1-74-215-114-218.fuse.net] has joined #go-nuts
14:54 < skelterjohn> but if there are any pointers, for instance, then only
the pointer will be copied
14:57 -!- samferry [sam@atheme/member/samferry] has quit [Read error: Operation
timed out]
14:58 < temoto> skelterjohn, it consists of dozen strings.
14:59 < skelterjohn> whatever the copy operation for a string is, then
15:00 < temoto> skelterjohn, thanks.
15:00 < chressie> strings are immutable, so nothing gets copied probably..
15:01 < chressie> only the pointers to the strings
15:05 -!- artefon [~thiago@189.107.128.226] has quit [Quit: bye]
15:05 < skelterjohn> bottom line is that the struct takes up a certain
number of bytes.  some of those bytes may belong to a pointer, in which case it
could represent a very rich data structure, but the pointer's bytes are all that
are in the struct's bytes.  the struct's bytes are all that is copied
15:05 < skelterjohn> so not a deep copy
15:06 -!- opafan48 [~opafan48@213.144.157.75] has quit [Remote host closed the
connection]
15:17 -!- rhelmer [~rhelmer@209.52.84.50] has quit [Quit: rhelmer]
15:20 -!- Tiger [~chatzilla@222.73.189.45] has joined #go-nuts
15:22 -!- Venom_X [~pjacobs@71.21.124.111] has joined #go-nuts
15:23 < temoto> skelterjohn, like in C, i got it, thanks.
15:23 -!- Tiger_ [~chatzilla@222.73.189.45] has quit [Ping timeout: 240 seconds]
15:28 -!- ikaros [~ikaros@guests133.externals.de] has joined #go-nuts
15:32 -!- hcatlin [~hcatlin@pdpc/supporter/professional/hcatlin] has quit [Quit:
hcatlin]
15:33 -!- rejb [~rejb@unaffiliated/rejb] has joined #go-nuts
15:35 -!- wrtp_ [~rog@92.17.27.37] has joined #go-nuts
15:37 -!- samferry [sam@atheme/member/samferry] has joined #go-nuts
15:37 -!- rhelmer [~rhelmer@209.52.84.51] has joined #go-nuts
15:39 -!- wrtp [~rog@92.17.27.37] has quit [Ping timeout: 264 seconds]
15:40 -!- incluye [~inklewyay@NW-ESR1-74-215-114-218.fuse.net] has quit [Remote
host closed the connection]
15:45 -!- samferry [sam@atheme/member/samferry] has quit [Read error: Operation
timed out]
15:53 -!- rhelmer [~rhelmer@209.52.84.51] has quit [Quit: rhelmer]
15:53 < temoto> Does anyone work on memcache client library and needs
tester?
15:54 -!- samferry [sam@atheme/member/samferry] has joined #go-nuts
15:54 -!- mduft [~mduft@gentoo/developer/mduft] has quit [Ping timeout: 264
seconds]
15:57 -!- ikaros [~ikaros@guests133.externals.de] has quit [Quit: Leave the magic
to Houdini]
16:03 -!- incluye [~inklewyay@NW-ESR1-74-215-114-218.fuse.net] has joined #go-nuts
16:03 -!- abiosoft [~abiosoft@41.155.80.222] has joined #go-nuts
16:05 -!- samferry [sam@atheme/member/samferry] has quit [Read error: Operation
timed out]
16:08 -!- abiosoft [~abiosoft@41.155.80.222] has quit [Ping timeout: 265 seconds]
16:08 < skelterjohn> temoto: yes exactly like in C. sorry, I should have
said that in the beginning :)
16:14 -!- samferry [sam@atheme/member/samferry] has joined #go-nuts
16:15 -!- b00m_chef [~watr@216-21-143-134.ip.van.radiant.net] has joined #go-nuts
16:17 -!- samferry [sam@atheme/member/samferry] has quit [Read error: Operation
timed out]
16:19 -!- samferry [sam@atheme/member/samferry] has joined #go-nuts
16:23 -!- incluye [~inklewyay@NW-ESR1-74-215-114-218.fuse.net] has quit [Remote
host closed the connection]
16:24 -!- artefon [~thiagon@150.164.2.20] has joined #go-nuts
16:26 -!- abiosoft [~abiosoft@41.155.73.61] has joined #go-nuts
16:29 -!- abiosoft [~abiosoft@41.155.73.61] has left #go-nuts []
16:43 -!- gnuvince [~vince@64.235.207.73] has quit [Ping timeout: 276 seconds]
16:50 -!- jA_cOp [~yakobu@unaffiliated/ja-cop/x-9478493] has quit [Quit: Leaving]
16:55 -!- carllerche [~carllerch@208.87.61.203] has joined #go-nuts
16:56 -!- skelterjohn [~jasmuth@lawn-net168-in.rutgers.edu] has quit [Quit:
skelterjohn]
16:59 -!- skelterjohn [~jasmuth@lawn-net168-in.rutgers.edu] has joined #go-nuts
17:00 -!- b00m_chef [~watr@216-21-143-134.ip.van.radiant.net] has quit [Read
error: Connection reset by peer]
17:01 -!- b00m_chef [~watr@216-21-143-134.ip.van.radiant.net] has joined #go-nuts
17:02 -!- Tiger [~chatzilla@222.73.189.45] has quit [Ping timeout: 240 seconds]
17:02 -!- carllerche [~carllerch@208.87.61.203] has quit [Quit: carllerche]
17:07 -!- sioraiocht [~tomh@unaffiliated/sioraiocht] has joined #go-nuts
17:08 < b00m_chef> I just put up a page that lists a bunch of small project
ideas for people to practice coding in GO (ADD YOUR OWN IDEA!!): www.devshell.org.
17:13 -!- Kashia [~Kashia@port-92-200-151-85.dynamic.qsc.de] has quit [Quit:
Leaving]
17:14 < temoto> How to iterate lines in stdin?
17:25 -!- ender2070 [~ender2070@adsl-216-246-226-168.ext.distributel.net] has quit
[Remote host closed the connection]
17:28 -!- carllerche [~carllerch@99.13.242.166] has joined #go-nuts
17:28 -!- carllerche [~carllerch@99.13.242.166] has quit [Client Quit]
17:32 -!- ShadowIce [pyoro@unaffiliated/shadowice-x841044] has joined #go-nuts
17:36 -!- dju_ [dju@fsf/member/dju] has joined #go-nuts
17:36 -!- dju [dju@fsf/member/dju] has quit [Read error: Connection reset by peer]
17:42 < skelterjohn> temoto: what does it mean to iterate lines
17:42 < skelterjohn> do you mean, how do you read a bunch of lines from
stdin?
17:42 < KirkMcDonald> temoto: bufferedStdin := bufio.NewReader(os.Stdin);
line, err := bufferedStdin.ReadBytes('\n')
17:42 < temoto> skelterjohn, i mean how to read all lines and execute my
function for each of them.
17:43 < KirkMcDonald> (Iterate until err != nil.)
17:43 < skelterjohn> what kirk said
17:43 < temoto> KirkMcDonald, thanks, i've done that, was looking for a more
convenient option.
17:43 -!- rhelmer [~rhelmer@209.52.84.51] has joined #go-nuts
17:43 < KirkMcDonald> Hmm.  Actually, that's the wrong termination case, I
think.
17:43 < KirkMcDonald> If the file does not end in a newline, you'll get the
last line *and* an error.
17:44 -!- Elems [~Jake@c-98-215-113-215.hsd1.il.comcast.net] has joined #go-nuts
17:44 < KirkMcDonald> Just check if the error is os.EOF, I guess.
17:45 -!- tvw [~tv@e176002027.adsl.alicedsl.de] has joined #go-nuts
17:45 -!- skelterjohn [~jasmuth@lawn-net168-in.rutgers.edu] has quit [Quit:
skelterjohn]
17:46 -!- rv2733 [~ron@c-98-242-168-49.hsd1.fl.comcast.net] has joined #go-nuts
17:47 < temoto> Yeah os.EOF works.
17:49 -!- rhelmer [~rhelmer@209.52.84.51] has quit [Quit: rhelmer]
17:49 -!- belkiss [~belkiss@drn13-1-78-235-168-105.fbx.proxad.net] has joined
#go-nuts
17:53 -!- tabo [~tabot@camelot.tabo.pe] has joined #go-nuts
17:54 -!- skelterjohn [~jasmuth@lawn-net168-in.rutgers.edu] has joined #go-nuts
17:56 -!- Gracenotes [~person@wikipedia/Gracenotes] has joined #go-nuts
17:58 -!- belkiss [~belkiss@drn13-1-78-235-168-105.fbx.proxad.net] has quit [Quit:
KVIrc Equilibrium 4.1.0, revision: 4632, sources date: 20100519, built on:
2010-07-09 07:13:47 UTC http://www.kvirc.net/]
17:58 -!- belkiss [~belkiss@drn13-1-78-235-168-105.fbx.proxad.net] has joined
#go-nuts
17:59 -!- rhelmer [~rhelmer@209.52.84.51] has joined #go-nuts
18:03 -!- lmoura [~lmoura@187.78.130.104] has quit [Ping timeout: 265 seconds]
18:04 -!- Rescue_2501 [~Marvin@82.84.75.14] has quit [Read error: Connection reset
by peer]
18:05 -!- Rescue_2501 [~Marvin@82.84.75.14] has joined #go-nuts
18:23 -!- Rescue_2501 [~Marvin@82.84.75.14] has left #go-nuts []
18:23 < temoto> So in two days i completely rewrote web crawler worker in
Go. And it works faster, way more predictable than in Python.  At the cost of not
very convenient stuff like stdin iteration and lots of explicit err checks.
Great.
18:24 < Tonnerre> Who would have thought :>
18:24 < KirkMcDonald> I am curious as to what "more predictable" means.
18:24 -!- b00m_chef [~watr@216-21-143-134.ip.van.radiant.net] has quit [Read
error: Connection reset by peer]
18:24 -!- BlunderBuss [~BlunderBu@12.54.221.118] has quit [Ping timeout: 260
seconds]
18:24 < temoto> KirkMcDonald, no exceptions.
18:25 -!- b00m_chef [~watr@216-21-143-134.ip.van.radiant.net] has joined #go-nuts
18:25 < skelterjohn> i think that a nicer interface with stdin would be
useful
18:26 < skelterjohn> saw an interface to gnu readline, but that uses cgo
18:26 < Ginto8> skelterjohn, fmt.Scan[f] works pretty well
18:26 < skelterjohn> oh, good idea
18:26 -!- b00m_chef [~watr@216-21-143-134.ip.van.radiant.net] has quit [Remote
host closed the connection]
18:27 < Ginto8> or you could probably use some io/bytes functions to read
from stdin like a file
18:27 -!- b00m_chef [~watr@216-21-143-134.ip.van.radiant.net] has joined #go-nuts
18:27 < Ginto8> oh for getline() use Scanln()
18:29 < skelterjohn> actually...how does that work?
18:29 < skelterjohn> how do you get a string back?
18:29 < skelterjohn> does it fill the interface with a new one?
18:29 < Ginto8> sorry for the whole line look in bytes
18:29 < Ginto8> there's some interface for it I think
18:29 < Ginto8> maybe
18:29 < Ginto8> one sec
18:30 < temoto> bufio.ReadBytes
18:30 < skelterjohn> var s interface{}; fmt.Scanln("%s", s); s.(string)
18:30 < skelterjohn> ?
18:30 -!- rhelmer [~rhelmer@209.52.84.51] has quit [Quit: rhelmer]
18:30 < plexdev> http://is.gd/dlQFU by [Evan Shaw] in go/src/pkg/big/ --
big: Improvements to Rat.SetString
18:30 < Ginto8> var s string; fmt.Scanln("%s",s)
18:30 < Ginto8> more like
18:30 < skelterjohn> but strings are immutable
18:30 < Ginto8> but that would only get the first space-delimited token
18:30 < Ginto8> skelterjohn, string CONTENTS are immutable
18:31 < KirkMcDonald> skelterjohn: I think it would be var s string, and
then you pass &s to it.
18:31 < Ginto8> the string var itself is a byte slice, and the bytes it
points to are immutable
18:31 < Ginto8> actually Kirk has it right
18:31 < skelterjohn> right - that was the problem - passing s only passes
the pointer to the immutable bytes
18:31 < Ginto8> okay then
18:31 < temoto> So &s is char ** ?
18:31 < Ginto8> var s string; fmt.Scanln("%s",&s)
18:32 < Ginto8> temoto, nope
18:32 < Ginto8> it's a []byte and the bytes are immutable
18:32 < skelterjohn> temoto: for the purpose of fmt.Scanln, kinda.  but it's
not a good analogy
18:32 < Ginto8> so you want a *string
18:33 < temoto> complicated stuff
18:33 -!- sioraiocht [~tomh@unaffiliated/sioraiocht] has quit [Remote host closed
the connection]
18:33 < Ginto8> or maybe you just want a []byte
18:33 < skelterjohn> potentially non-obvious, perhaps
18:33 < Ginto8> =/
18:33 < KirkMcDonald> It's just like C's scanf.
18:33 < KirkMcDonald> http://en.wikipedia.org/wiki/Scanf
18:33 < KirkMcDonald> More or less.
18:34 < skelterjohn> KirkMcDonald: calls to it look like C's scanf, but
we're talking about under-the-hood right now, I think
18:34 -!- gnuvince_ [~vince@70.35.171.56] has joined #go-nuts
18:34 < KirkMcDonald> skelterjohn: We're talking about how to call it.
18:34 < skelterjohn> potatoes.
18:35 < skelterjohn> anyway, i'm glad that go has a specific string type
18:35 < skelterjohn> i feel like the C string convention is responsible for
most software vulnerabilities out there
18:35 < Ginto8> OH
18:35 < Ginto8> found it
18:35 < Ginto8> bufio.ReadBytes
18:35 < Ginto8> temoto had it right
18:36 < Ginto8> well bufio.Reader.ReadBytes
18:36 < temoto> Ginto8, because two screens earlier Kirk suggested it.  :)
18:36 < Ginto8> oh
18:36 < Ginto8> lol
18:36 < skelterjohn> wait - why is fmt.Scanln not sufficient?
18:36 -!- MaybeSo [~jimr@lions.Stanford.EDU] has left #go-nuts []
18:36 < Ginto8> because it doesn't take the whole line as a string
18:37 < Ginto8> it takes space-delimited elements
18:37 < temoto> That was my stopper.
18:38 < Namegduf> ;fit
18:38 < Namegduf> Sorry, typo.
18:38 < Ginto8> bufio.Reader.ReadBytes reads all data up to and including
the delimiter, in this case '\n'
18:38 -!- jimr [~jimr@DN4441a27e.Stanford.EDU] has joined #go-nuts
18:41 < skelterjohn> i ran a test program for scanln....
http://pastebin.com/Mg0YqHxg
18:41 < skelterjohn> prints out an error "Scan: type not a pointer: string"
18:41 < Ginto8> yeah
18:41 < Ginto8> you need a *string
18:41 -!- jimr [~jimr@DN4441a27e.Stanford.EDU] has left #go-nuts []
18:41 < Ginto8> or preferably a []byte
18:41 < Ginto8> []byte is better
18:42 < skelterjohn> passing it a *string, or the address of a *string does
not work
18:42 -!- temoto [~temoto@81.19.90.173] has quit [Ping timeout: 248 seconds]
18:42 < Ginto8> then use a []byte
18:42 < Ginto8> remember string contents are immutable
18:42 < Ginto8> I just wasn't sure it wouldn't wok
18:42 < skelterjohn> or a []byte
18:42 < Ginto8> work*
18:42 < skelterjohn> or the address of a []byte
18:43 < skelterjohn> how on earth do i use scanln?
18:43 < Ginto8> the same way you use Scan
18:43 < skelterjohn> ok
18:43 < skelterjohn> how on earth do i use scan?
18:43 < skelterjohn> what change to that pastebin can i make?
18:43 < Ginto8> fmt.Scan(elem1,elem2, ...)
18:43 < Ginto8> oh lemme check
18:43 < skelterjohn> oh wait
18:43 < skelterjohn> there is no formatting argument
18:43 < Ginto8> yeah
18:43 < skelterjohn> that's the problem
18:43 < Ginto8> that's the issue
18:44 < skelterjohn> k
18:44 < Ginto8> Scanf has the format arg
18:45 -!- MaybeSo [~jimr@lions.Stanford.EDU] has joined #go-nuts
18:53 -!- geocalc [~geobsd@lns-bzn-24-82-64-132-116.adsl.proxad.net] has joined
#go-nuts
18:54 -!- GeoBSD [~geobsd@lns-bzn-38-82-253-122-149.adsl.proxad.net] has quit
[Ping timeout: 240 seconds]
18:55 -!- MaybeSo [~jimr@lions.Stanford.EDU] has left #go-nuts []
18:55 -!- MaybeSo [~jimr@lions.Stanford.EDU] has joined #go-nuts
18:56 -!- napsy [~luka@tm.213.143.73.175.lc.telemach.net] has joined #go-nuts
18:56 < MaybeSo> Not sure if I can speak here, but I had tried to send this
in earlier: http://pastebin.com/rHep6Yxw
18:56 < MaybeSo> as an example of reading stdin
18:56 < skelterjohn> seems to have expired
18:56 -!- rhelmer [~rhelmer@209.52.84.51] has joined #go-nuts
18:56 < MaybeSo> gah
18:58 -!- skelterjohn_ [~jasmuth@lawn-net168-in.rutgers.edu] has joined #go-nuts
18:58 -!- skelterjohn [~jasmuth@lawn-net168-in.rutgers.edu] has quit [Read error:
Connection reset by peer]
18:58 -!- lmoura [~lmoura@187.78.130.104] has joined #go-nuts
18:59 < MaybeSo> 2nd try: http://pastebin.com/cTDfqeBJ
18:59 < MaybeSo> it's not as elegant as if one can use a one line Scanln
though
19:01 < KirkMcDonald> I recomment paste.pocoo.org.
19:01 -!- skelterjohn_ [~jasmuth@lawn-net168-in.rutgers.edu] has quit [Read error:
Connection reset by peer]
19:01 < KirkMcDonald> recommend*
19:02 < KirkMcDonald> No ads, supports Go highlighting.
19:02 < MaybeSo> thanks
19:03 -!- skelterjohn [~jasmuth@lawn-net168-in.rutgers.edu] has joined #go-nuts
19:05 -!- Eridius [~kevin@unaffiliated/eridius] has joined #go-nuts
19:06 < MaybeSo> perhaps a naive question, but since go tools are cross
compilers is it possible to compile a linux executable on a darwin machine?  If,
e.g., I had the $GOROOT/pkg/linux_XXX set up?
19:06 < MaybeSo> (x86_64 cpu in both cases)
19:07 -!- gnuvince_ [~vince@70.35.171.56] has quit [Ping timeout: 276 seconds]
19:11 -!- rhelmer [~rhelmer@209.52.84.51] has quit [Quit: rhelmer]
19:12 < MaybeSo> neat.  the answer is yes.
19:13 < MaybeSo> now I don't have to spin up vmware and slow my machine to a
crawl to get a linux executable
19:13 -!- rhelmer [~rhelmer@209.52.84.51] has joined #go-nuts
19:14 -!- rhelmer [~rhelmer@209.52.84.51] has quit [Client Quit]
19:15 -!- beutdeuce [~beutdeuce@cpe-68-174-41-43.nj.res.rr.com] has joined
#go-nuts
19:23 -!- bmizerany [~bmizerany@c-24-6-37-113.hsd1.ca.comcast.net] has quit
[Remote host closed the connection]
19:34 < skelterjohn> MaybeSo: scanln seems not up to snuff, since it will
always stop at a space
19:35 < skelterjohn> i like your fieldreader
19:37 < MaybeSo> thanks!
19:37 < skelterjohn> you should make a goinstall-able package out of it
19:37 < skelterjohn> i'm not a big fan of that panic
19:37 < MaybeSo> I'll look into that
19:38 < skelterjohn> depending on what kind of errors other than EOF can
happen
19:38 < MaybeSo> yeah, do you think there should be an error channel?  or
that instead of string the channel should return a struct w/ a field and with a
potential error?
19:38 -!- iLeNsTR [~quassel@unaffiliated/lenstr] has joined #go-nuts
19:39 < skelterjohn> i don't have a definitive answer for you, but having a
chan struct {s string; e err} was my first thought
19:39 < MaybeSo> *nod* yeah, that makes sense
19:45 -!- jhawk28 [~jhawk28@72.40.31.201] has joined #go-nuts
19:46 < jhawk28> hello, can anyone point me to how to create a
container/vector/StringVector?  I can't seem to find it in the docs.
19:47 < skelterjohn> var sv StringVector = StringVector(make([]string,
capacity))
19:47 < skelterjohn> because "type StringVector []string"
19:48 < Ginto8> well
19:48 < Ginto8> var sv vector.StringVector
19:48 < Ginto8> you don't even need the make
19:48 < Ginto8> then you can do sv.Resize(len,cap)
19:49 < skelterjohn> right, good point
19:49 < jhawk28> do I need to initialize it then?
19:49 < skelterjohn> it is initialized :)
19:49 < Ginto8> nope
19:49 < Ginto8> yeah
19:49 < Ginto8> all the types in container/vector work just fine with their
zero value
19:50 < skelterjohn> because slices work find with their zero values
19:50 < skelterjohn> they start empty and don't point to anything
19:50 < skelterjohn> but vector's Push et al will allocate data as needed
19:50 < Ginto8> yeah but vector functions automatically alloc if needed
19:50 < Ginto8> same with Resize
19:51 < jhawk28> was trying to use the :=
19:51 < jhawk28> just using the var worked.  Thanks
19:52 < Ginto8> the only thing I don't like about container/vector types is
to ensure you have a certain minimum capacity for performance, you have to do
v.Resize(v.Len(),cap)
19:52 < Ginto8> having a Reserve() function would be nice
19:53 -!- snearch [~snearch@f053002234.adsl.alicedsl.de] has joined #go-nuts
19:55 < skelterjohn> it probably doubles the available capacity every time
you go over
19:55 < skelterjohn> which is nicely efficient for most purposes
19:56 < Ginto8> hmm
19:56 * Ginto8 goes to check the source
19:56 < skelterjohn> i'm only assuming, since that is standard practice for
vector types
19:57 < Ginto8> oh hm
19:57 < Ginto8> cool
19:57 < Ginto8> they double capacity every non-manual
19:57 < Ginto8> non-manual resize*
19:58 < skelterjohn> yeah
19:59 < skelterjohn> that way you have O(log(n)) resizes for a size n vector
19:59 < Ginto8> hm ok
19:59 < skelterjohn> of course, if you know you want 10k
19:59 < skelterjohn> just tell it 10k
19:59 < skelterjohn> so you don't have 14 resizes
19:59 < skelterjohn> or so
19:59 < Ginto8> yeah
20:00 -!- skelterjohn [~jasmuth@lawn-net168-in.rutgers.edu] has quit [Quit:
skelterjohn]
20:01 -!- bmizerany [~bmizerany@dsl081-064-072.sfo1.dsl.speakeasy.net] has joined
#go-nuts
20:02 < plexdev> http://is.gd/dlWXk by [Robert Griesemer] in
go/src/pkg/go/parser/ -- go/parser: require that '...' parameters are followed by
a type
20:02 < plexdev> http://is.gd/dlWXr by [Robert Griesemer] in go/doc/ --
go/spec: fix typo
20:02 < plexdev> http://is.gd/dlWXH by [Robert Griesemer] in
go/src/cmd/gofmt/ -- gofmt: update test script
20:06 -!- wrtp [~rog@92.17.27.37] has quit [Quit: wrtp]
20:18 -!- micrypt [~micrypt@94-195-127-212.zone9.bethere.co.uk] has quit [Ping
timeout: 260 seconds]
20:18 -!- snearch [~snearch@f053002234.adsl.alicedsl.de] has quit [Quit:
Verlassend]
20:19 < plexdev> http://is.gd/dlXYZ by [Robert Griesemer] in
go/src/pkg/go/printer/testdata/ -- fix build: adjustest a few tests that I missed
before
20:34 -!- micrypt [~micrypt@94-195-127-212.zone9.bethere.co.uk] has joined
#go-nuts
20:39 -!- artefon [~thiagon@150.164.2.20] has quit [Quit: Leaving]
20:39 -!- jhawk28 [~jhawk28@72.40.31.201] has quit [Remote host closed the
connection]
20:43 -!- tgall_foo [~tgall@gentoo/developer/dr-who] has quit [Remote host closed
the connection]
20:44 -!- tgall_foo [~tgall@gentoo/developer/dr-who] has joined #go-nuts
20:48 -!- nsf [~nsf@jiss.convex.ru] has joined #go-nuts
20:49 -!- gnuvince [~vince@70.35.167.149] has joined #go-nuts
20:50 -!- General1337 [~support@71-84-50-230.dhcp.mtpk.ca.charter.com] has quit
[Ping timeout: 276 seconds]
20:51 -!- General1337 [~support@71-84-50-230.dhcp.mtpk.ca.charter.com] has joined
#go-nuts
20:56 -!- Venom_X [~pjacobs@71.21.124.111] has quit [Ping timeout: 240 seconds]
21:00 -!- esiroker [~esiroker@adsl-99-49-227-57.dsl.pltn13.sbcglobal.net] has
joined #go-nuts
21:05 < nsf> that's interestring, why docs on the website for "os/signal"
package doesn't show SIG* constants?  they do exist however
21:09 -!- rlab [~Miranda@91.200.158.34] has quit [Read error: Connection reset by
peer]
21:16 -!- tvw [~tv@e176002027.adsl.alicedsl.de] has quit [Ping timeout: 265
seconds]
21:17 -!- gnuvince [~vince@70.35.167.149] has quit [Quit: What the fruit is goin'
on here!?]
21:25 -!- geocalc [~geobsd@lns-bzn-24-82-64-132-116.adsl.proxad.net] has quit
[Quit: Lost terminal]
21:31 -!- belkiss [~belkiss@drn13-1-78-235-168-105.fbx.proxad.net] has quit [Quit:
KVIrc Equilibrium 4.1.0, revision: 4632, sources date: 20100519, built on:
2010-07-09 07:13:47 UTC http://www.kvirc.net/]
21:40 -!- Ideal [~Ideal@80.249.95.183] has joined #go-nuts
21:46 -!- gnuvince [~vince@70.35.167.149] has joined #go-nuts
22:03 -!- skelterjohn [~jasmuth@c-76-116-181-134.hsd1.nj.comcast.net] has joined
#go-nuts
22:03 -!- surma [~surma@95-88-90-24-dynip.superkabel.de] has joined #go-nuts
22:05 < skelterjohn>
http://golang.org/doc/go_faq.html#Do_Go_programs_link_with_Cpp_programs
22:07 < skelterjohn> whoops, i meant to paste that into a reply on the ML
22:15 -!- iLeNsTR [~quassel@unaffiliated/lenstr] has quit [Read error: Connection
reset by peer]
22:18 -!- ShadowIce [pyoro@unaffiliated/shadowice-x841044] has quit [Quit:
Verlassend]
22:24 -!- incluye [~inklewyay@NW-ESR1-74-215-114-218.fuse.net] has joined #go-nuts
22:34 -!- skelterjohn [~jasmuth@c-76-116-181-134.hsd1.nj.comcast.net] has quit
[Quit: skelterjohn]
22:37 -!- surma [~surma@95-88-90-24-dynip.superkabel.de] has left #go-nuts []
22:46 -!- marsu [~marsu@ANancy-154-1-80-83.w81-49.abo.wanadoo.fr] has joined
#go-nuts
22:48 -!- bmizerany [~bmizerany@dsl081-064-072.sfo1.dsl.speakeasy.net] has quit
[Remote host closed the connection]
22:49 -!- bmizerany [~bmizerany@dsl081-064-072.sfo1.dsl.speakeasy.net] has joined
#go-nuts
22:56 -!- marsu [~marsu@ANancy-154-1-80-83.w81-49.abo.wanadoo.fr] has quit [Ping
timeout: 265 seconds]
22:59 -!- rhelmer [~rhelmer@209.52.84.50] has joined #go-nuts
23:08 -!- marsu [~marsu@ANancy-154-1-80-225.w81-49.abo.wanadoo.fr] has joined
#go-nuts
23:09 -!- rv2733 [~ron@c-98-242-168-49.hsd1.fl.comcast.net] has quit [Ping
timeout: 265 seconds]
23:09 < nsf> um..  in C we have a main function returning an int value, how
can I do the same in Go? :)
23:09 < nsf> spec says main takes no args and returns nothing
23:10 < nsf> oh..  I see there is an os.Exit(int)
23:11 < KirkMcDonald> Man why do you ask questions and answer them before I
can formulate a response?  :-)
23:11 < nsf> which doesn't run deferred goroutines
23:11 < nsf> KirkMcDonald: you don't need to write down your answer, you're
just thinking about it and it comes to my mind
23:11 < nsf> that's how the chat magic works
23:11 < nsf> :D
23:12 < nsf> deferred functions*
23:13 < nsf> ah, yes, I'll make my own main, which will run deferred funcs
and return a value
23:13 < nsf> :P
23:17 < Ideal> seems telepathy like just one step away.
23:18 < Ideal> such stuff here happens like all the time
23:21 -!- sioraiocht [~tomh@unaffiliated/sioraiocht] has joined #go-nuts
23:21 < MaybeSo> stupid question: if I have var r *io.ReadCloser, and I want
to pass it to function fun(r *io.Reader), I should call fun(io.Reader(*r)) ?
23:22 < KirkMcDonald> I suspect the question is fun(r io.Reader)
23:22 < KirkMcDonald> s/question/function/
23:23 < KirkMcDonald> Both io.Reader and io.ReadCloser are interfaces.
23:23 < KirkMcDonald> Having a pointer to either is unusual.
23:23 < MaybeSo> yes, you are correct it is fun(r io.Reader)
23:23 < MaybeSo> sorry
23:24 < MaybeSo> so that dereferences the ptr and casts it
23:24 < KirkMcDonald> I would not expect the explicit conversion to be
necessary.
23:24 < MaybeSo> sigh, I still haven't quite wrapped my head around how
interfaces and structs play well together in Go
23:25 < KirkMcDonald> MaybeSo: The question is: What is the type which
satisfies the interface.
23:25 < KirkMcDonald> Typically this is the pointer-to-struct type.
23:25 < KirkMcDonald> It does not have to be, but that is the most generally
useful way to do it.
23:27 < KirkMcDonald> The fast way to tell is to see what the receiver type
of the methods of the struct are.  Generally they are e.g.: func (s *S) foo() {}
23:27 < KirkMcDonald> That is, *S, and not S.
23:27 -!- micrypt [~micrypt@94-195-127-212.zone9.bethere.co.uk] has left #go-nuts
[]
23:27 < MaybeSo> ok
23:28 < KirkMcDonald> So if you assign a *S to an interface type which is
satisfied by *S, then the interface value is already a pointer.
23:29 -!- rhelmer [~rhelmer@209.52.84.50] has quit [Quit: rhelmer]
23:29 -!- Ideal [~Ideal@80.249.95.183] has left #go-nuts []
23:36 -!- rhelmer [~rhelmer@209.52.84.51] has joined #go-nuts
23:42 -!- ExtraSpice [~ExtraSpic@88.118.32.225] has quit [Ping timeout: 240
seconds]
23:44 -!- beutdeuce [~beutdeuce@cpe-68-174-41-43.nj.res.rr.com] has left #go-nuts
[]
23:45 -!- b00m_chef [~watr@216-21-143-134.ip.van.radiant.net] has quit [Ping
timeout: 240 seconds]
23:49 -!- unhygienix [~unhygieni@host86-177-113-38.range86-177.btcentralplus.com]
has joined #go-nuts
23:52 -!- awidegreen [~quassel@62.176.237.78] has quit [Remote host closed the
connection]
23:52 -!- sioraiocht [~tomh@unaffiliated/sioraiocht] has quit [Remote host closed
the connection]
23:53 -!- babusri [~Babu@122.167.89.182] has joined #go-nuts
23:55 -!- photron_ [~photron@port-92-201-110-226.dynamic.qsc.de] has quit [Read
error: Operation timed out]
23:57 -!- rhelmer [~rhelmer@209.52.84.51] has quit [Quit: rhelmer]
23:58 -!- bjarneh [~bjarneh@135.80-203-19.nextgentel.com] has joined #go-nuts
--- Log closed Sat Jul 10 00:00:12 2010