catch without block/scope brackets
Downs
default_357-line at yahoo.de
Wed Sep 5 00:56:19 PDT 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Jarrett Billingsley wrote:
> I've thought about this as well, and I think it's because allowing a
> statement without braces there would introduce an ambiguity:
>
> try
> foo();
> catch
> (bar).baz();
>
I don't think this is an ambiguity. After all, catch(bar) is not a valid
catch statement anyway, since the type is woefully missing. If we add a
type, as in catch (Exception bar), the second case, (Exception
bar).baz() ceases to be a valid statement.
I'm probably missing something. Could you explain, please?
--downs
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFG3mEjpEPJRr05fBERAtZAAJwKc5xGzVYWh2WtejwV/7pwSezO+QCgi8fF
WM4EUfUstZ+0cvbGSWHU9Ww=
=v/zf
-----END PGP SIGNATURE-----
More information about the Digitalmars-d
mailing list