Re: [capnproto] How to reference constant value from one in another?

2019-10-06 Thread 'Kenton Varda' via Cap'n Proto
Hi Vitali, At present the compiler does not support referencing a member of a constant, nor computing basic arithmetic, etc. I think it would be cool to add support for these things to the language, but personally I haven't yet had a need for it. -Kenton On Fri, Oct 4, 2019 at 7:24 PM wrote: >

[capnproto] How to reference constant value from one in another?

2019-10-04 Thread vlovich
I was wondering if it's possible to derive one constant from another? Something like: struct Foo { a @0 :Float32; b @1 :Float32; }; const oneWay :Foo = ( a = 1.0, b = 2.0 ) const orAnother :Foo = ( a = .oneWay.b, b = .oneWay.a ) And of course expanding this wondering if basic math operation