RemObjects.Elements.RTL.Action not in documentation and conflicting with System.Action

Hi!

I want to be able to cross compile a C# library to .NET and Java. For this reason I’m using RTL. The problem I found is there is definition for Action on https://github.com/remobjects/RTL2/blob/master/Source/List.pas#L136 but it is not documented and there is no more equivalent Action<T1, T2>, Action<T1,T2,T3>, etc.

I think it should be documented and ideally add more definitions.

/Simon

Similar to the other topic, Action really is an implementation detail; cross-platform code should/could just use the language-native delegates for this. Whats you exact use case/scenario?

We have game engine (just the logic) written on pure C# that we then copy over to our Unity game. The engine is developed/debugged on Unity so you can test the changes, debug what is happening inside, etc.

We also need to run this engine on the backend for validation purpose. We store user input and then we pass it to the engine to calculate scores and final result/state.

We want the backend to be written in Java and run on JVM as this our company expertise.

So I need a library that can be run inside Unity, but also cross compile to a JAR that I can consume from Server java code.

that sounds like a really cool project!

what I mean thigh was the use case, code wise, for there actions. For example, our entire Fire/Water codebase is cross-platform C# (.NET and Cocoa, at this stage, originating on Cocoa). it uses callbacks & the like all over the place, but it never ever once use the Action<T> yep directly — it just declares a delegate type, and that works for all platforms.

I suggest doing the same (that said, you can also declare multi-dim’ed Action<T,T2...> overloads yourself if you prefer. I’ll check with the team on Monday whether we coukld/shukd provide those in Cooper.jar

Actually I see we have

Interfaces

Interface
Action
Action1
Action2<T1,T2>
Action3<T1,T2,T3>
Action4<T1,T2,T3,T4>
Action5<T1,T2,T3,T4,T5>
Action6<T1,T2,T3,T4,T5,T6>
Action7<T1,T2,T3,T4,T5,T6,T7>
Action8<T1,T2,T3,T4,T5,T6,T7,T8>

could it be (not sure) that overloading types by generic parameters is not allowed on the JVM, and that we named them like this fir that reason.

But again, these should be implementation details, used internally by the compiler when the code uses blocks/delegates…

Thanks for the follow up. I will keep working on solving compilation issues. I started with more than 300! Now I just reached 40. Many of the reaming ones are Linq related.

1 Like

Looking forward to reports/feedback on those; our LINQ operator coverage might not be 100% complete on the on-.NET platforms (as basically we need to replicate all the APIs), so we might need to sell add some there (contributions welcome: cooper.jar/Source/Linq.pas at master · remobjects/cooper.jar · GitHub :wink: