Skip to content

Instantly share code, notes, and snippets.

@skial
Last active August 29, 2015 14:21
Show Gist options
  • Save skial/8eb8fad01a4361b9db79 to your computer and use it in GitHub Desktop.
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/
-python Main.py
-main Main
package;
class Main {
static function main() {
for (projectile in ['apples', 'oranges']) trace( 'I threw $projectile!' );
}
}
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()
@DanTup
Copy link

DanTup commented May 24, 2015

Shouldn't line 10 have a call to stringOrNull rather than duplicating its logic? (there don't seem to be any calls to stringOrNull)!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment