[Harbour] :__enumIndex() revisited
Szakáts Viktor
harbour.01 at syenar.hu
Wed Sep 26 08:10:52 EDT 2007
Hi Przemek,
On 2007.09.26., at 13:27, Przemyslaw Czerpak wrote:
> On Wed, 26 Sep 2007, Szakáts Viktor wrote:
>>> Of course we can add to Harbour support for HB_QWITH( [<nLevel>] )
>>> into XHB library (AFAIR xHarbour does not support <nLevel>
>>> parameter)
>>> and also for HB_RESETWITH() and HB_WITHOBJECTCOUNTER(). It's
>>> possible
>>> to also implement HB_SETWITH() though this function cannot be easy
>>> implemented without touching compiler code because it directly
>>> allocates/remove items on HVM stack. Anyhow it's potentially
>>> very dangerous functions which allow to make some very bad things
>>> in xHarbour so I do not think it's good idea to add it.
>> Please don't, these extensions don't look very good.
>
> Ups. too late I've already added to XHB library HB_QWITH
> ( [<nLevel>] ),
> HB_RESETWITH() and HB_WITHOBJECTCOUNTER() and committed. In summary
> if XHB should be xHarbour compatible layer then why not. I've seen
> that Miguel is porting to xHarbour unlimited FOR EACH and WITH OBJECT
> so I think it may help him too.
No problem at all, this is exactly why we have xhb lib :)
Thanks for the commit.
> I haven't added HB_SETWITH() because as I said it was not normal
> function,
> and without touching compiler code it couldn't be easy implemented.
> It's possible but it will be necessary to make some direct
> modifications
> in HVM stack to change some offsets and move few items. Support for
> HB_SETWITH() in compiler is trivial and will not take more then few
> lines but for sure I do not want to have such function in core code.
> xHarbour uses HB_SETWITH() in few places as storage stack for
> temporary
> variables so in most case code which uses it can be updated to use
> some functions like: HB_PUSH(), HB_POP(), HB_TOP() which will use
> internally some stack hold in array inside static variable.
Okey, I'd vote not to touch Harbour core this time.
Brgds,
Viktor
More information about the Harbour
mailing list