소스 검색

Snippets update (#6204)

~~Added explanatory comment about math package usage~~
Changed Main() entry point to Run() as per design and toolchain

This small update of front page code snippets will add
explanatory comment to highlight that provided Carbon code
is  hypothetical and meant to show the look and feel of the language.

Also it delivers change of Main() to Run() to
highlight correct entry point for Carbon lang.
gleb 6 달 전
부모
커밋
4370acd1bb
4개의 변경된 파일5개의 추가작업 그리고 2개의 파일을 삭제
  1. 3 0
      README.md
  2. 1 1
      docs/design/expressions/literals.md
  3. 0 0
      docs/images/carbon_snippet.svg
  4. 1 1
      docs/images/snippets.md

+ 3 - 0
README.md

@@ -169,6 +169,9 @@ If you're already a C++ developer, Carbon should have a gentle learning curve.
 It is built out of a consistent set of language constructs that should feel
 familiar and be easy to read and understand.
 
+The Carbon code here is hypothetical and meant to show the look and feel of the
+language.
+
 C++ code like this:
 
 <a href="docs/images/snippets.md#c">

+ 1 - 1
docs/design/expressions/literals.md

@@ -226,7 +226,7 @@ fn Sum(x: i32, y: i32) -> i32 {
   return x + y;
 }
 
-fn Main() -> i32 {
+fn Run() -> i32 {
   return Sum(4, 2);
 }
 ```

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
docs/images/carbon_snippet.svg


+ 1 - 1
docs/images/snippets.md

@@ -98,7 +98,7 @@ fn PrintTotalArea(circles: [Circle]) {
   Print("Total area: {0}", area);
 }
 
-fn Main() -> i32 {
+fn Run() -> i32 {
   // A dynamically sized array, like `std::vector`.
   var circles: array [Circle] = ({.r = 1.0}, {.r = 2.0});
   // Implicitly constructs a slice from the array.

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.