This file contains hidden or 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
| Michael-MBP[~] python3.4 test.py | |
| FOO poop on my knee | |
| FOO everybody poops | |
| FOO poop on my knee | |
| I got called | |
| BAR poop on my knee | |
| FOO poop on my knee |
This file contains hidden or 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 functools | |
| class ObservableFunction(object): | |
| def __init__(self, func): | |
| self.func = func | |
| self.observers = [] | |
| def __call__(self, *args, **kwargs): |
This file contains hidden or 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
| fn hailstone(n: uint) -> uint { | |
| match n % 2 { | |
| 0 => n / 2, | |
| _ => 3 * n + 1, | |
| } | |
| } | |
| fn hailstone_len(n: uint) -> uint { | |
| match n { |
This file contains hidden or 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
| PRODUCTIONS: | |
| START_E : E | |
| T : ID | |
| E : T | |
| E : T PLUS E | |
| ALL CLOSURES (6) | |
| ========== | |
| CLOSURE 0 { | |
| [E : · T, <$>] |
This file contains hidden or 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
| PRODUCTIONS: | |
| E : T E' | |
| T' : <empty> | |
| T' : TIMES F T' | |
| E' : <empty> | |
| E' : PLUS T E' | |
| T : F T' | |
| START_E : E | |
| F : ID | |
| F : LPAREN E RPAREN |
This file contains hidden or 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
| PRODUCTIONS: | |
| T' : <empty> | |
| T' : TIMES F T' | |
| E : T E' | |
| T : F T' | |
| E' : PLUS T E' | |
| E' : <empty> | |
| F : ID | |
| F : LPAREN E RPAREN | |
| START_E : E |
This file contains hidden or 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
| PRODUCTIONS: | |
| T : F T' | |
| START_E : E | |
| E : T E' | |
| F : LPAREN E RPAREN | |
| F : ID | |
| E' : PLUS T E' | |
| E' : <empty> | |
| T' : <empty> | |
| T' : TIMES F T' |
This file contains hidden or 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
| PRODUCTIONS: | |
| F : LPAREN E RPAREN | |
| F : ID | |
| T : F T' | |
| E' : <empty> | |
| E' : PLUS T E' | |
| START_E : E | |
| E : T E' | |
| T' : TIMES F T' | |
| T' : <empty> |
This file contains hidden or 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
| PRODUCTIONS: | |
| T' : <empty> | |
| T' : TIMES F T' | |
| START_E : E | |
| E' : PLUS T E' | |
| E' : <empty> | |
| F : ID | |
| F : LPAREN E RPAREN | |
| T : F T' | |
| E : T E' |
This file contains hidden or 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
| from BreakfastSerial import Arduino, Motor | |
| def test(): | |
| print 'hello world' | |
| def setup(board): | |
| motor = Motor(board, 3) |