Loading

"Go" as smart as Python or Ruby for this case

Here is print.go code from built-in documents.

package main

import "fmt"

func main() {
   var u64 uint64 = 1<<64-1;

   type T struct { a int; b string };
   t := T{77, "Sunset Strip"};
   a := []int{1, 2, 3, 4}; 

   fmt.Printf("%v %v %v\n", u64, t, a);
   fmt.Print(u64, " ", t, " ", a, "\n");
   fmt.Println(u64, t, a);
}


The results are as smart as high level languages does.

Struct, Array, can print just like Python or Ruby, or can do C way too.

$./6.out
18446744073709551615 {77 Sunset Strip} [1 2 3 4]
18446744073709551615 {77 Sunset Strip} [1 2 3 4]
18446744073709551615 {77 Sunset Strip} [1 2 3 4]

I believe C++ Programmers will like it.

No comments:

က်ေနာ္ဖတ္ေသာ အျခား ဘေလာ့ / ဆိုဒ္မ်ား