JADE Environment Development Ideas

What's new in the JADE 2025 release?

IMPROVED DEVELOPER EFFICIENCY. ENHANCED INTEGRATIONS. NEW WEB DEVELOPMENT FRAMEWORK

The Jade 2025 release focuses on modernising the developer experience and helping you build faster, smarter, and more scalable applications.


Start your update to JADE's latest release

Foreach support for Iterable interfaces

Foreach support for Iterable interfaces

With the addition of the new JadeIterableIF and JadeReverseIterableIF RootSchema interface, it will be possible to add compiler support to the foreach statement allowing the developer to iterate over any object that implements one or both interfaces. This will allow iteration over real or virtual collections.

Example

iterateShapes(shapesIterable: JadeIterableIF);

vars

shape: Shape;

begin

foreach shape in shapesIterable as Shape do

write shape.numberOfSides;

endforeach;

end;

In this example, any class that implements JadeIterableIF or Collection of Shape objects can be provided as a parameter to this method and provided its iterator retrieves Shape objects, it will behave in a generic manner. Due to the non-generic nature of these interfaces, the new foreach as clause must be used, which performs a check at runtime to make sure the retrieved object is of the type specified in the as clause expression.

  • John Richards
  • Aug 19 2020
  • Shipped (2020)
  • Attach files