On Mon, Jun 29, 2020 at 7:28 PM Jake Montgomery wrote:
> I'm curious how you would propose rewriting:
> func Foo(type T comparable, B interface{})(a T, b B, c T) {
>
You could just annotate each distinct type on first appeareance:
func Foo(a T:type comparable, b B:type interface{}, c T) {
>
I'd guess the compiler could then enforce it (see if any non-pure marked
function is called from a pure one), it could exploit it (e.g. play with
evaluation order, cache, etc), and other such things?
On Tue, Jul 7, 2020 at 1:00 AM Ian Lance Taylor wrote:
> On Mon, Jul 6, 2020 at 9:47 AM wrote:
On Wed, Jul 8, 2020 at 2:44 AM 'Jacob Kopczynski' via golang-nuts <
golang-nuts@googlegroups.com> wrote:
> I tried to state a path relative to the home directory, since in the
> context I am writing for the path from ~ to the Git repository will be
> consistent, though the meaning of ~ may change
On Sat, Jul 18, 2020 at 12:12 PM roger peppe wrote:
>
> - elsewhere in Go, when a name is defined, there is one clear construct
>> that defines it, not an arbitrary place within a type expression. That's
>> not the case in your proposal.
>>
>
On the other hand, $/@ is not dissimilar to using the
IMHO uppercase, single letter for denoting generic types would be a nice
syntax / convention.
Sure, that would limit to 26 generic types per function ("enough for
everybody"?), and probably break some bizarro existing code (using
uppercase single-letter characters for parameter names) -- thought s