The interface abstraction seems to be violated by the "pass by value"
convention at the receiver when the "I/O" pattern is found to be
dysfunctional.

In [IO] https://go.dev/play/p/9vx4HZpSYe0
we see that the implementation of an exemplar interface is functionally
stateless, demonstrating the appearance of self contradiction in GOPL type
theory.

type IO interface {

Read([]byte)

Write() []byte

}
type Bytes []byte

func (this Bytes) Read(src []byte) bool {

this = src

return 0 != len(this)

}
func (this Bytes) Write() []byte {

return this

}
func (this Bytes) String() string {

return string(this)

}

The case would seem to suggest that a reasonable increment of GOPL type
theory would consolidate the "*" hack onto a conception of "reference
types".

It would seem to be necessary and essential that the pointer reference type
glob at the receiver solve the disparity of point type object statelessness.


Best,

John

-- 
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/CAD6mcO9KbauDC%2BO5-qmdiLqkxtqb9bdcJu4kMWEVTqWE4qK7LQ%40mail.gmail.com.

Reply via email to