On Mon, Oct 3, 2016 at 9:06 PM, stewart mackenzie <[email protected]>
wrote:

>
> buildFractalideContract rec {
>   src = ./.;
>   contract = ''
>   @0xdfa17455eb3bee21;
>
>     using Tuple = import "${tuple}/src/contract.capnp";
>
>     struct Command {
>       name @0 : Text;
>       singles @1 : List(Text);
>       kvs @2 : List(Tuple.Tuple);
>     }
>   '';
> }
>
>
Note that this means exactly the same thing as:

  @0xdfa17455eb3bee21;
   struct Command {
     name @0 : Text;
     singles @1 : List(Text);
     kvs @2 : List(import "${tuple}/src/contract.capnp".Tuple);
  }


`Using` statements pertain only to name resolution. They have no effect on
the generated code.

It sounds like what you're interested in is "type aliases", which are not
yet implemented in Cap'n Proto, though they are on the roadmap [1]. See [2]
for some more discussion.

[1] https://capnproto.org/roadmap.html#language-features
[2] https://groups.google.com/forum/#!msg/capnproto/rRpB7NO56Ds/yNo-UVjUw28J


- David

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

Reply via email to