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

> clever AST savvy tools will fail in the presence of metaprogramming, unless you restrict it to patterns the tool knows. And then you're halfway towards static typing with inference.

Common Lisp has plenty of well-defined macros with simple patterns any tool could learn, but it's definitely dynamically typed. (defstruct foo ..) generates foo-p, make-foo, copy-foo; what parser couldn't understand that? All it takes is a few good macros to really make the DRY work. Either give up like the author and repeat yourself or move past the problem with a macro.

Patterns mean "I have run out of language." — Rich Hickey



> Common Lisp has plenty of well-defined macros with simple patterns any tool could learn

If the tool has to learn (i.e. be written to know about, yes?) these patterns, then it will not know about those you wrote.

However, as someone else has pointed out, the compile-time execution of macros actually does make them accessible to a sufficiently sophisticated "grep", the kind of tool shurcooL asked for.




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

Search: