* chore: Re-format Haskell code
* fix: Unify aupdate and aupdate! with other update functions
* fix: Re-add comment
* fix: Also make StaticArray.aupdate! adhere to the normal update signature
* fix: Failing test
* 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 is a work around for https://github.com/carp-lang/Carp/issues/776
the proper fix would be to allow range to take `(range 0 0 1)` inputs
but the decision about what the correct behavior should be hasn't been
made.
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.
Since the function is generic over arrays, it makes more sense to house
it here.
I've also fixed an issue with its definition whereby we produced extra
empty arrays when n was greater than the original array length. We now
return an array of a length that matches precisely the number of
partitions with values we're able to create.