News for hackers. Stuff that matters.
Re:Self Healing Code with clojure.spec by Fiahil on Sunday December 25, 2016 @04:36PM (#13255522)
Interesting. Is there a way to do something like this in Python?
Re:Self Healing Code with clojure.spec by xapata on Monday December 26, 2016 @12:08AM (#13257031)
Yes. You can get pretty fancy with decorators, and there's always eval/exec if you need it. The stdlib has plenty of power tools for introspection.

The leg up that lisps have over Python is that Python's eval/exec operates on strings whereas lisps can easily manipulate the AST. (I'm not sure if I should call it abstract for a lisp.) Directly manipulating Python's AST can be done with the aptly named ast module, but personally I find it easier to do string templating and eval.