[NOTE] GOPL type theory at the receiver

68 views
Skip to first unread message

John Pritchard

unread,
Jan 22, 2024, 9:43:26 AM1/22/24
to go-nuts
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.

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

Reply all
Reply to author
Forward
0 new messages