Release of the PascalABC.NET 3.8 development environment

The release of the PascalABC.NET 3.8 programming system is available, offering an edition of the Pascal programming language with code generation support for the .NET platform, the ability to use .NET libraries and additional features such as generic classes, interfaces, operator overloading, Ξ»-expressions, exceptions, garbage collection, extension methods, unnamed classes, and autoclasses. The project is mainly focused on education and research applications. The package also includes a development environment with code hints, auto-formatting, a debugger, form designer, and code samples for beginners. The project code is distributed under the LGPLv3 license. It is possible to build on Linux (based on Mono) and Windows.

Changes in the new release:

  • Added support for slices of multidimensional arrays begin var m := MatrByRow(||1,2,3,4|,|5,6,7,8|,|9,10,11,12||); println(m[:,:]); // [[1,2,3,4],[5,6,7,8],[9,10,11,12]] Println(m[::1,::1]); // [[1,2,3,4],[5,6,7,8],[9,10,11,12]] Println(m[1:3,1:4]); // [[6,7,8],[10,11,12]] Println(m[::2,::3]); // [[1,4],[9,12]] Println(m[::-2,::-1]); // [[12,11,10,9],[4,3,2,1]] Println(m[^2::-1,^2::-1]); // [[7,6,5],[3,2,1]] Println(m[:^1,:^1]); // [[1,2,3],[5,6,7]] Println(m[1,:]); // [5,6,7,8] Println(m[^1,:]); // [9,10,11,12] Println(m[:,^1]); // [4,8,12] end.
  • Added lambda expressions with unpacking parameters that are tuples or sequences. Now it is possible to give names to tuple elements directly in lambda parameters. To unpack the tuple parameter t into the variables x and y, use the notation \\(x,y). This is one parameter, unlike the (x,y) entry, which represents two parameters: begin var s := Seq(('Umnova',16),('Ivanov',23), ('Popova',17),('Kozlov',24)); Println('Adults:'); s.Where(\\(name,age) -> age >= 18).Println; Println('Sort by last name:'); s.OrderBy(\\(name,age) -> name).Println; end.
  • The construction "a as array of T" is allowed, which was previously prohibited at the grammar level. begin var ob: object := new integer[2,3]; var a := ob as array [,] of integer; end.

Source: opennet.ru

Add a comment