Last active
August 13, 2020 03:37
-
-
Save leohmoraes/00912dcedf1de55cd22758700244c627 to your computer and use it in GitHub Desktop.
Dart Ep01 - Exemplo de Lambda com Dart
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
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