I find it interesting that the concepts of generators being added to languages after the fact (that is not a fundamental part of the language) leads to such complex difficulties in their use.
Icon and UnIcon are examples where generators and co-expressions are fundamental to the language and so are used throughout most of your programs as a natural part of writing solutions to the problems being solved.
I find it interesting that iterators are such a big thing when they are just generators in Icon/UnIcon. I have seen many examples written in JS where map and lambda functions are used and the equivalent in Icon/UnIcon is a simple generator to get the same results.
Icon has been around since the early 80's (as the successor of SNOBOL4) and UnIcon as a separate project since around 2000. I should remark that the UnIcon translates UnIcon programs to Icon.
Goes to show that there is still much life in some of these older languages.
Icon and UnIcon are examples where generators and co-expressions are fundamental to the language and so are used throughout most of your programs as a natural part of writing solutions to the problems being solved.
I find it interesting that iterators are such a big thing when they are just generators in Icon/UnIcon. I have seen many examples written in JS where map and lambda functions are used and the equivalent in Icon/UnIcon is a simple generator to get the same results.
Icon has been around since the early 80's (as the successor of SNOBOL4) and UnIcon as a separate project since around 2000. I should remark that the UnIcon translates UnIcon programs to Icon.
Goes to show that there is still much life in some of these older languages.