Documentation for syntax


#1

For example, I see the following line in a C3 Type.

type AAAA {
  field1: ~= "BBBB"
}

I want to understand what ~= means. Where can I read some documentation?


#2

I think this means you are taking the same type definition as the type that AAA mixes in, and additionally defining a default value of "BBBB"


#3

Thanks for answering this particular definition. However, I’m looking for the documentation for all syntax / syntax sugar


#4

I think John C is working on putting the type grammar in the documentation, but it’s not ready yet. That only covers what is valid syntax, and does not explain what is syntactic sugar for something else.

In the meantime, these 2 pages cover many, but not all, syntax details (replace localhost:8080 with your server URL):
http://localhost:8080/api/1/c3/c3/documentation/topic/typesys
http://localhost:8080/api/1/c3/c3/documentation/topic/methods
I don’t think it covers the specific question you asked, though, so it’s still incomplete.


#5

You probably don’t see that exact syntax, your type must be mixing or extending another one where field1 is defined.

~= is the same as ~ = so is the combination or inheritance and default value, which are pretty commonly used features (but usually independently).