[Pas2js] Next language feature for pas2js...

Sven Barth pascaldragon at googlemail.com
Fri Apr 27 21:49:17 CEST 2018


Am 27.04.2018 um 14:49 schrieb Michael Van Canneyt:

>
>
> On Fri, 27 Apr 2018, warleyalex via Pas2js wrote:
>
>> I'm quite confident our mORMot suits better with the free open source 
>> Pas2JS
>> FPC based project.
>
> I never was a big fan of mORMot. Way too complicated for beginners. 
> Not RAD at all.
>
> I'm currently converting a big project for a client that uses mORMot 
> to something else which is less obtuse and fragile. Now I'm even less 
> of a fan than before.
>
> As for features:
>
> Anonymous functions may be coming, since it seems to be in rather 
> popular demand.
>
> Lambda: not anytime soon. If we implement that, it should be delphi/FPC
> compatible. Neither of them have it, so...

Lambdas would merely be a syntactic sugar for anonymous functions with a 
bit of type inference sprinkled in. E.g. something like the following:

=== code begin ===

DoSomethingWithFunc(lambda (x, y) as x * y);

// as anonymous function:

DoSomethingWithFunc(function(x, y: LongInt): LongInt; begin result := x 
* y; end);

=== code end ===

The backing functionality for lambda's is already part of anonymous 
functions.

Regards,
Sven


More information about the Pas2js mailing list