From d2235112dd401164ba8a096be47a774bed499137 Mon Sep 17 00:00:00 2001 From: hellerve Date: Tue, 12 May 2020 11:31:10 +0200 Subject: [PATCH] core: move the first function into carp template --- core/Core.carp | 1 + src/StartingEnv.hs | 11 ----------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/core/Core.carp b/core/Core.carp index 1b4eff9a..efc5c029 100644 --- a/core/Core.carp +++ b/core/Core.carp @@ -18,6 +18,7 @@ (load-once "Interfaces.carp") (load-once "Bool.carp") (load-once "Macros.carp") +(load-once "Templates.carp") (load-once "Generics.carp") (load-once "Maybe.carp") (load-once "Result.carp") diff --git a/src/StartingEnv.hs b/src/StartingEnv.hs index 8e73d65d..3c49f665 100644 --- a/src/StartingEnv.hs +++ b/src/StartingEnv.hs @@ -72,7 +72,6 @@ pointerModule = Env { envBindings = bindings , envMode = ExternalEnv , envFunctionNestingLevel = 0 } where bindings = Map.fromList [ templatePointerCopy - , templatePointerEqual , templatePointerToRef , templatePointerToValue , templatePointerAdd @@ -94,16 +93,6 @@ templatePointerCopy = defineTemplate ,"}"]) (const []) -templatePointerEqual = defineTemplate - (SymPath ["Pointer"] "eq") - (FuncTy [PointerTy (VarTy "p"), PointerTy (VarTy "p")] BoolTy StaticLifetimeTy) - "checks two pointers for equality." - (toTemplate "bool $NAME ($p *p1, $p *p2)") - (toTemplate $ unlines ["$DECL {" - ," return p1 == p2;" - ,"}"]) - (const []) - -- | A template function for converting pointers to ref (it's up to the user of this function to make sure that is a safe operation). templatePointerToRef = defineTemplate (SymPath ["Pointer"] "to-ref")