Yes, in strictly, as you think, this is not currying. The currrying is a transform taking one less argument.
package main import ( "fmt" ) func add(n int) func(int) int { return func(v int) int { return n + v } } func main() { add10 := add(10) fmt.Println(add10(5)) }
Just metaphor :)
If this function object for currying, you can try this.
package main import ( "fmt" ) type number int func (f number) add(b number) number { return f + b } func main() { fmt.Println(number(3).add(4)) fmt.Println(number.add(3, 4)) }
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Yes, in strictly, as you think, this is not currying. The currrying is a transform taking one less argument.
Just metaphor :)
If this function object for currying, you can try this.