Skip to content

Instantly share code, notes, and snippets.

@leohmoraes
Last active August 13, 2020 03:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leohmoraes/00912dcedf1de55cd22758700244c627 to your computer and use it in GitHub Desktop.
Save leohmoraes/00912dcedf1de55cd22758700244c627 to your computer and use it in GitHub Desktop.
Dart Ep01 - Exemplo de Lambda com Dart
void main() {
// for (int i = 0; i < 5; i++) {
// print('hello ${i + 1}');
// }
print((True));
print((False));
print("NOT");
print(not(True));
print(not(False));
print("AND");
print(and(False,False));
print(and(True,False));
print(and(True,True));
print("OR");
print(or(True,True));
print(or(True,False));
print(or(False,False));
print(false && false);
}
//Bool: True | False
True(x, _) => x;
False(_, x) => x;
not(x) => x(False, True);
and(x,y) => x(y,False);
or(x,y) => x(True,y);
//xand (false e false ou true e true)
//Run https://dartpad.dev/00912dcedf1de55cd22758700244c627
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment