git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Rename boxed::ref to boxed::recur
commitfab29cb72923710233b50114e8d0d065914b74e9 authorAndy Arvanitis <andyarvanitis@gmail.com> dateSat 26 Jan 2019, 09:56 (8 years ago) parent9eb0b93
2 files changed+8−8
runtime/purescript.h+6−6 src/CodeGen/Cpp.hs+2−2
runtime/purescript.h+6−6
@@ -144,12 +144,12 @@ namespace purescript {
144144
145145 }; // class boxed::weak
146146
147− class ref {
147+ class recur {
148148 std::shared_ptr<boxed> sptr;
149149 std::shared_ptr<boxed::weak> wptr;
150150
151151 public:
152− ref() : sptr(std::make_shared<boxed>())
152+ recur() : sptr(std::make_shared<boxed>())
153153 , wptr(std::make_shared<boxed::weak>(*sptr)) {}
154154
155155 operator const boxed&() const {
@@ -169,7 +169,7 @@ namespace purescript {
169169 }
170170
171171 template <typename T>
172− auto operator=(T&& right) -> ref& {
172+ auto operator=(T&& right) -> recur& {
173173 *sptr = std::forward<T>(right);
174174 *wptr = *sptr;
175175 return *this;
@@ -178,7 +178,7 @@ namespace purescript {
178178 class weak {
179179 std::shared_ptr<boxed::weak> wptr;
180180 public:
181− weak(const ref& r) : wptr(r.wptr) {}
181+ weak(const recur& r) : wptr(r.wptr) {}
182182
183183 operator boxed() const {
184184 return *wptr;
@@ -191,8 +191,8 @@ namespace purescript {
191191 auto operator()(const boxed& arg) const -> boxed {
192192 return static_cast<boxed>(*wptr)(arg);
193193 }
194− }; // class ref::weak
195− }; // class boxed::ref
194+ }; // class recur::weak
195+ }; // class boxed::recur
196196
197197 }; // class boxed
198198
src/CodeGen/Cpp.hs+2−2
@@ -255,10 +255,10 @@ moduleToCpp (Module _ coms mn _ imps _ foreigns decls) _ =
255255 bindersToCpp ss binders vals
256256 valueToCpp (Let _ ds val) = do
257257 let recurs = concatMap getNames $ filter isRec ds
258− recurDs = (\v -> AST.Var Nothing $ "boxed::ref " <> identToCpp v) <$> recurs
258+ recurDs = (\v -> AST.Var Nothing $ "boxed::recur " <> identToCpp v) <$> recurs
259259 recurDsWeak = (\v -> AST.Var
260260 Nothing
261− ("boxed::ref::weak " <> identToCpp v <> unretainedSuffix <> "(" <> identToCpp v <> ")")
261+ ("boxed::recur::weak " <> identToCpp v <> unretainedSuffix <> "(" <> identToCpp v <> ")")
262262 ) <$> recurs
263263 mutualRecurWarning = if any isMutRec $ filter isRec ds
264264 then [AST.Var Nothing "#pragma message(\"Mutually recursive lets will cause retain cycles (memory leaks)\") //"]