Skip to content

Instantly share code, notes, and snippets.

@chr15m
Created April 30, 2015 11:38
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 chr15m/2c79adfbf7cbb448198a to your computer and use it in GitHub Desktop.
Save chr15m/2c79adfbf7cbb448198a to your computer and use it in GitHub Desktop.
I would expect this:
(defn x []
(try
(some-call)
(catch [e Exception] 1)
(else 2)))
To compile to this:
def x():
try:
_hy_anon_var_1 = some_call()
except Exception as e:
_hy_anon_var_1 = 1L
else:
_hy_anon_var_1 = 2L
return _hy_anon_var_1
But it compiles to this:
def x():
try:
_hy_anon_var_1 = some_call()
except Exception as e:
_hy_anon_var_1 = 1L
else:
2L
return _hy_anon_var_1
Same result for s/else/finally.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment