Hi Carlo,

It seems like you've figured out what everything represents and than you
need to use SchemaLoader here. I'm not sure I understand the problem you're
getting at.

On Sat, Jan 21, 2023 at 11:30 AM Carlo Contavalli <ca...@enfabrica.net>
wrote:

> I see I can use SchemaLoader.get() to get a capnp::Type out of a
> schema::Type::Reader, and from there I can get the ListSchema, and
> DynamicList. But the .get() method recurses on the Type, so it'll return
> the type of the inner struct, rather than outer List, and I suspect the
> returned DynamicList will iterate on the inner struct, rather than the
> outer list.
>

You mean SchemaLoader::getType(), right? Sure, the code "recurses" to
convert the list's element type, but it then wraps that type in
`ListSchema::of()`:

case schema::Type::LIST:
return ListSchema::of(getType(proto.getList().getElementType(), scope));

So the returned type should not lose the fact that the type represents a
list (or list-of-lists, or list-of-list-of-lists, etc.).

Do you have some code that doesn't work as you expect, that you could share?

Sorry, I don't know of any example code off the top of my head, though
perhaps there is something in schema-test.c++, schema-loader-test.c++, or
dynamic-test.c++.

-Kenton

-- 
You received this message because you are subscribed to the Google Groups 
"Cap'n Proto" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to capnproto+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/capnproto/CAJouXQkDWd2Vci%3Dn%3DOxiLuVQAr7yzuGk7mtj0d3RZHiNewg-sw%40mail.gmail.com.

Reply via email to