Files
2024-01-15 15:18:59 -06:00

29 lines
788 B
Plaintext
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Snowball compiler (MIT) l、
// https://github.com/snowball-lang/snowball (゚、 。7
// l、゙~ヽ
// Classes example for the snowball じし(_,)
// Docs: https://snowball-lang.gitbook.io/docs/
// Import the core library.
// This is required for the println function.
import std::io;
// Defining a simple class with a constructor,
// a member and a method
class User {
let name: String; // < user name (private)
public:
User(name: String) : name(name) {}
@inline
func getName() String {
return self.name;
}
}
// Define the main function.
public func main() i32 {
let user = new User("goofy-dog-123");
io::println(user.getName());
}