2+2…

After a lovely time with mfix making cyclic data structures, so that Nat knows about its bits which are typed in terms of Nat, I then had a horrid time chasing down a peculiar bug. It turns out that

(t :->> w) @@ e = t @@ e :->> w @@ e

ain’t the same as

(t :->> w) @@ e = (t @@ e) :->> (w @@ e)

which is what I meant. Differently grouped, it loops rather tightly. Took me ages to find it. Now that I’ve nailed that little sod, I can confirm that 2+2 is indeed 4.

I’ll commit the changes tomorrow, when I’ve yanked out all the tracing.

2 Responses to “2+2…”

  1. Conor Says:

    OK, I’ve done a commit. There are a couple of files in the tests directory:

    • Four.epig does some basic arithmetic, including 4!. Shocking…
    • NatVec.epig gets as far as vector concatenation. Edwin, check out the two subtly different definitions of vector elimination.
  2. Conor Says:

    I’ve fixed the precedence levels so the original does what it’s supposed to.

Leave a Reply