It looks like Alice and Quinedot have already provided a nuts-and-bolts explanation, and an ugly but possibly workable solution.
Backing up a bit, I infer you’re trying to implement some kind of type lattice where a concrete type is defined by its properties, and you can add new properties to types and transmute them. I’m making a leap. If I'm right, I tried to do this a while back in my Rust implementation of AdamV’s Information Programming (https://adamv.be/Information-programming) and I concluded that the Rust trait system and dyn dispatch mechanism was a bad fit - at least without quite a bit of additional plumbing and glue. Things it needs to do in order to perform the compile-time monomorphization prohibit the kind of fast-and-loose polymorphism that you need. If you’re happy to use unstable language features, you might look at rattish. https://crates.io/crates/rattish <https://crates.io/crates/rattish> I wouldn’t recommend using it as is, but looking through the implementation might give you ideas. Personally, I didn’t want to pay the runtime cost of a hash for every join, so I ended up making a proc macro that created a big table of implementations. Also interesting to look at for ideas is pergola https://crates.io/crates/pergola <https://crates.io/crates/pergola> Created by the inventor of the Rust language. -Luke AdamV’s Information Programming (https://adamv.be/Information-programming <https://adamv.be/Information-programming>). > On Dec 28, 2021, at 1:38 PM, Ben Goertzel <[email protected]> wrote: > > We are hitting some weird issues with our experimental use of Rust in a > Hyperon prototype ... Any Rust gurus on here know an answer? > > https://users.rust-lang.org/t/cannot-find-an-error-in-the-lifetime-annotations/69457 > > <https://users.rust-lang.org/t/cannot-find-an-error-in-the-lifetime-annotations/69457> > > > > -- > You received this message because you are subscribed to the Google Groups > "opencog" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] > <mailto:[email protected]>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/opencog/CACYTDBezTgUd6i_tpw7CzzDvjS8VC4VOfMwVdfDrMCE8EsFihg%40mail.gmail.com > > <https://groups.google.com/d/msgid/opencog/CACYTDBezTgUd6i_tpw7CzzDvjS8VC4VOfMwVdfDrMCE8EsFihg%40mail.gmail.com?utm_medium=email&utm_source=footer>. -- You received this message because you are subscribed to the Google Groups "opencog" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/opencog/82C01A12-802E-4B76-9532-32D98240E52E%40gmail.com.
