This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import std.traits; | |
struct Signed {} | |
struct Unsigned {} | |
struct Wrapper(V, T) { | |
private V value; | |
private T tag; | |
alias value this; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// dmd 2.063 | |
// ref. http://d.hatena.ne.jp/yutakikuchi/20130617/1371425713 | |
import std.array, std.conv, std.datetime; | |
import std.stdio; | |
void main() { | |
// 現在時刻のDateTimeを取得 | |
{ | |
const current = Clock.currTime; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; gauche 0.9.3.3 | |
;; ref. http://developer.hatenastaff.com/entry/2013/04/11/143235 | |
(use rfc.json) | |
(use rfc.http) | |
(use rfc.uri) | |
(define (api-request uri) | |
(receive (scheme user-info hostname port path query fragment) (uri-parse uri) | |
(receive (status header body) (http-get hostname path) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import std.algorithm, std.array, std.stdio, std.typecons; | |
immutable statusCode = [ | |
tuple("100", "Continue"), | |
tuple("101", "Switching Protocols"), | |
tuple("102", "Processing"), | |
tuple("200", "OK"), | |
tuple("201", "Created"), | |
tuple("202", "Accepted"), | |
tuple("203", "Non-Authoritative Information"), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- BiwaScheme 0.6.1 --> | |
<html> | |
<head> | |
<title>enchant.js sample in BiwaScheme</title> | |
</head> | |
<body> | |
<div id="enchant-stage" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; JavaScript の関数を呼び出す | |
;; e.g. rosso(fantasma) | |
(js-call (js-eval "rosso") fantasma) | |
;; クラスのインスタンスを生成する | |
;; e.g. new Tiro(finale) | |
(js-new "Tiro" finale) | |
;; クラスのメソッドを呼び出す | |
;; e.g. homu.attack(baretter, eagle, remington, m249) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- BiwaScheme 0.6.1 --> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | |
<title>Powered by BiwaScheme</title> | |
<style> | |
input#fire { width: 50px; height: 24px; font-size: 14px; } | |
</style> | |
</head> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Gauche 0.9.2 | |
(use srfi-43) | |
(use rfc.http) | |
(use rfc.json) | |
(use rfc.uri) | |
(use util.list) | |
(use util.match) | |
(use file.util) | |
(use gauche.threads) |