Slide 5
Slide 5 text
5
Exploring the Go Compiler: Adding a "four" loop
・2つの構文追加の実例に沿って、Goコンパイラの処理を紹介した発表
1. Recap対象のセッション概要
1: four statement 2: unless statement
// Post stmtを4回繰り返すループ
four i:=0; i<16; i++ {
fmt.Println(i)
}
// 以下のforループと等価
for i:=0; i<16; i+=4 {
fmt.Println(i)
}
// if notのシンタックスシュガー
unless i%2==0 {
fmt.Printf("odd number!")
}
// 以下のif文と等価
if !(i%2==0) {
fmt.Printf("odd number!")
}