Carp/core/Blitable.carp
Erik Svedäng 6f7aeaff73
feat: 'delete' interface (deciding whether a type is managed or not) (#1061)
* feat: 'delete' interface (deciding whether a type is managed or not)

* refactor: Move implements function to Interface module

* feat: Automatically implement 'delete' for types defined with `deftype`

* fix: Don't implement `delete` for Pointer

* refactor: Clarify `memberInfo` function

* fix: Also check if function types are managed

* fix: Implement 'delete' for String and StaticArray.

* fix: Manage String and Pattern. Tests run!

* feat: Add `managed?` primitive

* docs: Note about primitiveIsManaged

* test: Basic test cases for managed / nonmanaged external types

* test: Make sure `managed?` primitive works

* test: Inactivate sanitizer since we're creating leaks intentionally

* feat: Removed 'isExternalType' function

* refactor: Decide if struct member takes ref or not when printing

..based on blitable interface, and 'prn' implemntation

* refactor: Use 'blit' everywhere

* refactor: Implement `strTakesRefOrNot` in terms of `memberStrCallingConvention`

* refactor: Use `remove` over `filter not`
2020-12-20 21:21:14 +01:00

60 lines
1.2 KiB
Plaintext

(defmodule Int
(defn blit [x] (the Int x))
(implements blit Int.blit))
(defmodule Long
(defn blit [x] (the Long x))
(implements blit Long.blit))
(defmodule Float
(defn blit [x] (the Float x))
(implements blit Float.blit))
(defmodule Double
(defn blit [x] (the Double x))
(implements blit Double.blit))
(defmodule Char
(defn blit [x] (the Char x))
(implements blit Char.blit))
(defmodule Bool
(defn blit [x] (the Bool x))
(implements blit Bool.blit))
(defmodule Byte
(defn blit [x] (the Byte x))
(implements blit Byte.blit))
(defmodule Int8
(defn blit [x] (the Int8 x))
(implements blit Int8.blit))
(defmodule Int16
(defn blit [x] (the Int16 x))
(implements blit Int16.blit))
(defmodule Int32
(defn blit [x] (the Int32 x))
(implements blit Int32.blit))
(defmodule Int64
(defn blit [x] (the Int64 x))
(implements blit Int64.blit))
(defmodule Uint8
(defn blit [x] (the Uint8 x))
(implements blit Uint8.blit))
(defmodule Uint16
(defn blit [x] (the Uint16 x))
(implements blit Uint16.blit))
(defmodule Uint32
(defn blit [x] (the Uint32 x))
(implements blit Uint32.blit))
(defmodule Uint64
(defn blit [x] (the Uint64 x))
(implements blit Uint64.blit))