他の言語をある程度知っている人はこれを読めばD言語の基礎をマスターでき,D言語の氷山の一角くらいは知ることができると思います.対象バージョンはdmd 2.059です.
ASCIIかUTFしか受け付けません.それ以外の文字コードで書くとコンパイルエラーになります.
D言語のmainはCとは違い以下のようなシグネチャです.
OBSOLETE PREFIXES | |
-xv-interpret-as // -xv- and -o- are old Opera prefixes for the Presto | |
-xv-phonemes // engine. Opera switched to the Blink engine with | |
-xv-voice-balance // version 15. The current version is 34. | |
-xv-voice-duration | |
-xv-voice-pitch | |
-xv-voice-pitch-range | |
-xv-voice-rate | |
-xv-voice-stress | |
-xv-voice-volume |
import Promise from 'bluebird'; | |
import EventEmitter from 'eventemitter3'; | |
class InlineWorker { | |
constructor(source) { | |
if (typeof source != 'function') { | |
throw new TypeError('source must be a function'); | |
} | |
if (this._worker) { |
NOTE: the content is out-of-date. All development is moved to the https://github.com/yurydelendik/wasmception
# locations, e.g.
export WORKDIR=~/llvmwasm; mkdir -p $WORKDIR
export INSTALLDIR=$WORKDIR
var _ = GaoFunctional(); | |
var input = "114514"; | |
var res = input[_.count](); | |
console.log(res); // 6 | |
var input2 = [1,1,4,5,1,4]; | |
var res2 = input2[_.count]((x)=>x===1); | |
console.log(res2); // 3 |
ffmpeg -i test.mov -vcodec libx264 -vf 'scale=640:trunc(ow/a/2)*2' -acodec aac -vb 1024k -minrate 1024k -maxrate 1024k -bufsize 1024k -ar 44100 -strict experimental -r 30 out.mp4 |
class HtmlSpecialChars{ | |
constructor(list){ | |
if(typeof(list) === "undefined") return; | |
this.escapeList = list; | |
} | |
set escapeList(value){ | |
if(typeof(value) !== "object"){ | |
throw new TypeError("escapeListはObject型のプロパティです"); |
Promise.reverse = function reverse(promise){ | |
// 範囲を広げるために、一応instanceof Promiseではなく、thenableを通すようにしてる。 | |
switch(true){ | |
case (typeof(promise) !== "object"): | |
case (promise === null): | |
case (typeof(promise.then) !== "function"): | |
return Promise.reject(promise); | |
} | |
return promise.then((data)=> Promise.reject(data), (err)=> Promise.resolve(err)); |
This gist had a far larger impact than I imagined it would, and apparently people are still finding it, so a quick update:
(async main(){...}())
as a substitute for TLA. This completely eliminates the blocking problem (yay!) but it's less powerful, and harder to statically analyse (boo). In other words the lack of TLA is causing real problemsI'll leave the rest of this document unedited, for archaeological