他の言語をある程度知っている人はこれを読めばD言語の基礎をマスターでき,D言語の氷山の一角くらいは知ることができると思います.対象バージョンはdmd 2.059です.
ASCIIかUTFしか受け付けません.それ以外の文字コードで書くとコンパイルエラーになります.
D言語のmainはCとは違い以下のようなシグネチャです.
| <?xml version="1.0" encoding="UTF-8"?> | |
| <classpath> | |
| <classpathentry kind="src" path="src/main/java"/> | |
| <classpathentry kind="src" path="src/test/java"/> | |
| <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> | |
| <classpathentry kind="lib" path="/usr/share/java/commons-logging-1.1.1.jar"/> | |
| <classpathentry kind="lib" path="/usr/share/java/junit4.jar"/> | |
| <classpathentry kind="output" path="bin"/> | |
| </classpath> | 
| Function Play-Mario { | |
| [System.Console]::Beep(659, 125); | |
| [System.Console]::Beep(659, 125); | |
| [System.Threading.Thread]::Sleep(125); | |
| [System.Console]::Beep(659, 125); | |
| [System.Threading.Thread]::Sleep(167); | |
| [System.Console]::Beep(523, 125); | |
| [System.Console]::Beep(659, 125); | |
| [System.Threading.Thread]::Sleep(125); | |
| [System.Console]::Beep(784, 125); | 
| 日時: | 2016-11-06 | 
|---|---|
| 作: | @voluntas | 
| バージョン: | 0.0.0 | 
| URL: | https://voluntas.githu.io/ | 
突っ込みは Twitter @voluntas まで。
| use std::fmt; | |
| struct Point { | |
| x: i32, | |
| y: i32, | |
| } | |
| impl fmt::Display for Point { | |
| fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { | |
| write!(f, "({}, {})", self.x, self.y) | 
| #!/bin/bash | |
| # From: https://twitter.com/grethlen/status/906154326975905793 | |
| sudo ping -i 0 -c 1400 pong4.kooshin.net \ | |
| | grep -oP "icmp_seq=\K\d+" \ | |
| | cat - <(seq 1 1400) \ | |
| | sort -n \ | |
| | uniq -c \ | |
| | awk '{printf $1}' \ | |
| | fold -w70 \ | 
| package main | |
| import ( | |
| "bytes" | |
| "fmt" | |
| "io" | |
| "os" | |
| "strings" | |
| ) | 
| package main | |
| import ( | |
| "fmt" | |
| "io" | |
| "net/http" | |
| "os" | |
| ) | |
| func main() { |