[newbie] Dandelion 0.3 problems?

Masashi Umezawa umejava at mars.dti.ne.jp
Thu Jul 22 15:06:12 UTC 1999


Hi John,

Thanks for downloading Dandelion.

> When I try to run Example1, I get a "Subscript is out of bounds" error with
> the following traceback:
> 
>   String(Object)>>error:
>   String(Object)>>errorSubscriptBounds:
>   String(Object)>>at:
>   String>>at:
>   String>>at:
>   String>>findSubstring:in:startingAt:matchTable:
>   String>>findString:startingAt:
>   Text>>findString:startingAt:
>   [] in DlDynamicVariableIntrospector>>canInstantiate:by:
>   [] in Array(Collection)>>detect:ifNone:


Oh, I see the problem. ;->

By default, Dandelion will infer types of variables rather aggressively. 
Actual work is done by DlDynamicVariableIntrospector.

DlDynamicVariableIntrospector tries to create an instance of a target
class for type inference. To avoid  unexpected errors,
DlDynamicVariableIntrospector checks the code (i.e. #new or #basicNew
implementation) and judges the possibility of safe instantiation.

The error you mentioned occurred in the process.

Unfortunately, the current version of Dandelion can not check the code
completely. According the target class's #new implementation, it
sometimes causes problems. It is only an ad hoc implementation. 

I believe exception handling mechanism is definitely needed for the safe
instantiation. However, at present, Dandelion does not (cannot) use the
exception handling. (I am longing for the time the ANSI standard
exception handling to be formally supported in Squeak.) 

So current solution is simply disabling the
DlDynamicVariableIntrospector in some cases.

To disable the DlDynamicVariableIntrospector, you can do as follows:

	| dandelion |
	dandelion := DlDandelionSystem new.
	dandelion analysisStrategy setProperties:
{#useDynamicVariableIntrospector->false}.
	dandelion analyze: 
		(SystemOrganization categories select: [:each | 'Dandelion-*' match:
each]).
	dandelion output.


> When I try to run Example2, I get the dialog box and then "Message not
> understood: width", with the following traceback:
> 

The second error is an aftermath of the first error.
Dandelion uses original event system. When the output process is
interrupted by some error, event listeners are left unreleased and may
cause troubles. (Again automatic release will be done by exception
handling...)

In such situation, you have to explicitly initialize the Dandelion event
server by evaluating: 

	DlEventServer default initialize.

> After applying patch1 and patch2, I skipped the subscript error in
> Example1, but then it died with the now infamous "width error."  Example2
> died with the subscript error.  The remaining examples bombed out with
> "width error."

I think patch1 and patch2 are only minor bug fixes and not directed to
the error you encountered.

Please try disabling the DlDynamicVariableIntrospector and resetting the
event system.

Regards,

P.S.
The next Dandelion(ver 0.4) will support change set analysis and simple
XML output.

---
[:masashi | ^umezawa]





More information about the Squeak-dev mailing list