generics and absence of ability to specify correlated types
126 views
Skip to first unread message
Dan Kortschak
unread,
Jun 17, 2020, 7:25:17 AM6/17/20
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to golang-nuts
Since this has come up again in [1], I would like to re-raise the issue
of being able to correlate float and complex types so that a
func(float32) complex64/func(float64) complex128-like function can be
written generically. This issue was raised in [2] in the last round of
generics discussions with the example now in [3] and [4].
This wasn't addressed last time, and it does not appear to be addressed
in the current document, although the Point method section comes sort
of close[5] by doing essentially the same kind of conversion/constraint
but with pointers, also the `ComplexAbs(type T Complex) T` type,
however this does not handle both the cases below and achieves what it
does in a heavier way.
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to golan...@googlegroups.com
With the multitude of answers for use of alternative syntaxes for
specifying type parameter lists, is there a chance that this concern
could be addressed?
thanks
Dan
On Wed, 2020-06-17 at 11:24 +0000, 'Dan Kortschak' via golang-nuts
wrote: