fbpx
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: typed codeblocks in predicates

typed codeblocks in predicates 2 weeks 4 days ago #10966

  Wolfgang Riedmann's Avatar Topic Author Wolfgang Riedmann Away Posts: 1799
Hi,

using the X# runtime and VO dialect, I have thiscode:
using System.Collections.Generic

class SyntaxCmpletion
protect _oList as List<Exception>

constructor()
   _oList := List<Exception>{}
   return

method CheckSyntax( cMessage as string ) as Exception
   local oResult			as Exception

   oResult := _oList:Find( {| o as Exception | o:Message == cMessage } )

  return oResult
end class

Should that compile?
Using the C# syntax it compiles:
oResult := _oList:Find( { o as Exception => o:Message == cMessage } )

With the codeblock syntax the compiler gives the following message:
error XS9057: Typed parameters in codeblocks are not supported by the (Vulcan) runtime.
even if I use the X# runtime.

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy

www.riedmann.it - docs.xsharp.it

Please Log in or Create an account to join the conversation.

typed codeblocks in predicates 2 weeks 4 days ago #10967

  Robert van der Hulst's Avatar Robert van der Hulst Away Posts: 1244
Wolfgang
For now you have to use the Lambda expression syntax in these cases.
Typed codeblocks are on our todo list.

Robert
XSharp Development Team
The Netherlands

Please Log in or Create an account to join the conversation.

typed codeblocks in predicates 2 weeks 3 days ago #10970

  Wolfgang Riedmann's Avatar Topic Author Wolfgang Riedmann Away Posts: 1799
Hi Robert,

that is ok - wasn't sure if it was an error or a todo. Therefore I preferred to aks before adding a ticket (and this was an issue I've encountered several times before in other occasions).
The important thing for me is that I have a way to go forward (and I have that).

Wolfgang
P.S. I'm currently working on a production capacity planning system in 100% X# and WPF, but most of the data comes from a DBF based VO application
Wolfgang Riedmann
Meran, South Tyrol, Italy

www.riedmann.it - docs.xsharp.it

Please Log in or Create an account to join the conversation.

  • Page:
  • 1