@@ -172,9 +172,15 @@ namespace purescript {
173} // namespace purescript
173} // namespace purescript
175+#define DEFINE_FOREIGN_DICTIONARY_AND_ACCESSOR() \
176+ inline auto foreign() -> dict_t& {\
177+ static dict_t $dict$;\
175#define FOREIGN_BEGIN(NS) namespace NS {\
181#define FOREIGN_BEGIN(NS) namespace NS {\
176 using namespace purescript;\
182 using namespace purescript;\
177− auto foreign() -> dict_t&;\
183+ DEFINE_FOREIGN_DICTIONARY_AND_ACCESSOR()\
178 static const auto& NS ## $foreign_init = []() {\
184 static const auto& NS ## $foreign_init = []() {\
179 dict_t& exports = foreign();
185 dict_t& exports = foreign();
180#define FOREIGN_END return exports; }(); }
186#define FOREIGN_END return exports; }(); }