ftp.nice.ch/pub/next/developer/resources/libraries/libcoll.940725.s.tar.gz#/libcoll-940725/checks/test02.m

This is test02.m in view mode; [Download] [Up]

#include <coll/coll.h>


int main()
{
  id dict = [[Dictionary alloc] initEncoding:"*"
	     keyEncoding:"*"];
  id translator = [[Dictionary alloc] initEncoding:"*"
		   keyEncoding:"*"];
  id mc;

  [dict putElement:"herd" atKey:"cow"];
  [dict putElement:"pack" atKey:"dog"];
  [dict putElement:"school" atKey:"fish"];
  [dict putElement:"flock" atKey:"bird"];
  [dict putElement:"pride" atKey:"cat"];
  [dict putElement:"gaggle" atKey:"goose"];
  [dict printForDebugger];
  printf("removing goose\n");
  [dict removeElementAtKey:"goose"];
  [dict printForDebugger];

  [translator putElement:"cow" atKey:"vache"];
  [translator putElement:"dog" atKey:"chien"];
  [translator putElement:"fish" atKey:"poisson"];
  [translator putElement:"bird" atKey:"oisseau"];
  [translator putElement:"cat" atKey:"chat"];

  mc = [[MappedCollector alloc] initCollection:dict map:translator];
  [mc printForDebugger];

  [mc free];
  [dict free];
  [translator free];

  exit(0);

}


These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.