WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

questions about ArrayDyn, Functor, Object, Any #32

@bkerin

Description

@bkerin

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);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions