* feat!: implemented String.ascii-to-lower and String.ascii-to-upper
* fix: corrected docstrings
* fix: added unit test for ascii-to-lower and ascii-to-upper
* fix: moved tolower- and toupper from String to Byte module
Co-authored-by: guberatsie <gunnar.bernhardt@siemens.com>
* core: add derive
* fix: fix errors with set!
Notably, don't type check dynamic bindings (which can be set to
whatever) and eliminate a hang that resulted from not handling an error
at the end of the `set!` call. Also refactors some of the code in
efforts to make it a bit cleaner.
Also adds an error when `set!` can't find the variable one calls set!
on.
* feat: better derive
* test: add error test for derive
* document derive
* add derive to core documentation to generate
* core: add derive
* fix: fix errors with set!
Notably, don't type check dynamic bindings (which can be set to
whatever) and eliminate a hang that resulted from not handling an error
at the end of the `set!` call. Also refactors some of the code in
efforts to make it a bit cleaner.
Also adds an error when `set!` can't find the variable one calls set!
on.
* feat: better derive
* document derive
* feat: first completely working version of derive
* feat: make name of derivable customizable (thanks @scolsen)
* refactor: implement doc edits provided by @scolsen
* feat: change argument order for derive
* fix: change deriver error test
* test: add derive tests
* fix: change order of derive back
* docs: fix typo in derive document
Co-authored-by: scottolsen <scg.olsen@gmail.com>
* 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`
* fix: Make `str` work for (Pointer a) types
* test: Make sure that the Pointer.str compiles
* fix: Remove test case, keep function around to make sure it compiles
* refactor: Move code out of Macros.carp into other files
* fix: Move back some macros needed in --no-core mode
* refactor: Remove weird 'evaluate' macros
* fix: Put back more macros
* fix: Remove transitive loading of Macros.carp
* refactor: Remove ArrayMacros.carp and put 'for' at top of Array.carp instead
* refactor: More splitting up
* refactor: Move back save-docs
* fix: Moved back some stuff
Co-authored-by: Erik Svedang <erik@Eriks-iMac.local>
This change adds a new primitive Implements which changes interface
implementations from being implicit to being explicit. Going forward,
users will have to declare (implements <interface> <implementation>) to
explicitly add a function to an interface. This provides two benefits:
- Prevents unwitting name clashes. Previously, if one defined a function
that happened to have the same name as an interface, it was
automatically assumed the function implemented that interface when this
is not always the intention, especially in large programs.
- Name flexibility. One can now implement an interface with a function
that has a different name than the interface, which allows for greater
flexibility.
I've updated core to make the necessary calls to the new primitive.
Since str and copy are derived automatically for types, we treat these
functions as a special case and auto-implement the interfaces.