[Prev][Next][Index][Thread]

Definitions in statements allowed?



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: