Commit Graph

4926 Commits

Author SHA1 Message Date
Veit Heller
5ad1d227f3
Add automatic map resizing (#1071)
* core: add map resizing

* add set resizing

* do not shrink if under dflt-size
2020-12-19 22:20:52 +01:00
Scott Olsen
5f0ae6819e
Various submodule fixes (#1078)
* fix: don't set the inner env to globals in type mods

Previously, we set the inner environment of a type generated module to
the global env in cases where the overarching context didn't have an
inner env. This leads to problems where by the recognition of modules is
inconsistent, and one can't use the names of types as submodules in
certain circumstances.

This commit fixes that issue.

* refactor: refactor primitiveDefmodule

This refactor fixes a issues with meta information on submodules, for
instance, sigs on submodule functions used to result in a compiler error
about ambiguous identifiers. This fixes that.

Unfortunately, I don't have a precise idea about what exactly was wrong
with the original definition of this function. My suspicion is that the
recursion originally altered submodule paths in the wrong way, but I'm
not certain. In any case it's fixed.

* fix: ensure macros are expanded in the correct module

Previously, macro expansions folded over all forms after the top level
form, without performing any context updates on encountered
`defmodules`. This created an issue in which macro calls that produced
new bindings, "meta stubs", were *hoisted* out of submodules and into
the top-level module, creating duplicate definitions.

This commit fixes that issue by adding a special case for defmodule in
macroExpand.

* fix: ensure submodules and globals don't conflict

Previously, our module lookups during new module definition always
eventually fell back to the global environment, which caused submodules
that happen to share a name with a global module to be confused with the
global module. This change fixes that, so now one can define both
`Dynamic` (global) and `Foo.Dynamic` without issue.

* fix: remove old prefixes from vector tests

Commit 7b7cb5d1e replaced /= with a generic function. However, the
vector tests still called the specific Vector variants of this function,
which were removed when the generic was introduced. After recent
changes, these calls are now (correctly) identified as erroneous. My
guess is that they only worked in the past because of problems with our
lookups.

* chore: format code
2020-12-18 21:45:28 +01:00
jacereda
b45b52b568
Add Dynamic.hash (#1069)
* feat: Add Dynamic.hash

* fix: Hash should be a Long
2020-12-16 15:53:55 +01:00
Efi
7d4db3df06
Fix link to Memory.md in patterns.md (#1073) 2020-12-16 10:09:00 +01:00
Scott Olsen
ee0aa59c28
Primitive refactors (#1070)
* refactor: move primitive errors; refactor primtiveInfo

This commit is the first in what will hopefully be a series of helpful
primitive refactors. To start, we:

- Move some inline `evalError` strings into a `PrimitiveError` module,
  (similar to the `TypeError`/`Types` module relationship
- Add `Reifiable` instances for String and Int types to take these
  types to their XObj representation.
- Add info utility functions for converting Info data to an XObj
- Refactor the `info` primitive:

  - Use monadic combinators + `maybe` instead of nested cases.
  - Use helper lookup functions that take a *context*--nearly *all*
    lookup calls currently extract some env, typically without doing
    anything to it, to pass it to lookup. This is a sign the boundary is
    incorrect and lookups should take the context instead--this will allow
    us to eliminate a ton of local `globalEnv`, `typeEnv`, etc. bindings.
  - Don't print hidden bindings
  - Indent printed meta information.
  - Color bindings blue

* chore: format code

* refactor: improve names for lookups that take a context

* feat: print hidden binders when calling info

Someone calling info might be interested in hidden binders as well, for
debugging purposes, etc. To enable this, we provide a version of show
for binders that prints hidden binders.

I've also made the printing of meta values in info more generic.
2020-12-15 21:38:55 +01:00
Veit Heller
629a6cf28d
load: allow for files to be loaded selectively (#1067) 2020-12-15 07:58:33 +01:00
jacereda
7814312c11
Add more variants for running external commands (#1066)
* feat: Implement run-with-args command

* feat: Implement run-exe-with-args command
2020-12-15 07:55:46 +01:00
Scott Olsen
321671c74a
fix: handle unhandled case in isCaptured (#1068)
Previously, this function missed a case, namely, one where the head of a
type definition contains a concrete struct, like `Maybe` with a variable
argument, `a`. That is,

```
(deftype (Foo (Maybe a)) [x (Maybe a)])
```

Would throw a type error. This commit fixes that issue.
2020-12-13 23:38:26 +01:00
jacereda
a0a3976441
Use different command types for each arity (#1063)
* refactor: Use different command types for each arity

* feat: Improved evaluation error messages in arity checks
2020-12-13 23:34:56 +01:00
jacereda
ccd9af500e
Address incomplete patterns (#1062)
* chore: Address incomplete patterns

* chore: Address incomplete patterns

* chore: Address incomplete patterns

* chore: Address incomplete patterns

* chore: Address incomplete patterns

* chore: Address incomplete patterns

* chore: Address incomplete patterns

* chore: Address incomplete patterns

* chore: Address incomplete patterns

* chore: Address incomplete patterns

* chore: Address incomplete patterns

* chore: Address incomplete patterns

* chore: Unused error

* chore: Address incomplete patterns

* chore: Address incomplete patterns

* chore: Address incomplete patterns

* chore: Address incomplete patterns

* chore: Address incomplete patterns

* chore: Remove flag present only in newer ghc
2020-12-09 06:19:28 +01:00
Erik Svedäng
40d55562df
fix: Pointer str & prn (#1060)
* 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
2020-12-09 06:19:07 +01:00
jacereda
dd19c049c6
Ormolu in default.nix and emacs before-save hook. (#1059)
* chore: Add ormolu

* chore: Emacs hook to format via ormolu
2020-12-08 22:09:57 +01:00
Scott Olsen
8c5a117c82
fix: Handle unit members correctly in array templates (#1058)
* fix: Handle unit members correctly in array templates

Units may be used as members in arrays just like any other type,
however, the array templates (which are specific to arrays) hadn't been
updated to handle this. This commit makes the necessary updates and adds
some utility functions in efforts to make using templates in the
compiler easier.

After this commit, the following functions should work correctly on
(Array Unit):

- endo-map
- endo-filter
- copy
- aset!
- aset-uninitialized!
- aset
- pop-back!
- pop-back
- push-back
- push-back!

Just like other types with Unit members, the only value that is stored
in the resulting type is the terminal value of Unit `()` or unit. Any
side effects are run during evaluation of arguments and emitted prior to
any structure manipulations.

Because Unit is a terminal type (contains a single value) it makes
`endo-filter` an interesting case to consider. A filter on such an array
can only either retain all elements or drop all elements since there's
no way to predicate over the single terminal object Unit:

```
(endo-filter &(fn [_] false) [() ()])
=> []
(endo-filter &(fn [_] true) [() ()])
=> [() ()]
```

While arrays of units aren't very meaningful in terms of their contents,
their lengths will be expanded and contracted appropriately, so they can
be used for their length:

```
(defn iterate []
  (let-do [x [() () ()]]
    (while (> (Array.length &x) 0)
      (do (println* "foo")
          (Array.pop-back! &x)))))
(iterate)
Compiled to 'out/Untitled' (executable)
foo
foo
foo
=> 0
```

* chore: remove debugging trace

* refactor: make endo-filter template dryer
2020-12-08 17:29:55 +01:00
Veit Heller
45a5ce605f
feat: better error messages for invalid objects (#1056) 2020-12-07 12:29:33 +01:00
Scott Olsen
036be4a4dd
fix: ensure type variables kinds are consistent (#1055)
Previously, we didn't check that type variables had consistent kinds in
type definitions, which could lead to improper types. For example, one
could define:

    (deftype (Foo f a b) [x (f a) y f])

without issues even though this type is invalid since the variable `f`
is assigned two distinct kinds (nullary: * and unary: *->*).

This commit adds a check to ensure all of the instances of a type
variable in a type definition have the same kind. It also fixes an issue
whereby only higher-kinded types of one argument were allowed as type
members; now higher-kinded types of any arity are permitted (again
assuming variable kinds are consistent).

When a user writes a type that has variables with inconsistent kinds,
they will be hit with an error:

    (deftype (Foo (f a) b) [x (f a) y f])
    Invalid type definition for 'Foo':

    The type variable `f` is used inconsistently: (f a), f Type
    variables must be applied to the same number of arguments.

    Traceback:
    (deftype (Foo (f a) b) [x (f a) y f]) at REPL:1:1.
2020-12-07 10:09:39 +01:00
Erik Svedäng
b1aaa83b6a
refactor: Make Lookup module more focused and DRY (#1054)
* refactor: Move constraints test to own module, create TestLookup module

* refactor: Extracted 'Env' module

* refactor: Extracted 'TypePredicates' module

* test: First, very simple test

* refactor: Extracted 'Managed' module

* refactor: Add 'lookupBinder' function that doesn't return an Env (often what we want)

* refactor: Move out more stuff from Lookup

* refactor: Use new 'lookupBinder' in tons of places (avoids tuple)

* refactor: Got rid of monolithic 'recursiveLookupInternal'

* refactor: Avoid boolean blindness

* refactor: Better names for some lookup functions

* refactor: More logical order in Lookup.hs

* style: Use correct version of ormolu (0.1.4.1)

* refactor: Slightly more consistent naming

* refactor: Address @scolsen:s feedback
2020-12-07 07:06:32 +01:00
Scott Olsen
09fdd80f94
refactor: improve readability of interface functions (#1053)
* refactor: improve readability of interface functions

Also refactors the `define` function for readability.

The old definitions of these functions were quite unwieldy and difficult
to read. This refactor attempts to make the monadic contexts we're
juggling (often 3, Maybe, IO, Either) easier to spot.

* refactor: Add context env updaters; refactor prims

This commit contains a few more cleanups of the interface and define
functions in Primitives. It also defines a new context module for
holding functions that update context environments.
2020-12-05 21:00:28 +01:00
Tim Dévé
1863c82559
chore: Creates pre-commit hook to format Haskell code (#1047)
* chore: moves git hook into own folder

This is is done in preparation of having other git hooks

* chore: Creates script to run formatter

* chore: Checks that ormolu is installed before running it

* chore: Adds pre-commit hook to format Haskell files

* chore: Ensures the ormolu instruction are outputted when running hook

* chore: Prints formatted files on newlines
2020-12-05 14:26:28 +01:00
Erik Svedäng
696ea1a403 fix: Remove duplicated word in docstring 2020-12-05 13:26:27 +01:00
Scott Olsen
9a8c8582f2
feat: add Dynamic.mod (#1051) 2020-12-03 19:24:52 +01:00
Erik Svedäng
a152a0d6e1
fix: Bumped Ormolu version to 0.1.4.1 (#1050) 2020-12-03 12:02:58 +01:00
charlesetc
fa29e8f464
Fix link to Contributing.md (#1049)
Co-authored-by: Charles Chamberlain <charles@nrwhl.xyz>
2020-12-03 09:58:18 +01:00
Scott Olsen
88cffce626
fix: Filter unit types in a few more emissions (#1046)
There are a lot of different places that we need to filter Units out in
order to support them as type members, this commit catches a few more
cases that we missed:

- Lambda env captures
- Case matchers

Fixes issue #1044
2020-12-03 00:02:43 +01:00
Erik Svedäng
7920a751bf
refactor: Apply Ormolu auto-formatting (#1045) 2020-12-02 16:33:37 +01:00
Tim Dévé
f89a3f130e
chore: Makes the commit message hooks more portable (#1042)
Ditches awk and uses sed instead
2020-12-01 20:35:43 +01:00
Tim Dévé
0bd5fa4cb6
chore: Creates git hook to enforce Conventional Commits (#1041)
* chore: Adds Conventional Commits commit-msg hook

* docs: Adds section about git hooks in Contributing Guide

& fixes the headers hierarchy
2020-12-01 14:38:45 +01:00
Tim Dévé
ac4231d005
docs: Expands docs around C function pointers (#1038)
* docs: Generates HTML docs for Function core module

* docs: Adds lifetime information in Function module

* docs: Adds callback section to C Interop

* docs: Corrects typos in Function docs
2020-12-01 10:44:03 +01:00
jacereda
2a94f67db8
Address name shadowing (#1032)
* Rename ty to xobjTy.

* Rename info to xobjInfo.

* Rename obj to xobjObj.

* Address name shadowing.

* Address name shadowing.

* Address name shadowing.

* Address name shadowing.

* Address name shadowing.

* Address name shadowing.

* Address name shadowing.

* Address name shadowing.

* Address name shadowing.

* Address name shadowing.

* Address name shadowing.

* Address name shadowing.

* Address name shadowing.

* Address name shadowing.

* Address name shadowing.

* Address name shadowing.

* Address name shadowing.

* Address name shadowing.

* Address name shadowing.

* Address name shadowing.

* Address name shadowing.

* Remove some primes.
2020-12-01 00:11:01 +01:00
Erik Svedang
a9c8109ace fix: Use correct pattern on windows release script 2020-11-30 23:55:44 +01:00
Erik Svedang
e87c58d33e fix: Typo in release script 2020-11-30 23:44:59 +01:00
Erik Svedäng
b957b5202f fix: Use Scoop on windows release script 2020-11-30 21:48:58 +01:00
Erik Svedäng
fc0bc3a515 feat: Windows release script (naive attempt) 2020-11-30 21:40:51 +01:00
Erik Svedäng
9edce5a356 docs: One more step to ReleaseChecklist.md 2020-11-30 16:13:29 +01:00
Veit Heller
fe07a3f062
Refactor error reporting and add CARP_DIR check (#1033)
* compiler: refactor error reporting and add CARP_DIR check

Co-authored-by: Tim Dévé <TimDeve@users.noreply.github.com>

* set CARP_DIR in tests

Co-authored-by: Tim Dévé <TimDeve@users.noreply.github.com>
2020-11-30 15:58:25 +01:00
Scott Olsen
892a972660
Pointer: Add utility functions (#1012)
* Pointer: Add utility functions

This commit adds a few more utility functions to `Pointer.carp`.

- Pointer.set-unsafe: Sets the value of a pointer to some arbitrary Carp
  value, without type checking. Users need to ensure this operation is
  safe.
- Pointer.set: Sets the value of a pointer to a value of type t to a
  value that has the same type.
- Pointer.cast: Casts a pointer to a value of type t to a pointer to a
  value of type `a`--the argument passed is ignored, it is only used to
  determine the type to cast to.
- Pointer.leak: Copies a Carp reference to a new pointer to the same
  value. This creates a leak since Carp will not automatically clean up
  this memory.
- Pointer.free: Frees a pointer p. Users need to ensure calls to this
  function are safe and do not produce errors like a double free.
  Intended for use with leak.

Here's an example of some of these functions in action:

```
(defn foo []
  (let-do [p (Pointer.leak "leaky")] ;; create a new pointer
    (ignore (Pointer.set p @"foo")) ;; set the pointer to "foo"
    (println* (Pointer.to-value p)) ;; convert to a Carp val to print
    (Pointer.free p) ;; finally, free it.
    0))
(foo)
=> Compiled to 'out/Untitled' (executable)
foo
0
```

And the C of interest:

```
int foo() {
    int _35;
    /* let */ {
        static String _6 = "leaky";
        String *_6_ref = &_6;
        String* _7 = Pointer_leak__String(_6_ref);
        String* p = _7;
        /* let */ {
            static String _15 = "foo";
            String *_15_ref = &_15;
            String _16 = String_copy(_15_ref);
            String* _17 = Pointer_set__String(p, _16);
            String* _ = _17;
            /* () */
        }
        String _26 = Pointer_to_MINUS_value__String(p);
        String _27 = StringCopy_str(_26);
        String* _28 = &_27; // ref
        IO_println(_28);
        Pointer_free__String(p);
        int _34 = 0;
        _35 = _34;
        String_delete(_27);
    }
    return _35;
}
```

As mentioned, and as w/ other Pointer functions users need to ensure the
safety of these operations themselves. For example, calling `free` on
`p` twice in the example above produces the expected double free:

```
(defn foo []
  (let-do [p (Pointer.leak "leaky")] ;; create a new pointer
    (ignore (Pointer.set p @"foo")) ;; set the pointer to "foo"
    (println* (Pointer.to-value p)) ;; convert to a Carp val to print
    (Pointer.free p) ;; finally, free it.
    (Pointer.free p) ;; !Double free!
    0))
(foo)
Compiled to 'out/Untitled' (executable)
foo
Untitled(38328,0x10d9a1dc0) malloc: *** error for object 0x7feb86c01790:
pointer being freed was not allocated
Untitled(38328,0x10d9a1dc0) malloc: *** set a breakpoint in
malloc_error_break to debug
[RUNTIME ERROR] '"out/Untitled"' exited with return value -6.
```

Still, these should come in handy in rare cases in which users need to
circumvent the type checker or borrow checker.

diff --git a/core/Pointer.carp b/core/Pointer.carp
index a662c636..4f29d587 100644
--- a/core/Pointer.carp
+++ b/core/Pointer.carp
@@ -20,6 +20,29 @@ The user will have to ensure themselves that this is a safe operation.")
   (doc from-long "converts a long integer to a pointer.")
   (deftemplate from-long (Fn [Long] (Ptr p)) "$p* $NAME(Long p)" " $DECL { return ($p*)p; }")

+  (doc set-unsafe
+    "Sets the value of a pointer."
+    "The user will have to ensure this operation is safe.")
+  (deftemplate set-unsafe (Fn [(Ptr p) (Ref a b)] (Ptr p)) "$p* $NAME($p* p, void* a)" "$DECL { *p = *($p*)a; return p;}")
+
+  (doc cast
+     "Cast a pointer to type p to a pointer to type a."
+     "The value of the `a` argument is ignored.")
+  (deftemplate cast (Fn [(Ptr p) a] (Ptr a)) "$a* $NAME($p* p, $a a)" "$DECL { *($a*)p = CARP_MALLOC(sizeof($a)); return ($a*)p;}")
+
+  (doc leak
+     "Allocate a new pointer that's a copy of the value of `Ref`"
+     "The Carp borrow checker won't delete this pointer. You will need to delete it manually by calling `Pointer.free`.")
+  (deftemplate leak (Fn [(Ref a b)] (Ptr a)) "$a* $NAME($a* r)" "$DECL { void *leak = CARP_MALLOC(sizeof($a)); memcpy(leak, r, sizeof($a)); return ($a*)leak;}")
+
+  (doc free
+     "Free a pointer."
+     "Users need to manually verify that this operation is safe.")
+  (deftemplate free (Fn [(Ptr p)] Unit) "void $NAME($p* p)" "$DECL {CARP_FREE(p);}")
+
+  (doc set "Sets the value of a pointer.")
+  (deftemplate set (Fn [(Ptr p) p] (Ptr p)) "$p* $NAME($p* p, $p a)" "$DECL { *p = a; return p;}")
+
   (defn inc [a] (Pointer.add a 1l))
   (implements inc Pointer.inc)
   (defn dec [a] (Pointer.sub a 1l))

* Pointer: Change signature of leak to make it more sensible

Instead of `leak` copying a previously allocated value, it now takes
(unmanaged) ownership of a fresh value and allocates. This makes more
sense semantically, as we're just instantiating a new pointer that won't
be managed by Carp and will leak unless freed explicitly.

Thanks to @TimDeve for the suggestion!

* Pointer: Improve apis on set and alloc

- Rename set-unsafe to align w/ naming conventions
  Most unsafe functions are prefixed with `unsafe`, not suffixed.
- Rename leak to `unsafe-alloc` to better convey its semantics (leak
  also already exists as `Unsafe.leak`.
- Remove `cast` since its use is covered by `Unsafe.coerce`.

Thanks to TimDeve and hellerve for the suggestions!

* Pointer: Make unsafe-set take ownership

* Pointer: Correctly cast in unsafe-alloc; add unsafe-realloc

Here's a short illustration of why we need `realloc` even though we
already have `Pointer.add`:

```
(defn foo []
  (let-do [p (Pointer.unsafe-alloc 2)]
    (set! p (Pointer.add p (Pointer.width (Pointer.unsafe-alloc @"foo"))))
    (ignore (Pointer.unsafe-set p @"foo"))
    (println* (Pointer.to-value (the (Ptr String) (Unsafe.coerce p))))
    (Pointer.free p)
    0))
```

This function seems fine at first glance, but since `add` returns a new
pointer, `p` is reset to the new pointer, the reference to the original
is lost, and `free` is called on a value that was never actually
allocated since `add` does not malloc.

Using unsafe-realloc, we can avoid the additional allocation:

```
(defn foo []
  (let-do [p (Pointer.unsafe-alloc 2)]
    (Pointer.unsafe-realloc p @"foo")
    (ignore (Pointer.unsafe-set p @"foo"))
    (println* (Pointer.to-value (the (Ptr String) (Unsafe.coerce p))))
    (Pointer.free p)
    0))
```

The allocation is what we care about here. One still needs to use
`Unsafe.coerce` since as far as the Carp compiler is concerned, `p` is
still a (Ptr Int) even though the corresponding c has cast it silently
to a `String` in order to reallocate.

* Pointer: Change signature of unsafe-set to align with set!

* Pointer: Change signature of `set` to align with `set!`

* Pointer: Remove unsafe-realloc

* Pointer: Update docs for unsafe-alloc and free

* System: Remove System.free

Pointer.free serves a similar function, and is more restrictive, so
we'll remove System.free. One can use `delete` or cast to a pointer and
free that way.See PR #1012 for further discussion.
2020-11-30 07:06:04 +01:00
jacereda
ae2310b2c4
Fix #1001. (#1034) 2020-11-30 06:14:00 +01:00
Erik Svedang
8de4808b74 chore: Move test-for-errors to test directory 2020-11-28 13:11:43 +01:00
Erik Svedäng
f78fd16a71
refactor: Move code out of Macros.carp into other files (#1014)
* 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>
2020-11-28 12:53:18 +01:00
wltsmrz
8c07bda22a
Use CARP_MALLOC throughout carp_stdint (#1024) 2020-11-27 10:19:32 +01:00
rrruko
e3af878e2a
Return reference from unsafe-first/unsafe-last (#1027)
* core: return Array.unsafe-first as reference (#970)

* core: return Array.unsafe-last as reference (#970)

* Make examples and tests build
2020-11-27 10:19:06 +01:00
Tim Dévé
36f41e39a7
Adds Function.unsafe-ptr & Function.unsafe-env-ptr (#1026)
This functions are useful with binding callback based C APIs
2020-11-27 10:17:29 +01:00
Erik Svedäng
49b2c1ea10
Update CarpHask.cabal 2020-11-26 08:26:51 +01:00
Erik Svedäng
d74b90c8ce
Update Main.hs 2020-11-26 08:26:11 +01:00
jacereda
cb39a6a0c3
Address unused matches. (#1019) 2020-11-25 22:12:57 +01:00
jacereda
f6386c6b70
Address unused local bind. (#1018)
* Address unused local bind.

* Add TODO about possible bug.
2020-11-25 09:19:15 +01:00
Scott Olsen
f1ea2b39ef
Unit: Add implementations of = (#1017) 2020-11-24 19:31:53 +01:00
Scott Olsen
541630569c
Docs: Make ref-let pattern a bit clearer (#1016) 2020-11-24 19:28:15 +01:00
Scott Olsen
eb85906e52
Meta set fix and refactor (#1008)
* Meta: Fix hangs on calls to meta functions

This commit fixes a subtle bug whereby setting the meta of an existing
binder would cause hangs. Ultimately, this still points to an underlying
issue in our Lookup code that causes such loops, but for now this at
least fixes the hang introduced by the doc call in `core/Tuples.carp`
(see issue #842).

The primary fix seems to be related to setting the parentEnv in a case
in which we failed to do so in `Eval.hs`. Additionally, our meta setting
macros call `eval` which causes them to be evaluated *immediately after*
expansion, causing them to be evaluated in the incorrect context in the
Tuples.carp case.

Additionally:

- Refactored primitiveMetaSet and primitiveMeta to make them cleaner.
- Only set `implements` early when we're certain we won't accidentally
  overwrite the interface.
- Generalize DocStub to `MetaStub` so that it may be used for forward
  meta declarations of any kind.

* Macros: Don't eval meta-set! macros

Calling eval in the body of the meta-set! macros can cause them to be
evaluated before anticipated, possibly setting the meta on a binding in
the incorrect environment. An exemplary case of this issue existed in
`Tuples.carp` (also fixed in this commit) whereby the generated
defmodule for a tuple type called doc, which was evaluated *before* the
emitted module, resulting in overwrites of global name docs instead of
the expected module function.

We retain `evals` in macros that are more useful in the repl, such as
`print-doc`. If a user wants to evaluated one of the meta-set macros in
the REPL, they'll need to add a call to eval.

* Macros: Restore calls to eval

Turns out the meta-set! macros *do* require calls to eval, unlike I
reported in the previous commit. This commit restores those and replaces
the `doc` call in `Tuples.carp` with a direct `meta-set!` to ensure we
have docs for those functions.

Also fixed a small error in implements primitive.

* Primitives: Refactor i->inner in primitiveImplements
2020-11-24 19:27:34 +01:00
Erik Svedäng
77e6257ace
docs: Tiny tweaks to front page 2020-11-24 16:50:50 +01:00
Erik Svedäng
d888c8c9cd
docs: Better credits and contribution guide (#1010)
* docs: Cleaned up the "credits" section a fair bit

* docs: Unified list of maintainers

* Update README.md

Co-authored-by: Erik Svedang <erik@Eriks-iMac.local>
2020-11-24 16:47:44 +01:00