���Ȥ������

���μ����Ϥʤ���͡�BF�����򿷸���ȸƤ�ǵ������ΤϾ������ޤǤ���͡�

������Hotep(��̾)

�Ȥ����櫓�Ǿ��Ԥ����Τ������顣̾������������Dz���Hotep�Ȥ�֤��Ȥˤ��ޤ���



ñ���(�ס��ء�)�פ�����(/���ء�)/�ˤ㡼����Ĥ�����

asin:4797354143
���ܸ���?

�ˤ�ؤ�餺��Hotep�ˤ����Ƥ����Ƥ��ˡ��ǥ�ˤ���Ȥ�����ͤ�2��(�ס��ء�)�פ���(�ס��ء�)�פ���(�ס��ء�)�פ���(/���ء�)/�ˤ㡼(�ס��ء�)�פ���(/���ء�)/�ˤ㡼(�ס��ء�)�פ���(/���ء�)/�ˤ㡼(�ס��ء�)�פ���(/���ء�)/�ˤ㡼(/���ء�)/�ˤ㡼(�ס��ء�)�פ���(�ס��ء�)�פ���(�ס��ء�)�פ���(/���ء�)/�ˤ㡼(�ס��ء�)�פ���(/���ء�)/�ˤ㡼(�ס��ء�)�פ���(/���ء�)/�ˤ㡼(�ס��ء�)�פ���(/���ء�)/�ˤ㡼(/���ء�)/�ˤ㡼(�ס��ء�)�פ���(�ס��ء�)�פ���(/���ء�)/�ˤ㡼(�ס��ء�)�פ���(/���ء�)/�ˤ㡼(�ס��ء�)�פ���(/���ء�)/�ˤ㡼(/���ء�)/�ˤ㡼(�ס��ء�)�פ���(/���ء�)/�ˤ㡼(�ס��ء�)�פ���(/���ء�)/�ˤ㡼(�ס��ء�)�פ���(/���ء�)/�ˤ㡼(�ס��ء�)�פ���(/���ء�)/�ˤ㡼(/���ء�)/�ˤ㡼(�ס��ء�)�פ���(/���ء�)/�ˤ㡼(�ס��ء�)�פ���(/���ء�)/�ˤ㡼(�ס��ء�)�פ���(/���ء�)/�ˤ㡼(/���ء�)/�ˤ㡼(�ס��ء�)�פ���(/���ء�)/�ˤ㡼(/���ء�)/�ˤ㡼�Ȥʤ�ޤ���

�褫�ä��͡��˥��Ҥ���!

�ʲ���������γ˥��Υࡣ

iota2hotep = function(str){
    return str.replace(/./g, function(c){
        return c === '*' ? '(�ס��ء�)�פ���'
            :  c === 'i' ? '(/���ء�)/�ˤ㡼'
            : '';
    });
};

hotep2iota = function(str){
    return str.replace(/\(�ס��ء�\)�פ���|\(\/���ء�\)\/�ˤ㡼/g, function(s){
        return s === '(�ס��ء�)�פ���' ? '*' : 'i';
    });
};

hotep = function(str){
    return iota(hotep2iota(str));
};

Perl�Τ褦�ʤ�ΤǤϤʤ���Java�Τ褦�ʤ�Τ�ɽ�����Ƥ���ޤ���

Jot��̼�ǤϤʤ�iota��̼�ʤΤϡ���������(�ס��ء�)�פ�����(/���ء�)/�ˤ㡼�ΥХ�󥹤��褫�ä����顣���ԼԤΰ�¸�Ƿ��ޤ�����

����ǤϤ����ˡ�

Dan the Creeping Blogger

Her Ancestors

Unlambda

S = function(x){return function(y){return function(z){return x(z)(y(z))}}};
K = function(x){return function(y){return x}};
I = function(x){return x};

unlambda = function(str){
    return (function(a){
        if (!a.length) throw 'syntax error';
        return { s:S, k:K, i:I }[a.shift()] 
            || arguments.callee(a)(arguments.callee(a))
    })(str.replace(/[^`ski]/g, '').split(''));
};

iota

U = function(x){return x(S)(K)};

iota = function(str){
    return (function(a){
        if (!a.length) throw 'syntax error';
        return a.shift() === 'i' ? U : arguments.callee(a)(arguments.callee(a));
    })(str.replace(/[^\*i]/g, '').split(''));
};


Jot

B = function(x){return function(y){return function(z){ return x(y(z))}}};

jot = function(str){
    return (function(a, v){
        return !a.length ? v 
            : a.shift() === '0' ? arguments.callee(a, U(v))
                                : arguments.callee(a, B(v))
    })(str.replace(/[^01]/g, '').split(''), I);
};


Auxiliary Code

Prelude

/* bool */
T    = unlambda('k');
F    = unlambda('`ki');
IF   = unlambda('i');
NOT  = unlambda('``s``si`k`ki`kk');
AND  = unlambda('``ss`k`k`ki');
OR   = unlambda('``si`kk');
/* list */
CONS = unlambda('``s``s`ks``s`kk``s`ks``s`k`sik`kk');
CAR  = unlambda('``si`kk')
CDR  = unlambda('``si`k`ki');
NIL  = unlambda('`kk');
NILP = unlambda('``si`k`k`k`ki');
NTH  = unlambda('``s`k`s`k``si`kk``si`k``si`k`ki')
/* num */
ZERO = unlambda('`ki');
SUCC = unlambda('`s``s`ksk')
ADD  = unlambda('``si`k`s``s`ksk');
MUL  = unlambda('``s`ksk');
POW  = unlambda('``s`k`sik');
PRED = unlambda('``s``s`ks``s`k`s`ks``s``s`ks``s`k`s`ks``s`k`s`kk``s``s`ksk`k'
            +   '``s`k`s`k`si``s`k`s`kk``s`k`sik`k`kk`k`k`ki');
SUB  = unlambda('``s`k`s``si`k``s``s`ks``s`k`s`ks``s``s`ks``s`k`s`ks``s`k`s'
            +   '`kk``s``s`ksk`k``s`k`s`k`si``s`k`s`kk``s`k`sik`k`kk`k`k`kik');
Y = unlambda('```ss`s``s`ksk`k``sii'); /* needs a lazy evaluator */
Y = unlambda('``s``s``s`ksk`k``sii``s``s`ksk`k``sii'); /* eagar eval OK, but */
Y    = function(f){ /* to save call stack, Y and others are hand-crafted */
    return (function(g){return function(m){return f(g(g))(m)}})
            (function(g){return function(m){return f(g(g))(m)}})
};
IFR  = function(p){return function(x){return function(y){
    return IF(p)(x)(y)(I) /* wrap x and y with function(){} -- see cnfact */
}}};
LSOF   = function(a){return Y(CONS(a))}; /* (infinite) list with elem. a */
CNEQ   = function(m){return function(n){ /* n == m for church num. */
    return NTH(n)(m(CONS(F))(CONS(T)(LSOF(F))))
}};
CNNE   = function(m){return function(n){ /* n != m for church num. */
    return NTH(n)(m(CONS(T))(CONS(F)(LSOF(T))))
}};

Utilities

cb2bool = function(p){return p(true)(false) };
cn2num  = function(n){return n(function(i){return i+1})(0)};
ary2cl  = function(a){
    if (a.length === 0) return NIL;
    var c = a.shift();
    return CONS(c)(arguments.callee(a));
};
cl2ary  = function(l){
    var a = [];
    for (;!cb2bool(NILP(l)) ; l = CDR(l)) a.push(CAR(l));
    return a;
};
/* special numbers */
cn1   = SUCC(ZERO);
cn2   = ADD(cn1)(cn1);
cn4   = MUL(cn2)(cn2);
cn16  = POW(cn2)(cn4);
cn256 = POW(cn4)(cn4);

/* numerals up to 255 */
cn  = (function(a){
    var i, j, n, m; 
    for (j = 0, n = ZERO; j < 16; j++, n = SUCC(n)) {
        for (i = 0, m = ZERO; i < 16; i++, m = SUCC(m)){
            a[j*16+i] = ADD(MUL(cn16)(n))(m);
        }
    };
    return a;
})([]);

/* for lazy-k evaluator */
str2cl = function(s){
    var a = [], i, l;
    for (i = 0, l = s.length; i < l; i++) a.push(cn[s.charCodeAt(i)]);
    return ary2cl(a);
};
cl2str = function(l){
    var a = cl2ary(l), i, l, cs = [];
    for (i = 0, l = a.length; i < l; i++){
        cs.push(String.fromCharCode(cn2num(a[i])));
    };
    return cs.join('');
};
/* unlambda to js in string */
ul2jsstr = function(str){
    return (function(a){
        if (!a.length) throw 'syntax error';
        return { s:'S', k:'K', i:'I' }[a.shift()]
            || arguments.callee(a) + '(' + arguments.callee(a) + ')'
    })(str.replace(/[^`ski]/g, '').split(''));
};