Introducing WordList as a new NetRexx Type

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Introducing WordList as a new NetRexx Type

ThSITC
Hello there,

     I'm currently thinking (*and implementing*), a new type called
'WordList' in NetRexx.

basics are:

class WordList EXTENDS Rexx (SIC, possible now due to Kermit Kiser's
enhancements in after 3.01)
...
class myclass USES Wordlist
verbs=WordList('IF THEN ELSE DO LOOP ...')  --just  as a sample (the
WordList of NetRexx Verbs), the CONSTRUCTOR

Now, at the call of the CONSTRUCTOR, this WordList is SPILT into a so
called *corresponding Java String Array*.

Whenever the WordList value (actually the WordList Java Object) changes,
the String array is re-built.

The methods wordpos, words, etc of Wordlist do OVERRIDE the ones of
class Rexx, but do use
the already SPLITTED String Array.

Also, for convenience, the respective FUNCTIONS (static methods) are
provided, with same parameter sequence
as the corresponding Classic Rexx / ooRexx BUILTIN Funcions.

The trick is (and will be) to SPILT the WordList value *ony when it
changes* to the proper String array.
As both Java Strings and Rexx Strings are *immutable*, this is a very
easy task. :-)

As Alan Harper's sample did show, there will be a heavy performance
increase (in the order of 10 times), when walking
multiple times thru the same WordList! :-)

What do you say?
Thomas Schneider.


Thomas Schneider (Founder of www.thsitc.com) Member of the Rexx Languge
Asscociation (www.rexxla.org) Member of the NetRexx Developer's Team
(www.netrexx.org)

_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Thomas Schneider, Vienna, Austria (Europe) :-)

www.thsitc.com
www.db-123.com