|
|
|
|
|
by ICWiener
4101 days ago
|
|
Regarding 1., I don't think it follows that the pattern-macro will end up in one giant namespace. I'd love to understand why you think so. And for 2, even though what you say seems desirable on the surface, you still approaches the problem in a way that is too fuzzy, or abstract. Just as saying "we should write more secure code" and then failing to attack the problem directly. No offense, but even though you may have a nice idea, your explanation is a little too handwavy. |
|
Re 1:
In a.clj:
In b.clj: In c.clj: Now, at the repl: Note that 'require doesn't actually import the symbols defined by b.clj or c.clj, and despite that we're able to use the pattern-macro 'foo they define, because they're modifying if-match's dispatch-table. So our pattern-macros aren't being scoped the same way our regular macros are. I think this is wrong. Moreover, our pattern-macros have a single namespace, so we get collisions between what b.clj defines 'foo to mean and what c.clj defines it to mean, which is why (if-match (foo x) 'yes x 'no) changes behavior after the (require 'c).