From a programmer standpoint, what *is* IGOR? Is it some type of faster parser to crank through the assistant's functions, or is it something different? -Sanj

Basically, IGOR leaves the parsing up to the programmer instead of the system. IGOR checks the intelligent assistant phrase to see if an IGOR registered keyword is found. If it is found then the whole phrase is sent to the program that registered the keyword. This gives two advantages:

For example with IGOR and Writer's Calc installed you can create long math expressions in the notepad and tap Assist and have it process it in under 0.5 seconds.

Here is a piece of one of my programs. The install and remove scripts register and unregister with IGOR. The PostIgor is sent to the package that registers with IGOR.

DEFCONST('kAIAction, // the template for registering with IA
{
	name: "Inline Action",
	isa: 'dyna_user_action,
	lexicon: [      
		LocObj("",'lexicon.calc),
		LocObj("",'lexicon.equal),
		LocObj("",'lexicon.about),
		],
});
   
DEFCONST( 'kTaskTemplate, // used by IA. See InstallScript in Project Data
{ 
	value: "Inline Action", 
	isa: 'task_template, 
	primary_act: kAIAction, 
	preconditions: ['action], 
	signature: [kAIAction], 

	// The post parse method is called as a method of the taskTemplate
	// It calls an application method with the taskTemplate as a parameter.
	postParse: func() 
	begin 
		// calling the same function as IGOR will to
		// process the data. (You don't have to do that)
		GetRoot().(kAppSymbol):PostIgor(self.origPhrase);
	end,
});
	 
DEFCONST( 'kPostParse,
{
	postIgor: func(puPhrase)	// IGOR will call this function
	begin
	 // puPhrase will be the unprocessed string if sent from IGOR	  

	 // do your IA stuff
	 print(puPhrase);
	
	 GetRoot().assistant:?Close()   // close the IA slip
	
	end, 
});

InstallScript := func( partFrame, removeFrame )
begin

	GetRoot().(EnsureInternal(kAppSymbol)) := kPostParse;

	// for IA
	removeFrame.taskTemplateID := RegTaskTemplate( kTaskTemplate );
	
	// for Igor
	if NOT GetGlobals().igor
	then
		getGlobals().(EnsureInternal('igor)) := {};
	getGlobals().igor.(EnsureInternal(kAppSymbol)) := kAIAction.lexicon;
end;

RemoveScript := func( removeFrame )
begin

	if GetRoot().(kAppSymbol) exists
	then
		RemoveSlot(GetRoot(),kAppSymbol);

	// for IA
	if removeFrame.taskTemplateID then begin
		 UnRegTaskTemplate( removeFrame.taskTemplateID );
		 removeFrame.taskTemplateID := nil;
	end;
	
	// for Igor
	RemoveSlot(getGlobals().igor,kAppSymbol);

end;

Return to : Catamount Software's Home Page

Send comments to: info@catamount.com

(last modified : May 12, 1996)