Entries from 2011-01-01 to 1 month
ということでobjc用のコンテナっぽいもの書いてみました。 https://gist.github.com/783682 単に眠れなかっただけですが。 NSLog(@"%@",CONS( nil, nil )); NSLog(@"%@",CONS( @"hoge", nil )); NSLog(@"%@",CONS( @"hoge", @"hogehoge" )); NSLog(@"%@",CON…
こういう事なのかなと。 #include <iostream> using namespace std; class Test { public: void Func1() { cout << "Func1" << endl; } void Func2() { cout << "Func2" << endl; } void Exec( void (Test::*hoge)() ) { (this->*hoge)(); } }; void TestFunc() { Test</iostream>…
http://www.aoky.net/articles/peter_norvig/lispy.htm を参考にObjective-Cで書いてみました。https://github.com/narumij/Lispective-C Lispective.c>(define fact (lambda (n) (if (zerop n) 1 (* n (fact (- n 1)))))) Lispective.c>(fact 5)) => 120 Li…
試しにnilを返すだけのBlocksでハマリ。 id (^aBlock)(NSArray *); aBlock = ^(NSArray *args){id result=nil;return result;}; // OK aBlock = ^(NSArray *args){return nil;}; // NG なんか型に厳しくてC++覚えはじめの頃みたいだ。return value typeをexp…