[Pharo-dev] The Second Coming of Java article

Sven Van Caekenberghe sven at stfx.eu
Mon Nov 25 17:48:04 EST 2013


Hi Jan,

On 25 Nov 2013, at 22:47, Jan Vrany <jan.vrany at fit.cvut.cz> wrote:

> Here's the code that parses XML using Xerces on VM that
> runs both Smalltalk and Java:
> 
> =======================
> factory := JAVA javax xml parsers SAXParserFactory newInstance.
> parser := factory newSAXParser getXMLReader.
> parser setContentHandler: JavaExamples::CDDatabaseHandler2 new.
> [
>    parser parse: build_xml.
> ] on: JAVA java io IOException do:[:ioe|
>    Transcript showCR: 'I/O error: ', ioe getMessage.
>    ioe printStackTrace
> ] on: UserNotification do:[:un|
>    Transcript showCR: un messageText.
>    un proceed.
> ]
> =======================

This is really nice and beautiful code. Very well done !

Sven




More information about the Pharo-dev mailing list