Getting Lambdas into OutSystems

Getting Lambdas into OutSystems

  

I know there is going to be massive resistance to this this suggestion, but here we go anyway.

As far as I can tell, we need 3 things to introduce lambdas into OutSystems.

1. Basic inferred typing. Imagine there is an output variable, that if you assigned something to it in the action / function that the systems looks at the assignments and constructs the type correctly. Anywhere you use the function will now have the function's output as this inferred type.

2. The ability to pass functions around as parameters. This will essentially be the analog to delegates in C#.

3. Then finally the ability to have a lambda definition element. It would be similar in the loop element, in that it has an entry, an internal segment and an exit connector. In addition it would have the same inferred result type and the assignments inside of its scope would adjust that result type.

Between these 3 elements we will be able to rebuild the entirety of LINQ for instance inside of OutSystems. I'm presumptuous now, but it should also be fairly simple for OutSystems to implement the above 3 without having to rework the entire compilation structure, their underlying languages already support this kind of thing. Again, probably and incredibly presumptuous statement.

I know functional programming changed my whole way of thinking. It makes coding about the problem and not the structures. The only tech that was more of a productive leap was OutSystems.

We could then further implement things such as lazy evaluation, expression compilation, reactive extensions, etc, etc, etc.

I hope someone plays around with this, it would be an awesome feature. 

Hi Schalk,

Thank you for your suggestions but the appropriate place for them is here:

http://www.outsystems.com/ideas/

How to keep the TrueChange in order?

I understand why you want it, but imho, Outsystems USP is also the reducing the amount of runtime-errors.


J. wrote:

How to keep the TrueChange in order?

I understand why you want it, but imho, Outsystems USP is also the reducing the amount of runtime-errors.


Hi J,

The TrueChange wouldn't be affected. It would allow any changes to the special result variable within the function. Outside of the function it would identify it and not allow access to elements that it doesn't possess.

Passing a function into an action as a parameter would throw TrueChange errors if the types were incompatible. This can be done similar to how C# generics are approached.

I'm not suggesting dynamic typing, I'm suggesting inferred, static typing.


I was into functional programming a decade ago. Anything like this in OS would have my interest.