C++ / Why Iterators Got It All Wrong

Moritz Maxeiner via Digitalmars-d digitalmars-d at puremagic.com
Sun Sep 3 05:46:05 PDT 2017


On Sunday, 3 September 2017 at 08:37:36 UTC, Robert M. Münch 
wrote:
> On 2017-09-02 21:27:58 +0000, Moritz Maxeiner said:
>
>> Thanks for your post about Rebol, I didn't know it before.
>
> As said, the official Rebol-2 version is a dead-end. Even our 
> main product is still based on it :-) 15 years old technology, 
> but still working and we know all problemes. So very few 
> surprises. And, it's very productive.
>
> There exists a half-done official Rebol-3 version as 
> open-source. It was picked up by some and continued. And than 
> there is a thing called Red, which uses a lot of ideas but 
> compiles. Worth a look too. It's really cool, because it 
> compiles native apps for Android without any SDK for example.
>
> Overall, it's worth to spend some time with Rebol. I'm sure you 
> won't your time back and can learn a lot. Things to look at: 
> VIEW (GUI), PARSE (for parsing) and after this using PARSE to 
> create DSL with Rebol. Very cool feature.

I'll put in on my ever growing list of things to check out in 
depth, thanks :p

>
>
>> After reading through the series chaper, though, AFAICT Rebol 
>> series *are* iterators (begin+end), just with really nice, 
>> functional (read: LISP) syntax?
>
> There is no difference between code & data in Rebol. And it has 
> a very rich set of datatpye, IIRC about 35 native ones. And 
> many of them are series, which can be operated in the same way.

Sounds like LISP :)

>
> From my experience, traversing datastructures with a functional 
> syntax and concept is really natural to work with. It's mostly 
> what you would tell someone to do using english.

I agree, though I was talking about what the abstract data type 
of a "series" is, i.e. what operations is exposes. From my 
observation:
A D input range exposes via empty/front/popFront.
A classic iterator exposes via begin/end.
A Rebol series seems to be a safer form of iterator, as it 
doesn't expose begin/end directly, but exposes restricted 
operations that are defined as manipulating begin/end.


More information about the Digitalmars-d mailing list