Discussion:
Block methods and extended codeblock
Juan Gálvez
2009-03-13 17:28:58 UTC
Permalink
Hi,

I think extended codeblocks don't work inside block methods and I wonder if
it's a well-known and expected behavior.

CLASS MyClass
...
METHOD lMyMethod( xArg ) BLOCK <|Self, xArg|
...
RETURN .T.
...
END CLASS

Best regards
Juan
Przemyslaw Czerpak
2009-03-13 18:19:03 UTC
Permalink
On Fri, 13 Mar 2009, Juan Gálvez wrote:

Hi,
Post by Juan Gálvez
I think extended codeblocks don't work inside block methods and I wonder if
it's a well-known and expected behavior.
CLASS MyClass
...
METHOD lMyMethod( xArg ) BLOCK <|Self, xArg|
...
RETURN .T.
...
END CLASS
I think they work. It's enough to use extended codeblocks ;-)
{||
...
RETURN .T.
}
not:
<||
....
best regards,
Przemek
Juan Gálvez
2009-03-16 09:08:28 UTC
Permalink
Hi Przemek,

You're right. It works.

My fault is I thought hbcompat.ch would make the work and it seems it
doesn't make it.

Why ?

Many thanks
Juan

----- Original Message -----
From: "Przemyslaw Czerpak" <druzus-***@public.gmane.org>
To: "Harbour Project Main Developer List." <harbour-pG8skwman+OtlBvVaVFjCkB+***@public.gmane.org>
Sent: Friday, March 13, 2009 7:19 PM
Subject: Re: [Harbour] Block methods and extended codeblock
Post by Przemyslaw Czerpak
Hi,
Post by Juan Gálvez
I think extended codeblocks don't work inside block methods and I wonder if
it's a well-known and expected behavior.
CLASS MyClass
...
METHOD lMyMethod( xArg ) BLOCK <|Self, xArg|
...
RETURN .T.
...
END CLASS
I think they work. It's enough to use extended codeblocks ;-)
{||
...
RETURN .T.
}
<||
....
best regards,
Przemek
_______________________________________________
Harbour mailing list
http://lists.harbour-project.org/mailman/listinfo/harbour
__________ Informacin de ESET NOD32 Antivirus, versin de la base de firmas
de virus 3937 (20090314) __________
ESET NOD32 Antivirus ha comprobado este mensaje.
http://www.eset.com
Przemyslaw Czerpak
2009-03-16 11:45:14 UTC
Permalink
Post by Juan Gálvez
Hi Przemek,
You're right. It works.
My fault is I thought hbcompat.ch would make the work and it seems it
doesn't make it.
Why ?
Because in your example PP has to know about extended codeblocks before it
begins any translations so before hbcompat.ch rules are applied. Translation
for xHarbour like extended codeblock syntax <|| ... > is not fully functional
and cannot be by definition when used at PP level. In code like:
? <||
return "Hello"
Post by Juan Gálvez
:eval()
PP have to take three lines of code:
<||
return "Hello"
Post by Juan Gálvez
:eval()
before it begins to make ? <exp,...> translation and because it does not
know it's extended codeblock then it doesn't do that.

best regards,
Przemek
Juan Gálvez
2009-03-16 11:56:11 UTC
Permalink
Hi Przemek,

Many thanks for explanations.

Best regards
Juan

----- Original Message -----
From: "Przemyslaw Czerpak" <druzus-***@public.gmane.org>
To: "Harbour Project Main Developer List." <harbour-pG8skwman+OtlBvVaVFjCkB+***@public.gmane.org>
Sent: Monday, March 16, 2009 12:45 PM
Subject: Re: [Harbour] Block methods and extended codeblock
Post by Przemyslaw Czerpak
Post by Juan Gálvez
Hi Przemek,
You're right. It works.
My fault is I thought hbcompat.ch would make the work and it seems it
doesn't make it.
Why ?
Because in your example PP has to know about extended codeblocks before it
begins any translations so before hbcompat.ch rules are applied. Translation
for xHarbour like extended codeblock syntax <|| ... > is not fully functional
? <||
return "Hello"
Post by Juan Gálvez
:eval()
<||
return "Hello"
Post by Juan Gálvez
:eval()
before it begins to make ? <exp,...> translation and because it does not
know it's extended codeblock then it doesn't do that.
best regards,
Przemek
_______________________________________________
Harbour mailing list
http://lists.harbour-project.org/mailman/listinfo/harbour
__________ Informacin de ESET NOD32 Antivirus, versin de la base de firmas
de virus 3938 (20090316) __________
ESET NOD32 Antivirus ha comprobado este mensaje.
http://www.eset.com
Loading...