Scriptor / pharen

Lisp to PHP Compiler
http://pharen.org
BSD 3-Clause "New" or "Revised" License
218 stars 31 forks source link

Adding try/catch clause #54

Closed nuxlli closed 2 years ago

nuxlli commented 11 years ago

try/catch

Adding try/catch clouse like a http://en.wikibooks.org/wiki/Clojure_Programming/Concepts#Exception_Handling

(fn exception ()
  (try
    (do (throw (new Exception "Custom")) NULL)
    (catch Exception e (-> e (getMessage)))))
(check (exception) "Custom")

class

(class-extends OtherException Exception)

syntax suggestion

(class OtherException :extends Exception)
(throw (new Exception "Custom"))
jturolla commented 11 years ago

+1

greenwellness commented 10 years ago

+1