Skip to content

Instantly share code, notes, and snippets.

View joseoliv's full-sized avatar

José de Oliveira Guimarães joseoliv

View GitHub Profile
@joseoliv
joseoliv / onSubprototype_afterResTypes_semAn_afterSemAn.cyan
Created October 23, 2025 20:07
onSubprototype_afterResTypes_semAn_afterSemAn
package metaobjectTest
@doc{*
Annotations of this metaobject should be attached to a prototype.
The attached DSL code is made in Myan, which supports interpreted Cyan
within parameterless methods declared with 'func':
func afterResTypes_codeToAdd {
// interpreted Cyan code
@joseoliv
joseoliv / ai-topicos-with examples.md
Created August 16, 2025 02:19
Tópicos do curso sobre Flutter

Flutter Course

This is a just a study guide or a guide when programming in Flutter. It has only the links to specific material. It does not intend to be a manual on Flutter.

Some Flutter resources:

a. Overview of Flutter - The official homepage for the Flutter framework, providing a high-level introduction, showcases, and news. b. the main documentation - The landing page for Flutter's official documentation, the most critical resource for any developer. In particular, there is a page that is a cook book - A collection of practical, recipe-style guides for solving common problems and implementing specific features. c. Comunidade Flutter do Brasil - The main hub for the Brazilian Flutter community, offering articles, tutorials, and events in Portuguese. d. Heyflutter - A popular YouTube channel with concise, high-quality tutorials on a wide range

@joseoliv
joseoliv / test_anonymous_functions.dart
Created December 20, 2024 21:58
Teste de funções anônimas em Dart
void testAnonymousFunctions() {
var f = (int n) { return n*n;};
print(f(5));
var g = (int n) => n*n;
print(g(5));
var sum = 0;
var list = [1, 2, 3, 4];
list.forEach(
(n) => sum += n );
assert (sum == 10);
@joseoliv
joseoliv / Box(1).cyan
Created December 20, 2024 21:50
Arquivo do diretório cyan-prototipos-genericos
package main
@concept{*
T has [ func * T -> T ],
"Prototype T does not define method *"
T get has [ func printK ]
*}
object Box<T>
func init: T value { self.value = value }
@property
@joseoliv
joseoliv / Program.cyan
Created December 20, 2024 21:49
Arquivo do diretório cyan-prototipos-genericos
package main
object Program
func run {
var bi = Box<Int>(0);
bi setValue: 5;
bi getValue println;
var pp = Box<Program>(self);
}
@joseoliv
joseoliv / Program.cyan
Created December 20, 2024 21:44
Introdução à Cyan - diretório cyan-intro
package main
object Program
func run {
prototypeExample;
ifWhileAsMessagePassing
}
func prototypeExample {
@joseoliv
joseoliv / Vaca.java
Created December 20, 2024 21:34
Vacas não podem comer pizza. É a opinião da orientação a objetos.
class Pessoa { ... }
class Estudante extends Pessoa { ... }
class Fazendeiro extends Pessoa { ... }
class Animal {
public void coma(Comida c) { ... }
public Estudante getTutor() { ... }
}
class Vaca extends Animal {
public Vaca(String name) { this.name = name; }
String name;
@joseoliv
joseoliv / tudo.pl
Last active December 20, 2024 01:37
Exemplo de Prolog usado na apostila
/* use em https://swish.swi-prolog.org/ */
:- style_check(-singleton).
:- dynamic molhado/1.
homem(jose) :- write('jose ').
homem(joao) :- write('joao ').
homem(pedro) :- write('pedro ').
homem(paulo) :- write('paulo ').
mulher(maria) :- write('maria ').
mulher(ana) :- write('ana ').
@joseoliv
joseoliv / main.c
Created November 28, 2024 22:59
Dynamically typed language translation to C
// also in https://www.onlinegdb.com/edit/xhqFlnv8f
#include <stdio.h>
#include <stdlib.h>
#include <malloc.h>
struct TypeData {
void (**virtualTable)(void);
char **methodNameList;
int methodNameListSize;
@joseoliv
joseoliv / Cyan-in-20-minutes
Last active August 30, 2022 12:53
Cyan in 20 minutes
package main
// import a Cyan package
import cyan.math
import cyan.reflect
// import a Java package
import java.lang
@doc{*