From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Fri, 13 Nov 2009 08:36:17 -1000 From: Tim Newsham To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="1465796871-1778024434-1258137377=:13404" Subject: Re: [9fans] MIPS LSB compiler Topicbox-Message-UUID: 9af06a86-ead5-11e9-9d60-3106f5b1d025 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --1465796871-1778024434-1258137377=:13404 Content-Type: TEXT/PLAIN; charset=UTF-8; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE >> with a more complex type system that you cannot express in go. =C2=A0A >> good, simple example is "map". =C2=A0Go would need generics to support i= t. > > $GOOROOT/src/pkg/bytes/bytes.go:248 func ToLower(s []byte) []byte > { return Map(unicode.ToLower, s) } I should have been more clear. I mean a generic map of over a container of an arbitrary type. You can definitely define maps over specific types. The bytes.Map function maps a function from int to int over an array (or slice? I'm not yet that familiar with go) of bytes. If you wanted a function that maps a function from int to float over an array of ints you would need to write another function. Tim Newsham | www.thenewsh.com/~newsham | thenewsh.blogspot.com --1465796871-1778024434-1258137377=:13404--