[Prev][Next][Index][Thread]
Definitions in statements allowed?
-
To: info-dylan@ai.mit.edu
-
Subject: Definitions in statements allowed?
-
From: "Gabor Greif" <gabor@mac.com>
-
Date: Fri, 18 Aug 2000 19:45:02 -0400 (EDT)
-
Organization: Hopelessly devoted...
-
Xref: traf.lcs.mit.edu comp.lang.dylan:12646
Studying the ebnf syntax I discovered that the following is legal dylan(*):
if (#t)
define variable guhbr = 55;
define method wumms(g) end;
end if;
This seems rather suspicious to me, because I always believed that
definitions can only appear at toplevel.
Interestingly Gwydion Dylan dies with an internal error in both cases:
Error : Internal compiler error: Can't fer-convert
{<define-variable-parse> instance}
Error : Internal compiler error: Can't fer-convert
{<define-method-parse> instance}
[Rob <- this may be your problem]
I wonder whether the language designers deliberately accounted for this
possibility or is it simply an oversight?
Or is the above intended to be weeded out by semantic analysis?
Thanks for any hint,
Gabor
(*) see DRM p. 421, production 1 of "non-statement-body-fragment".
Follow-Ups: