how to refer to a a default choice of an enum imported from another piqi file.

13 views
Skip to first unread message

bart van deenen

unread,
Mar 1, 2013, 5:32:24 AM3/1/13
to pi...@googlegroups.com
Hi all

I can't figure it out.

I have a file types.piqi with an enum in it.
.enum [
    .name access
    .option [.name public]
    .option [.name internal]
    .option [.name protected]
]


In another file I have

.import [ .module types ]

.record [
    .name instance
    .field [ .type types/access .optional .default ...... ]
]


I'd really like to add the .default (public) to my access field, but I keep getting piqi errors. I've tried public, types/public, types/access/public, types:public but all of them return a piqi compile error 'unknown variant'.

Any suggestions?

Thanks

Bart.

P.S. I'm still using 0.5.7, I'm waiting for the official switch to 0.6 here.

Anton Lavrik

unread,
Mar 1, 2013, 12:43:28 PM3/1/13
to pi...@googlegroups.com
Hi Bart,

It should be .default.public or .default (.public)

The documentation is definitely not covering this well. I'll update it
and add some examples.

Anton
> --
> You received this message because you are subscribed to the Google Groups
> "piqi" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to piqi+uns...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
Reply all
Reply to author
Forward
0 new messages