Re: [go-nuts] Why doesn't Go include a contains method for things like slices?

2019-11-06 Thread Tyler Compton
mething other than a >> slice. >> >> You need understanding of the types and cost of operations in any >> language, and the naming (or something else) should make the types easily >> recognizable (and understandable). >> >> >> -----Original Message---

Re: [go-nuts] Why doesn't Go include a contains method for things like slices?

2019-11-05 Thread Robert Engels
other than a >> slice. >> >> You need understanding of the types and cost of operations in any language, >> and the naming (or something else) should make the types easily recognizable >> (and understandable). >> >> >> -----Original Message-

Re: [go-nuts] Why doesn't Go include a contains method for things like slices?

2019-11-05 Thread Tyler Compton
;> slice. >> >> You need understanding of the types and cost of operations in any >> language, and the naming (or something else) should make the types easily >> recognizable (and understandable). >> >> >> -----Original Message----- >> From: Tyl

Re: [go-nuts] Why doesn't Go include a contains method for things like slices?

2019-11-05 Thread Tyler Compton
or something else) should make the types easily > recognizable (and understandable). > > > -Original Message- > From: Tyler Compton > Sent: Nov 5, 2019 3:57 PM > To: toddsu...@icloud.com > Cc: golang-nuts > Subject: Re: [go-nuts] Why doesn't Go include a contai

Re: [go-nuts] Why doesn't Go include a contains method for things like slices?

2019-11-05 Thread Robert Engels
tions in any language, and the naming (or something else) should make the types easily recognizable (and understandable).-Original Message- From: Tyler Compton Sent: Nov 5, 2019 3:57 PM To: toddsu...@icloud.com Cc: golang-nuts Subject: Re: [go-nuts] Why doesn't Go include a contains

Re: [go-nuts] Why doesn't Go include a contains method for things like slices?

2019-11-05 Thread Tyler Compton
Ian's answer addresses your question about the absence of a slice.Contains method, but there have been discussions in the past about adding such a feature to the language itself as well. You brought up the idea of a builtin "contains" function, and I've seen others suggest adding something like Pyt

Re: [go-nuts] Why doesn't Go include a contains method for things like slices?

2019-11-05 Thread Ian Lance Taylor
On Tue, Nov 5, 2019 at 12:30 PM toddsurfs via golang-nuts wrote: > > Sorry if this question reveals my newness to Go. I tried searching the > mailing list but I couldn't find anything in a quick search. It seems like > many languages include the ability to check if an array, or slice contain a