[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-smalltalk] Using Smalltalk as a scripting language

From: Paolo Bonzini
Subject: Re: [Help-smalltalk] Using Smalltalk as a scripting language
Date: Wed, 28 Oct 2009 10:24:19 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20091014 Fedora/3.0-2.8.b4.fc11 Lightning/1.0pre Thunderbird/3.0b4

On 10/28/2009 03:25 AM, Roland Plüss wrote:
- void showBacktrace( FILE* ):
This function is mentioned in the documentation at the website but does
not exist in gstpub.h . It sounds to me like this function could be used
to print out errors if there is a problem in the scripts somewhere, is
that right? Is this also one of the new functions not found in the
smalltalk version I have?

All of them are.

If not what is the preferred way to handle
errors? hijacking #doesNotUnderstand in the Object class ( including
#halt and company )?

Hijacking SystemExceptions.UnhandledException>>#defaultAction sounds better.

Even better would be to define #debuggerClass in the superclasses that your scripts are supposed to subclass. The #debuggerClass will be sent the class method #open:.

- testing for nil:
I want for example test if a given class exist. I do
gst_class_name_to_oop( "AppTest" ) for example. Now assuming the class
does not exist does this call return nilOOP? If so how do I properly
test for nilOOP? Using objectIsKindOf (OOP, OOP)? ( asking since in the
docs it's mentioned that IS_NIL macro is deprecated )

You can test "x == gst_interpreter_proxy.nilOOP". You can of course define your own IS_NIL macro. However gst_class_name_to_oop returns NULL (not nil) if the class is not found; I'll update the docs.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]