in reply to [Perl 6] Initialization within complex declarations

As I'm a C++ guy, I always shiver when anyone says "for clarity, initialize it in a separate statement". That's the kind of thing that often works, but if you get used to it, you'll have a hell of time to debug when it fails. (That's the reason why the C-style for loop has a wierd syntax extension in C++ so you can declare and initialize the loop variable at the same place.)

Of course, perl's = is not the same as C++ =.

Replies are listed 'Best First'.
Re^2: [Perl 6] Initialization within complex declarations
by blazar (Canon) on Jul 24, 2007 at 22:05 UTC
    As I'm a C++ guy, I always shiver when anyone says "for clarity, initialize it in a separate statement".

    Yeah, I'm not a C++ guy, but I second that and that's precisely the reason why I started this thread: I'm a Perl guy, and I think that an alternative syntax that would give improved visibility of the initialization bit would be nice, it would be very perlish. But then maybe I'm just going mad around a corner case.