Hi David,

On 17 Sep 2016 07:33, "David Renshaw" <da...@sandstorm.io> wrote:
>    1. For the case when your values are constants, we could implement
support for pointer-field constants, allowing you to "construct" the values
in schema files. https://capnproto.org/language.html#constants

This won't be used too much in our project, contracts are shared between
components and would mean managing more moving parts, also we have another
mechanism to statically insert data into contracts, called an Initial
Information Packet. Nice idea for many I'm sure.

>    2. We could use macros, as in https://github.com/bfops/capnpc-macros
(Note that I haven't actually tried out this particular project, but the
approach seems promising.)

Ah this really does look interesting. If it gets merged upstream we'll use
it. Managing code churn can be annoying.

> Responses to your specific code issues are inline below.
>
>
> On Fri, Sep 16, 2016 at 5:55 PM, stewart mackenzie <setor...@gmail.com>
wrote:
>>
>> the code:
>>
>> let mut ip = out_ip.init_root::<list_list_list_text::Builder>();
>> for file in mock_commands {
>>     let mut line_count: u32 = 0;
>>     let mut list_0 = ip.init_list(file.len() as u32);
>
>
> If I change this line to
>
>             let mut list_0 = ip.borrow().init_list(file.len() as u32);

Great way to wake up in the morning! My code typechecks! The reason is
quite obvious now that I see it.

I greatly appreciate your response!

/sjm

-- 
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.
Visit this group at https://groups.google.com/group/capnproto.

Reply via email to