You are browsing as a guest. Sign up (or log in) to start making projects!

4h 13m 17s logged

Even more abstractions please

Added generics support, which allows the user to define generic functions/structs that apply with every type, for example:

warp <T> void forEach(T[] a, (T) -> void action) {
    for(T t in a) {
        action(t);
    }
}

Depending on what type you used to call this, a new version of forEach gets generated, if you called it with an integer:

warp void forEach@int(int[] a, (int) -> void action) {
    for(int t in a) {
        action(t);
    }
}

Of course I also allow this on structs:

struct Triangle<Num>(Num x1, Num y1, Num x2, Num y2, Num x3, Num y3);

Also did some small changes:

  • Added an FPS counter to my test code
  • Better optimizations that actually detect not(not(x))
  • Optimized triangle::fill even more (+2 fps)
  • Made DynamicDispatchHandler actually use the apply return properly (it was always returning true)
0
9

Comments 0

No comments yet. Be the first!