Skip to content

Instantly share code, notes, and snippets.

@andiogenes
Created February 5, 2025 07:14
Show Gist options
  • Save andiogenes/e8918e55cd950d978bcb71c159e5e8e1 to your computer and use it in GitHub Desktop.
Save andiogenes/e8918e55cd950d978bcb71c159e5e8e1 to your computer and use it in GitHub Desktop.
Пример того, как может выглядеть такое надмножество языка

Just a bit of syntactic sugar for Go's composition and methods.

Example

// Base class Foo
type foo class {
  (f) Test() {
    fmt.Println("foo!")
  }
}

// Class Bar derived from Foo
type bar class foo {
  (f) Test() {
    f.foo.Test()
    fmt.Println("bar!")
  }
}

...

barInstance := bar{}
barInstance.Test()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment