-
Notifications
You must be signed in to change notification settings - Fork 41
Description
I've been working on adding gcompose/gcomposen implementations back in to Functor such that the ex01 can work again. My stuff works ok with the existing ComposFun data type which just has an OBJ[], but I thought it might be nice to use two-sided growth array instead to flattening of composed Functors could be fast at eval-time and not involve potentially big copies at compose-time. I see ArrayDyn already has an implementation for this.
There are a few issues though. Array hold Object, and Functor are explicitly not Objects. I'm not entirely clear why not? Or Array could hold Any instead? The only manifest difference I see between Any and Object is that the former doesn't support new* methods, but perhaps there is some conceptual difference intended as well?
I did get this working before notiicing the Any/Object issue (I guess the auto constructor is somehow avoiding the issue), so it seems like it could work in principle at least for this case, and it's a bit sad that Functor's aren't Objects or Arrays dont store Objects or something:
OBJ ftor_array = aArray(t3f, t2f, t5f);
OBJ view = aArrayView(ftor_array, aSlice(1, gsize(ftor_array)-1, 1));
OBJ t3t2t5f = gcomposen(ftor_array);