libs-base/Testing/test02.m

42 lines
1 KiB
Mathematica
Raw Normal View History

#include <base/all.h>
#include <Foundation/NSAutoreleasePool.h>
int main()
{
NSAutoreleasePool *arp = [NSAutoreleasePool new];
id dict = [Dictionary new];
id translator = [Dictionary new];
id mc;
[dict putObject:@"herd" atKey:@"cow"];
[dict putObject:@"pack" atKey:@"dog"];
[dict putObject:@"school" atKey:@"fish"];
[dict putObject:@"flock" atKey:@"bird"];
[dict putObject:@"pride" atKey:@"cat"];
[dict putObject:@"gaggle" atKey:@"goose"];
[dict printForDebugger];
printf("removing goose\n");
[dict removeObjectAtKey:@"goose"];
[dict printForDebugger];
[translator putObject:@"cow" atKey:@"vache"];
[translator putObject:@"dog" atKey:@"chien"];
[translator putObject:@"fish" atKey:@"poisson"];
[translator putObject:@"bird" atKey:@"oisseau"];
[translator putObject:@"cat" atKey:@"chat"];
mc = [[MappedCollector alloc] initWithCollection:dict map:translator];
[mc printForDebugger];
[mc release];
[dict release];
[translator release];
[arp release];
exit(0);
}