Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

How about syntactic extensions:

    (defmacro unless (test &body body)
      `(if (not ,test) ,@body))


That's a theoretical problem, not a real world problem.


I'm not quite sure how being able to extend syntax is a theoretical problem. It was just a basic example for brevity.

There are many more examples of macros that solve real world problems, such as writing a compiler for an embedded DSL that is tuned to solving your real problem that allows expressivity and brevity that you would never see without the use of macros.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: