[{"data":1,"prerenderedAt":605},["ShallowReactive",2],{"navigation_docs":3,"-struct-static":198,"-struct-static-surround":600},[4,30,81,118,147,171,184],{"title":5,"icon":6,"path":7,"stem":8,"children":9,"page":6},"Getting Started",false,"/getting-started","1.getting-started",[10,15,20,25],{"title":11,"path":12,"stem":13,"icon":14},"Introduction","/getting-started/introduction","1.getting-started/2.introduction","i-lucide-house",{"title":16,"path":17,"stem":18,"icon":19},"Installation","/getting-started/installation","1.getting-started/3.installation","i-lucide-download",{"title":21,"path":22,"stem":23,"icon":24},"Quick start","/getting-started/quickstart","1.getting-started/4.quickstart","i-lucide-code-xml",{"title":26,"path":27,"stem":28,"icon":29},"Troubleshooting","/getting-started/troubleshooting","1.getting-started/5.troubleshooting","i-lucide-wrench",{"title":31,"icon":6,"path":32,"stem":33,"children":34,"page":6},"Core Features","/core-features","2.core-features",[35,39,43,48,52,56,60,64,68,73,77],{"title":36,"path":37,"stem":38,"icon":24},"Main function","/core-features/main-function","2.core-features/1.main-function",{"title":40,"path":41,"stem":42,"icon":24},"Variables","/core-features/variables","2.core-features/2.variables",{"title":44,"path":45,"stem":46,"icon":47},"Comment","/core-features/comment","2.core-features/3.comment","i-lucide-hash",{"title":49,"path":50,"stem":51,"icon":24},"Conditionals","/core-features/conditionals","2.core-features/4.conditionals",{"title":53,"path":54,"stem":55,"icon":24},"Loops","/core-features/loops","2.core-features/5.loops",{"title":57,"path":58,"stem":59,"icon":24},"Functions","/core-features/functions","2.core-features/6.functions",{"title":61,"path":62,"stem":63,"icon":24},"Pointers","/core-features/pointers","2.core-features/7.pointers",{"title":65,"path":66,"stem":67,"icon":24},"Data types","/core-features/datatypes","2.core-features/8.datatypes",{"title":69,"path":70,"stem":71,"icon":72},"Operators","/core-features/operators","2.core-features/9.operators","i-lucide-percent",{"title":74,"path":75,"stem":76,"icon":24},"Literals","/core-features/a.literals","2.core-features/a.literals",{"title":78,"path":79,"stem":80,"icon":24},"Keywords","/core-features/b.keywords","2.core-features/b.keywords",{"title":82,"icon":6,"path":83,"stem":84,"children":85,"page":6},"Features","/features","3.features",[86,90,94,98,102,106,110,114],{"title":87,"path":88,"stem":89,"icon":24},"Const","/features/const","3.features/1.const",{"title":91,"path":92,"stem":93,"icon":24},"Define","/features/define","3.features/2.define",{"title":95,"path":96,"stem":97,"icon":24},"Enum","/features/enum","3.features/3.enum",{"title":99,"path":100,"stem":101,"icon":24},"Union","/features/union","3.features/4.union",{"title":103,"path":104,"stem":105,"icon":24},"Overloading","/features/overloading","3.features/5.overloading",{"title":107,"path":108,"stem":109,"icon":24},"Lambda","/features/lambda","3.features/6.lambda",{"title":111,"path":112,"stem":113,"icon":24},"Callback","/features/callback","3.features/7.callback",{"title":115,"path":116,"stem":117,"icon":24},"Auto","/features/auto","3.features/8.auto",{"title":119,"icon":6,"path":120,"stem":121,"children":122,"page":6},"Advance Features","/advance","4.advance",[123,127,131,135,139,143],{"title":124,"path":125,"stem":126,"icon":24},"Generic Type","/advance/generic-type","4.advance/1.generic-type",{"title":128,"path":129,"stem":130,"icon":24},"Errors","/advance/error","4.advance/2.error",{"title":132,"path":133,"stem":134,"icon":24},"Annotation","/advance/annotation","4.advance/3.annotation",{"title":136,"path":137,"stem":138,"icon":24},"Variadic Function","/advance/variadic-func","4.advance/4.variadic-func",{"title":140,"path":141,"stem":142,"icon":24},"Module","/advance/module-interface","4.advance/5.module-interface",{"title":144,"path":145,"stem":146,"icon":24},"Operator Overloading","/advance/operator-overloading","4.advance/6.operator-overloading",{"title":148,"icon":6,"path":149,"stem":150,"children":151,"page":6},"Struct","/struct","5.struct",[152,155,159,163,167],{"title":148,"path":153,"stem":154,"icon":24},"/struct/struct","5.struct/1.struct",{"title":156,"path":157,"stem":158,"icon":24},"Methods","/struct/methods","5.struct/2.methods",{"title":160,"path":161,"stem":162,"icon":24},"Init/Deinit","/struct/init-deinit","5.struct/3.init-deinit",{"title":164,"path":165,"stem":166,"icon":24},"Encapsulation","/struct/encapsulation","5.struct/4.encapsulation",{"title":168,"path":169,"stem":170,"icon":24},"Static","/struct/static","5.struct/5.static",{"title":172,"icon":6,"path":173,"stem":174,"children":175,"page":6},"Data Structures","/data-structure","6.data-structure",[176,180],{"title":177,"path":178,"stem":179,"icon":24},"Array","/data-structure/array","6.data-structure/array",{"title":181,"path":182,"stem":183,"icon":24},"Structural Type","/data-structure/strutural-type","6.data-structure/strutural-type",{"title":185,"icon":6,"path":186,"stem":187,"children":188,"page":6},"Standard Libraries","/stdlib","7.stdlib",[189,194],{"title":190,"path":191,"stem":192,"icon":193},"stdlib","/stdlib/stdlib","7.stdlib/stdlib","i-lucide-library-big",{"title":195,"path":196,"stem":197,"icon":24},"syscall","/stdlib/syscall","7.stdlib/syscall",{"id":199,"title":168,"body":200,"description":593,"extension":594,"links":595,"meta":596,"navigation":597,"path":169,"seo":598,"stem":170,"__hash__":599},"docs/5.struct/5.static.md",{"type":201,"value":202,"toc":590},"minimark",[203,207,510,520,528,533,536,579,586],[204,205,206],"p",{},"Static is a way to make variables or attributes belong to a struct rather than a specific instance of that struct.",[208,209,214],"pre",{"className":210,"code":211,"language":212,"meta":213,"style":213},"language-kh shiki shiki-themes material-theme-lighter one-light one-dark-pro","struct Rect {\n  int32 width;\n  int32 height;\n\n  init Rect(self.width, self.height);\n\n  int32 area(){\n    return width * height;\n  }\n\n  static void print_definition(){\n    print(\"A rectangle is a rectilinear convex polygon or a quadrilateral with four right angles.\")\n  }\n}\n\nint main(string args[]){\n\n  Rect.print_definition();\n\n  Rect rect = Rect(12, 3);\n  print(\"Area: {}\", rect.area());\n\n  return 0;\n}\n","kh","",[215,216,217,234,246,256,263,297,302,313,329,335,340,354,375,380,386,391,411,416,430,435,461,489,494,505],"code",{"__ignoreMap":213},[218,219,222,226,230],"span",{"class":220,"line":221},"line",1,[218,223,225],{"class":224},"sQsOY","struct",[218,227,229],{"class":228},"s8dPH"," Rect",[218,231,233],{"class":232},"sM89C"," {\n",[218,235,237,240,243],{"class":220,"line":236},2,[218,238,239],{"class":224},"  int32",[218,241,242],{"class":228}," width",[218,244,245],{"class":232},";\n",[218,247,249,251,254],{"class":220,"line":248},3,[218,250,239],{"class":224},[218,252,253],{"class":228}," height",[218,255,245],{"class":232},[218,257,259],{"class":220,"line":258},4,[218,260,262],{"emptyLinePlaceholder":261},true,"\n",[218,264,266,269,272,275,278,281,284,287,289,291,294],{"class":220,"line":265},5,[218,267,268],{"class":224},"  init",[218,270,229],{"class":271},"spnjr",[218,273,274],{"class":232},"(",[218,276,277],{"class":228},"self",[218,279,280],{"class":232},".",[218,282,283],{"class":228},"width",[218,285,286],{"class":232},", ",[218,288,277],{"class":228},[218,290,280],{"class":232},[218,292,293],{"class":228},"height",[218,295,296],{"class":232},");\n",[218,298,300],{"class":220,"line":299},6,[218,301,262],{"emptyLinePlaceholder":261},[218,303,305,307,310],{"class":220,"line":304},7,[218,306,239],{"class":224},[218,308,309],{"class":271}," area",[218,311,312],{"class":232},"(){\n",[218,314,316,319,321,325,327],{"class":220,"line":315},8,[218,317,318],{"class":224},"    return",[218,320,242],{"class":228},[218,322,324],{"class":323},"sB4Xn"," *",[218,326,253],{"class":228},[218,328,245],{"class":232},[218,330,332],{"class":220,"line":331},9,[218,333,334],{"class":232},"  }\n",[218,336,338],{"class":220,"line":337},10,[218,339,262],{"emptyLinePlaceholder":261},[218,341,343,346,349,352],{"class":220,"line":342},11,[218,344,345],{"class":224},"  static",[218,347,348],{"class":224}," void",[218,350,351],{"class":271}," print_definition",[218,353,312],{"class":232},[218,355,357,360,362,366,370,372],{"class":220,"line":356},12,[218,358,359],{"class":271},"    print",[218,361,274],{"class":232},[218,363,365],{"class":364},"sVH1b","\"",[218,367,369],{"class":368},"spZWa","A rectangle is a rectilinear convex polygon or a quadrilateral with four right angles.",[218,371,365],{"class":364},[218,373,374],{"class":232},")\n",[218,376,378],{"class":220,"line":377},13,[218,379,334],{"class":232},[218,381,383],{"class":220,"line":382},14,[218,384,385],{"class":232},"}\n",[218,387,389],{"class":220,"line":388},15,[218,390,262],{"emptyLinePlaceholder":261},[218,392,394,397,400,402,405,408],{"class":220,"line":393},16,[218,395,396],{"class":228},"int",[218,398,399],{"class":271}," main",[218,401,274],{"class":232},[218,403,404],{"class":224},"string",[218,406,407],{"class":228}," args",[218,409,410],{"class":232},"[]){\n",[218,412,414],{"class":220,"line":413},17,[218,415,262],{"emptyLinePlaceholder":261},[218,417,419,422,424,427],{"class":220,"line":418},18,[218,420,421],{"class":228},"  Rect",[218,423,280],{"class":232},[218,425,426],{"class":271},"print_definition",[218,428,429],{"class":232},"();\n",[218,431,433],{"class":220,"line":432},19,[218,434,262],{"emptyLinePlaceholder":261},[218,436,438,440,443,446,448,450,454,456,459],{"class":220,"line":437},20,[218,439,421],{"class":228},[218,441,442],{"class":228}," rect",[218,444,445],{"class":323}," =",[218,447,229],{"class":271},[218,449,274],{"class":232},[218,451,453],{"class":452},"sriKn","12",[218,455,286],{"class":232},[218,457,458],{"class":452},"3",[218,460,296],{"class":232},[218,462,464,467,469,471,474,476,478,481,483,486],{"class":220,"line":463},21,[218,465,466],{"class":271},"  print",[218,468,274],{"class":232},[218,470,365],{"class":364},[218,472,473],{"class":368},"Area: {}",[218,475,365],{"class":364},[218,477,286],{"class":232},[218,479,480],{"class":228},"rect",[218,482,280],{"class":232},[218,484,485],{"class":271},"area",[218,487,488],{"class":232},"());\n",[218,490,492],{"class":220,"line":491},22,[218,493,262],{"emptyLinePlaceholder":261},[218,495,497,500,503],{"class":220,"line":496},23,[218,498,499],{"class":224},"  return",[218,501,502],{"class":452}," 0",[218,504,245],{"class":232},[218,506,508],{"class":220,"line":507},24,[218,509,385],{"class":232},[204,511,512,513,515,516,519],{},"In the code above, you don't need to create an instance to call the function ",[215,514,426],{},", you can call it directly using the struct name because it belongs to the struct not the any instances. However, if you want to get the area, you have to create an instance of struct ",[215,517,518],{},"Rect"," first.",[521,522,523,524,527],"note",{},"You can have static variables or methods but you can not have static struct definition.\n",[215,525,526],{},"static struct Rect{ # ... }"," is not valid.",[529,530,532],"h2",{"id":531},"other-contexts","Other Contexts",[204,534,535],{},"The idea of static is not only for struct, but also for variables declared in functions.",[208,537,539],{"className":210,"code":538,"language":212,"meta":213,"style":213},"void do_something(){\n\n  static int32 counter = 0;\n\n}\n",[215,540,541,551,555,571,575],{"__ignoreMap":213},[218,542,543,546,549],{"class":220,"line":221},[218,544,545],{"class":224},"void",[218,547,548],{"class":271}," do_something",[218,550,312],{"class":232},[218,552,553],{"class":220,"line":236},[218,554,262],{"emptyLinePlaceholder":261},[218,556,557,559,562,565,567,569],{"class":220,"line":248},[218,558,345],{"class":224},[218,560,561],{"class":224}," int32",[218,563,564],{"class":228}," counter",[218,566,445],{"class":323},[218,568,502],{"class":452},[218,570,245],{"class":232},[218,572,573],{"class":220,"line":258},[218,574,262],{"emptyLinePlaceholder":261},[218,576,577],{"class":220,"line":265},[218,578,385],{"class":232},[204,580,581,582,585],{},"The ",[215,583,584],{},"counter"," now belongs to the function itself, so if you modify its value, it keep its the modified value even after the function exit.",[587,588,589],"style",{},"html pre.shiki code .sQsOY, html code.shiki .sQsOY{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#A626A4;--shiki-default-font-style:inherit;--shiki-dark:#C678DD;--shiki-dark-font-style:inherit}html pre.shiki code .s8dPH, html code.shiki .s8dPH{--shiki-light:#90A4AE;--shiki-default:#E45649;--shiki-dark:#E06C75}html pre.shiki code .sM89C, html code.shiki .sM89C{--shiki-light:#90A4AE;--shiki-default:#383A42;--shiki-dark:#ABB2BF}html pre.shiki code .spnjr, html code.shiki .spnjr{--shiki-light:#6182B8;--shiki-default:#4078F2;--shiki-dark:#61AFEF}html pre.shiki code .sB4Xn, html code.shiki .sB4Xn{--shiki-light:#39ADB5;--shiki-default:#383A42;--shiki-dark:#ABB2BF}html pre.shiki code .sVH1b, html code.shiki .sVH1b{--shiki-light:#39ADB5;--shiki-default:#50A14F;--shiki-dark:#98C379}html pre.shiki code .spZWa, html code.shiki .spZWa{--shiki-light:#91B859;--shiki-default:#50A14F;--shiki-dark:#98C379}html pre.shiki code .sriKn, html code.shiki .sriKn{--shiki-light:#F76D47;--shiki-default:#986801;--shiki-dark:#D19A66}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":213,"searchDepth":236,"depth":236,"links":591},[592],{"id":531,"depth":236,"text":532},"Make the data stick to your struct.","md",null,{},{"icon":24},{"title":168,"description":593},"NWCWrsGSdztd_cBmumFYSgYwLroeO1l-UpkUVjvRHGU",[601,603],{"title":164,"path":165,"stem":166,"description":602,"icon":24,"children":-1},"Hide your data!",{"title":177,"path":178,"stem":179,"description":604,"icon":24,"children":-1},"A collection of data of a specific type.",1774971230816]