> > 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 :-).) > > When I started reading this thread, APL's "index origin" came > immediately to mind. But in this case I find a REXX "astonishment > factor" -- not in its behaviour, but in that its author would agree > with and even propose something I imagined would be shot down in > moments. Instead, everyone seems to like it! > > APL started with a global index origin, settable only as an overall > and external attribute of a workspace, and not capable of being set or > interrogated by the running program. This soon changed, but I believe > in most implementations it was/is still a global value not related to > any concept of package, or at least not to any package smaller than > the entire workspace.
That's the difference in what I was proposing ... the changeable index would be relate to and affect only to the particular package (for which the documentation, we are told, uses 0-indexing). Definitely not a global setting, and definitely not changing Rexx's inherent indexing (in, for example, the built-in functions such as POS or WORD). I agree the latter would be disasterous ... 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
