Initial data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 72d218235f
commit f23f22d71c
199087 changed files with 3378941 additions and 0 deletions

View file

@ -0,0 +1,41 @@
programa {
inclua biblioteca Objetos --> obj
// "constructor" returns address of object
funcao inteiro my_class_new(inteiro value) {
inteiro this = obj.criar_objeto()
obj.atribuir_propriedade(this, "variable", value) // add property to object
retorne this
}
// "method" takes the address returned by criar_objeto
funcao my_class_some_method(inteiro this) {
my_class_set_variable(this, 1)
}
// "setter"
funcao my_class_set_variable(inteiro this, inteiro value) {
obj.atribuir_propriedade(this, "variable", value)
}
// "getter"
funcao inteiro my_class_get_variable(inteiro this) {
retorne obj.obter_propriedade_tipo_inteiro(this, "variable")
}
funcao inicio() {
inteiro this = my_class_new(0)
escreva("variable = ", my_class_get_variable(this), "\n")
my_class_some_method(this)
escreva("variable = ", my_class_get_variable(this), "\n")
my_class_set_variable(this, 99)
escreva("variable = ", my_class_get_variable(this), "\n")
obj.liberar_objeto(this)
}
}