xsharp.eu • using the Extended Method 'Union' ... help ? - Page 2
Page 2 of 2

using the Extended Method 'Union' ... help ?

Posted: Thu Jan 26, 2017 5:18 pm
by robert
Phil,

These is a topic X# keywords in the help file. (Under X# Language Reference)

Robert

using the Extended Method 'Union' ... help ?

Posted: Thu Jan 26, 2017 8:21 pm
by Phil Hepburn
Okay Robert,

Thanks, I have all the documentation sufficient for the moment, and a bit more perhaps ;-0)

Tomorrow is another day - now the soccer, Man United trying to get to the final round of the League Cup.

Cheers,
Phil.

using the Extended Method 'Union' ... help ?

Posted: Thu Jan 26, 2017 9:55 pm
by Phil Hepburn
Okay Robert,

Thanks, I have all the documentation sufficient for the moment, and a bit more perhaps ;-0)

Tomorrow is another day - now the soccer, Man United trying to get to the final round of the League Cup.

Cheers,
Phil.

using the Extended Method 'Union' ... help ?

Posted: Fri Jan 27, 2017 10:48 am
by Frank Maraite
Hi Robert,

is there really no better solution for that kind of issues?

The word 'union' is clearly used as a method call. Why does it conflict with a reserved word? Should the error message say more about this reason?

Many reserved word are the cost of the verbose XBase language, but leads to issues like this.

Frank

using the Extended Method 'Union' ... help ?

Posted: Fri Jan 27, 2017 11:21 am
by Phil Hepburn
Hi Frank, Chris and Robert,

Particularly since it is only the second occurrence of 'Union' which causes an issue.

See attached image :-
ChrisUnion_41.jpg
ChrisUnion_41.jpg (24.3 KiB) Viewed 536 times
Line 143 appears to work OK !?

And this is reinforced by the blue colouration only appearing on the second occurrence of 'Union' - see below :-
ChrisUnion_42.jpg
ChrisUnion_42.jpg (26.91 KiB) Viewed 536 times
This code does not compile.

I suppose I should have twigged (noticed) what was going on - BUT - because of an earlier case of LINQ query syntax not seeming to colour correctly in my version of VS 2017, I just got on with things and started to ignore all various colouration of the text and command words.

For some reason the current pre-compiler seems to see the two Unions in a different light / way.

Any sort of improvement will certainly be a help - I realise you are juggling a lot of balls in the air, but then you and the Team are 'Magic' !!!! So that's what we expect ;-0)

Cheers,
Phil.

using the Extended Method 'Union' ... help ?

Posted: Fri Jan 27, 2017 2:09 pm
by robert
Frank Maraite wrote:Hi Robert,

is there really no better solution for that kind of issues?

The word 'union' is clearly used as a method call. Why does it conflict with a reserved word? Should the error message say more about this reason?

Many reserved word are the cost of the verbose XBase language, but leads to issues like this.

Frank
Some reserved words are also allowed as identifier. Union is not. At this moment UNION is in our 'VO keywords' list which is not allowed as identifier. You will have to prefix Union with @@ to make this work.,

I will move Union to the list of keywords that can be used as identifier, as well as Event (which is often used in VO event handler code).
Any other suggestions ?

Robert

using the Extended Method 'Union' ... help ?

Posted: Fri Jan 27, 2017 2:58 pm
by wriedmann
Hi Robert,
I will move Union to the list of keywords that can be used as identifier, as well as Event (which is often used in VO event handler code).
Any other suggestions ?
I would like INSTANCE and maybe FIELD, if possible.

Wolfgang

using the Extended Method 'Union' ... help ?

Posted: Mon Jan 30, 2017 3:58 pm
by Otto
Robert van der Hulst wrote:Some reserved words are also allowed as identifier. Union is not. At this moment UNION is in our 'VO keywords' list which is not allowed as identifier. You will have to prefix Union with @@ to make this work.,

I will move Union to the list of keywords that can be used as identifier, as well as Event (which is often used in VO event handler code).
Any other suggestions ?

Robert
Does the problem disappear if the code is case sensitive? UNION as keyword, Union as method.

using the Extended Method 'Union' ... help ?

Posted: Mon Jan 30, 2017 4:16 pm
by robert
Otto,
Otto Christiaanse wrote:
Robert van der Hulst wrote:Some reserved words are also allowed as identifier. Union is not. At this moment UNION is in our 'VO keywords' list which is not allowed as identifier. You will have to prefix Union with @@ to make this work.,

I will move Union to the list of keywords that can be used as identifier, as well as Event (which is often used in VO event handler code).
Any other suggestions ?

Robert
Does the problem disappear if the code is case sensitive? UNION as keyword, Union as method.
Yes case sensitivity would make things much easier.
However this problem will be solved anyway in the version of X# that will be released this week. I have moved the following keywords to the list of keywords that can also be used as identifiers:

ALIGN, CALLBACK, CLIPPER, DECLARE, DEFINE, DELEGATE, DIM, DOWNTO, DLLEXPORT,
ENUM, EVENT, FASTCALL, FIELD, FUNC, GLOBAL, IN, INHERIT, INSTANCE, INTERFACE,
OPERATOR, PASCAL, PROC, PROPERTY, SEQUENCE, STEP, STRICT, STRUCTURE, THISCALL,
UNION, UNTIL, UPTO, USING, VOSTRUCT , WINCALL

This may lead to confusion when typing, especially if you trust the colors inside the editor.
For example: if you start typing the keyword FUNC
func1.png
func1.png (4.73 KiB) Viewed 536 times

Then it will be black (identifier) but after you add the name of the function then it will become Blue
func2.png
func2.png (12.06 KiB) Viewed 536 times
Some keywords are difficult to be allowed as identifier, because they appear alone on a line and the parser will not know if the word TRY on a line means the beginning of a try statement or a variable with the name TRY.

using the Extended Method 'Union' ... help ?

Posted: Tue Jan 31, 2017 11:54 am
by Phil Hepburn
Well guys,

As ever, Robert is true to his word and version 2.9 of the compiler seems to solve my 'Union' problem / issue.

Take a look at what now compiles and runs in my developing LINQ app - line 179 is where the BIG change has occurred :-
RvdH_errors_21.jpg
RvdH_errors_21.jpg (36.35 KiB) Viewed 536 times
We no longer need a prefix of '@@' for 'Union', and we get no blue colouration either, which previously showed that the parser was seeing the second 'Union' as a keyword, rather than a method name.

Well done TEAM - onwards and upwards ............

Best regards,
Phil.
Wales, UK.