Last active
December 4, 2017 19:45
-
-
Save brcontainer/91472c99a89e3117865bda57b236f539 to your computer and use it in GitHub Desktop.
Linguagem imaginária (as extensões .any e .am são temporárias/imaginárias)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Example # importa o Example.any | |
class Evolution extends Example: | |
public void __init__(): # Construtor | |
super(100, "teste", false) # Equivalente ao super do Java, ele "executa" o Example.__init__(args...) passando o argumentos | |
self.show() # Executa como o Example.show | |
public void __destroy__(): # É equivalente ao __destruct() do php ou Foo::~Foo() do C++ | |
print("Bye :(") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foo, Bar.Baz, Boo.* # Importa outras classes | |
class Example: | |
public int myint | |
private bool mybool | |
protected string mystr | |
public void __init__(int myint, string myint, bool mybool): | |
self.myint = myint | |
self.mybool = mybool | |
self.mystr = mystr | |
protected int getMyInt(): | |
return self.myint | |
private void show(): | |
print(self.myint, self.string, self.mybool) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# configurações de "boot", semelhante ao global.asax ou talvez ao php.ini | |
encoding: utf-8 # Define a codificação padrão | |
vendor: ./ # o import carrega a partir da mesma pasta |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment