Documentation issues

This forum is meant for questions and discussions about the X# language and tools
User avatar
Chris
Posts: 5667
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Re: Documentation issues

Post by Chris »

Hi Kees,

That's not a "regular" delegate (which is a definition of a method's parameters and argument types), but an "anonymous" delegate, or anonymous method using the delegate syntax.

I suspect this was a language feature that was introduced earlier in c#, but later a better/cleaner feature was introduced, the one you used with the => operator, which is an anonymous method/lambda expression (creating a piece of code that can be called, without explicitly putting it in a method with a name).

So I think there's no point anymore using the delegate syntax, you can use the anonymous method syntax instead, which does the same thing and is easier to read. You can read some more about this here https://learn.microsoft.com/en-us/dotne ... e-operator
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
User avatar
wriedmann
Posts: 4104
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Re: Documentation issues

Post by wriedmann »

Hi Chris,
I will adjust my wiki accordingly.... Will have to spend some time on it to refresh some code and add new things.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
User avatar
Kees Bouw
Posts: 183
Joined: Wed Nov 06, 2019 11:35 am
Location: Netherlands

Re: Documentation issues

Post by Kees Bouw »

Just for the record: In the X# Help document (menu Help -> XSharp Documentation) there is a topic called "StrToFloat Function". But most of the text and the examples mention only the Val() Function. The tooltip of the StrToFloat() function is also about Val(). On the documentation website at https://www.xsharp.eu/help/index.html the StrToFloat() function can't be found.
User avatar
Chris
Posts: 5667
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Re: Documentation issues

Post by Chris »

Hi Kees,

Not sure why this function even exists, it's an undocumented function in VO, has different parameters than the X# implementation and it is never used at all in the SDK or anywhere else in the runtime.

All it does is to call Val(), so no point using it at all. Not sure if we should add a documentation page for it or simply remove it...
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
User avatar
Kees Bouw
Posts: 183
Joined: Wed Nov 06, 2019 11:35 am
Location: Netherlands

Re: Documentation issues

Post by Kees Bouw »

Hi Chris,

It was my understanding that USUAL's are not "best practise" and that you should avoid using them as much as possible. So I thought it would be useful since StrToFloat() returns a FLOAT instead of USUAL.

Kees.
User avatar
Chris
Posts: 5667
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Re: Documentation issues

Post by Chris »

Hi Kees,

That's true, but in this case it's just cheating :)



StrToFloat() might return a FLOAT, but it is actually calling Val() which returns a usual already and then this is converted to a float. So in this particular case, by using StrToFloat() you are only adding an extra implicit conversion and gain nothing at all.
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
User avatar
robert
Posts: 5068
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Re: Documentation issues

Post by robert »

Guys,
This is indeed an internal function. I will remove the docs from the help file for the next build

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
Post Reply