- DelphiTools - https://www.delphitools.info -

DWScript September 2012 news: FreePascal, RTTI and lambda syntax

Here is the news summary for September 2012, top new items are initial FreePascal support and introduction of lambdas syntax.

Minor language improvements

FreePascal Support

Latest SVN now compiles under FreePascal 2.7.1, and a fair amount of the unit tests now pass in Windows.

Impacts on Delphi usage:
Limitations in FreePascal:

Hopefully the above limitations will get resolved or worked around in future versions.

RTTI first steps

Initial support for RTTI has been introduced, currently it’s limited to properties and class attributes, and only the low-level storage and interfaces have been defined. If you’re interested, see the unit tests for sample code.

It allows enumerating attributes, getting property types, as well as invoking property getters & setters for simple types.

SmartMobileStudio improvements

And yes, current lambda syntax differs from Oxygene (which uses just ‘->’ with no prefix), we felt the “=>” operator was more readable and more “standard”, the presence of a “lambda” prefix makes them more prominent, and less prone to operator-soup.
There are other advantages, such as parameter-less lambdas (which are not necessarily constants, since they are effectively closures), and the presence of a keyword, which means support for alternative lambda syntax can be added at future times without affecting backward compatibility. I’ll try to discuss these in a future article.

Lambda support will be supported in the script engine later, when it’ll have transitioned from stack-based to closure-based, ad interim, this feature is currently limited to the JavaScript CodeGen and Smart Mobile Studio [1].