Phil, Ask Przemek to test:
//---------------------------------------------------// MEMVAR GetList, MyGetList PROCEDURE Main() SAVE TO Test ALL LIKE None RESTORE FROM Test ? GetList ? MyGetList RETURN INIT PROCEDURE SetMyGetList PUBLIC MyGetList := "MyGetList" RETURN //---------------------------------------------------// This is only one of the tests I ran, and as I reported I encountered few inconsistent results, or results I could not make sense of. AFAICT from my tests Clipper does have some sort of protection specifically for GetList. Ron -------------------------------------------------- From: "Phil Krylov" <p...@newstar.rinet.ru> Sent: Wednesday, March 11, 2009 10:01 AM To: "Xharbour-Developers List" <xharbour-developers@lists.sourceforge.net>; "Ron Pinkas" <ron.pin...@xharbour.com> Subject: Re: [xHarbour-developers] Upper() and codepage. > Hi, > > I'm forwarding a message from Przemek on this matter. > > ---------- Forwarded message ---------- > From: Przemyslaw Czerpak <dru...@acn.waw.pl> > Date: Wed, Mar 11, 2009 at 4:01 PM > Subject: Re: [xHarbour-developers] Upper() and codepage. > To: Phil Krylov <p...@newstar.rinet.ru> > > > On Wed, 11 Mar 2009, Phil Krylov wrote: >> > In my test, Clipper did NOT optimize at all, >> > Upper()/Lower()/Asc()/Chr(). >> > Here is my simple test: >> > PROCEDURE Main() >> > LOCAL c1 := Upper( "Hello" ), c2 := Lower( "World" ) >> > LOCAL c3 := Chr( 65 ) >> > LOCAL n1 := Asc( "A" ) >> add here: c3 := Upper("hello2" + Chr(97)) >> > ? c1, c2, c3, n1 >> > RETURN >> By observing the obj file, you can find the string "HELLO3A", so it >> looks like Clipper does not optimize Upper in LOCAL declarations, but >> optimizes the non-LOCAL occurence. (and optimizes Chr there. However, >> I can't easily read Clipper PCODE from binary files and so can't tell >> if Chr is optimized in LOCAL declarations.). >> As for the LOWER, AFAIR it was never optimized. > > In Clipper in few places programmers forgot to add call to > expression_reduce() or similar function which in Clipper > reduce expressions. > One of such places is expression used for LOCAL initialization but > there are also others like object expression when method is sent: > <objExp> : msg() > <objExp> is not optimized. Make some tests and you will find also > others non optimized expressions. > Try this example: > > PROCEDURE Main() > LOCAL l1 := Upper( "Hello" ) > LOCAL l2 := Lower( "World" ) > LOCAL l3 := Chr( 65 ) > LOCAL l4 := Asc( "A" ) > LOCAL l5 := 1 == 1 > > ? l1, l2, l3, l4, l5 > > l1 := Upper( "Hello" ) > l2 := Lower( "World" ) > l3 := Chr( 65 ) > l4 := Asc( "A" ) > l5 := 1 == 1 > > ? l1, l2, l3, l4, l5 > > RETURN > > > For optimization tests I suggest to use static initialization, f.e.: > proc main() > static s := upper( "abc" + chr( 122 ) ) > ? s > return > > If you remove UPPER() optimization xHarbour will not be able to compile > above code. > > > BTW the recent modifications for RESTORE FROM * are also wrong. > Here is the example which illustrates that it's general memvar > clear issue and how it should work with getlist overloaded by > private variable. > > memvar getlist > proc main() > getlist:="public:getlist" > ? getlist > private getlist:="private:getlist" > ? getlist > CLEAR MEMORY > ? getlist > return > > Compile it with Clipper or current Harbour to see expected results. > Then try xHarbour. > > best regards, > Przemek > > > > -- > С уважением, > Филипп Крылов. > ------------------------------------------------------------------------------ Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are powering Web 2.0 with engaging, cross-platform capabilities. Quickly and easily build your RIAs with Flex Builder, the Eclipse(TM)based development software that enables intelligent coding and step-through debugging. Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com _______________________________________________ xHarbour-developers mailing list xHarbour-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xharbour-developers