On Mon, 18 Oct 2010 19:46:04 -0200, Andreas Berger wrote about Re: [fpc-pascal] Can variables be declared within a block?:
>
> > for (int i = 0;...)
> > Can't see anything wrong. I use declaration of variables inside
> > blocks quite often in Java and C++ but have never missed it in
> > pascal. Please enlighten me. What is so bad about creating
> > temporary variables inside blocks instead of the beginning of a
> > function in a language that supports it?
> >
> > R.
> But it should make you wonder why this is no longer allowed in the
> latest C++ standards.
What do you mean?
The current C++ standard (ISO 1998+TR1) permits short scope
declarations. Indeed, C++ permits declarations to appear anywhere, not
just after a { to open a function or compound statement. It has done
since the A.R.M. days, and in some implementations before that.
--
Regards,
Dave [RLU #314465]
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
[email protected] (David W Noon)
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
signature.asc
Description: PGP signature
_______________________________________________ fpc-pascal maillist - [email protected] http://lists.freepascal.org/mailman/listinfo/fpc-pascal
