> I am working on an ooRexx interface to something that is normally 
> programmed in C. Of course, C uses zero-based indexes for thing like 
> memory, array positions, etc. My code could be architected to either 
> carry this forward to the ooRexx interface when it calls the C functions 

> or it could translate the zero-based numbers to the more user friendly 
> (and Rexx default) one-based numbering system.

There is a third path that one might consider, if it makes sense (in 
particular, the package needs to have some kind of persistent state, or 
able to get at some from the Rexx implementation), and that is: let the 
user choose.

APL (I think it was) does this: essentially when starting to write a 
program using the package, you set a flag (to 0 or 1, perhaps) saying 
whether to use 0-based or 1-based indexing, according to preference.  The 
package then adjusts all indexes as requested.

You still have to decide what the default should be (unless not specifying 
is an error), but that's a much easier (read: less stressful) decision if 
there's a way to override it.   (I'd agree with Chip on what the default 
should be :-).)

Mike






Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 
741598. 
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU







------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Oorexx-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oorexx-devel

Reply via email to