On Tue, Aug 6, 2019 at 4:07 PM <lgod...@gmail.com> wrote: > > Here a specific example: > > The following compiles and runs as expected > m1x,m1y := ec.scalarMult(16,28,33) > m2x,m2y := ec.scalarMult( 1,28,33) > rx,ry := ec.add (m1x,m1y, m2x, m2y) > > > However this stmt : rx,ry= ec.add(ec.scalarMult(16,28,33), ec.scalarMult( > 1,28,33)) gives the following compiler error ... > > # command-line-arguments > .\ECurve.go:272:14: not enough arguments in call to ec.add > .\ECurve.go:272:28: multiple-value ec.scalarMult() in single-value context
WAI, see https://golang.org/ref/spec#Calls """" As a special case, if the return values of a function or method g are equal in number and individually assignable to the parameters of another function or method f, then the call f(g(parameters_of_g)) will invoke f after binding the return values of g to the parameters of f in order. The call of f must contain no parameters other than the call of g, and g must have at least one return value. If f has a final ... parameter, it is assigned the return values of g that remain after assignment of regular parameters. """" -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CAA40n-Xve1Cr2aFZbQCNvtt4WPM3XNtwf5eNdYnfCreznFm1tw%40mail.gmail.com.