HaxeFoundation / haxe.org-comments

Repository to collect comments of our haxe.org websites
2 stars 2 forks source link

[code.haxe.org] Abstract types - Using Iterators as Generic Type Parameters #73

Open utterances-bot opened 4 years ago

utterances-bot commented 4 years ago

Using Iterators as Generic Type Parameters - Abstract types - Haxe programming language cookbook

Iterators are a helpful Haxe structure. Any structure that implements the next and hasNext functions with the appropriate signature will allow you build a for loop. Arrays have an iterator() function that returns exactly this, and you don't need to call it, the for language construction does it for you.

https://code.haxe.org/category/abstract-types/using-iterators-as-generic-type-parameters.html

alexzandros commented 4 years ago

So cool!! The more I know HAxe the more I love it. Functional with ADT as Ocaml, F# and Haskell. Powerful macros without that many brackets :wink: . Extension methods. And I could keep going.