MiniD 2 - Tentative Release Candidate 1

Jarrett Billingsley jarrett.billingsley at gmail.com
Tue Dec 9 05:07:46 PST 2008


On Tue, Dec 9, 2008 at 3:58 AM, davidl <davidl at 126.com> wrote:
> I've learned a bit minid today.
>
> I'm curious why foreach opApply don't use the yield instead of the current implementation?

Ah, but you can.  Coroutines have an opApply, and are therefore
iterable using foreach.  See the section on coroutines
(http://www.dsource.org/projects/minid/wiki/LanguageSpec2/Functions#Coroutines)
for some info on that.  Using coroutines for iteration is more
powerful, but of course the price you pay is that they're a lot more
expensive than a function closure.

> and another curious thing is how can I serialize/deserialize minid object in minid?
> any .tupleof for class available?

Sure, have a look of fieldsOf/allFieldsOf in the base library
(http://www.dsource.org/projects/minid/wiki/StdLib2/BaseLib).  They'll
give you functions as well, but it's easy to skip over them.


More information about the Digitalmars-d-announce mailing list