Last active
August 29, 2015 14:21
-
-
Save skial/8eb8fad01a4361b9db79 to your computer and use it in GitHub Desktop.
Haxe 3.2.0 Python Output used in http://haxe.io/releases/3.2.0/
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
-python Main.py | |
-main Main |
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
package; | |
class Main { | |
static function main() { | |
for (projectile in ['apples', 'oranges']) trace( 'I threw $projectile!' ); | |
} | |
} |
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
class Main: | |
@staticmethod | |
def main(): | |
_g = 0 | |
_g1 = ["apples", "oranges"] | |
while (_g < len(_g1)): | |
projectile = (_g1[_g] if _g >= 0 and _g < len(_g1) else None) | |
_g = (_g + 1) | |
print(str((("I threw " + ("null" if projectile is None else projectile)) + "!"))) | |
class python_internal_ArrayImpl: | |
@staticmethod | |
def _get(x,idx): | |
if ((idx > -1) and ((idx < len(x)))): | |
return x[idx] | |
else: | |
return None | |
class HxOverrides: | |
@staticmethod | |
def stringOrNull(s): | |
if (s is None): | |
return "null" | |
else: | |
return s | |
Main.main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Shouldn't line 10 have a call to
stringOrNull
rather than duplicating its logic? (there don't seem to be any calls tostringOrNull
)!