2006-08-03から1日間の記事一覧

いつかはもっときれいにしたい。

prototype.jsの解読なんぞをやっていますが、拙作theater.jsではprototype.jsを使っていません。それでもクラス作成・継承をやっています。・・・が、かなりごちゃごちゃしてます。prototype.js等を知らずに我流でやってしまった結果です。なので、お手本に…

$R関数

【抜粋】 var $R = function(start, end, exclusive) { return new ObjectRange(start, end, exclusive); }前述ObjectRangeクラスのオブジェクトを作成、返却します。 【例】前述のObjectRangeクラスの例を$R関数に変えただけ。 var objR1 = $R(-2, 3, true)…

ObjectRangeクラス

【抜粋】 ObjectRange = Class.create(); Object.extend(ObjectRange.prototype, Enumerable); Object.extend(ObjectRange.prototype, { initialize: function(start, end, exclusive) { this.start = start; this.end = end; this.exclusive = exclusive; }…