[Prev][Next][Index][Thread]
Re: d2c - processing error in Define Class
In comp.lang.dylan, Gareth Baker wrote:
> dauclair@hotmail.com writes:
>
> > Hm! Maybe I'm doing something incorrect here, but I enter your code
> > into the FD playground. The first statement compiles okay, but the
> > second returns a 'Reference to undefined binding "<a_new_type>"'
> > error.
>
> I just tried it in FD 2.0 beta 3 using the FD playground as well and
> it works fine. This is both with underscores and dashes.
Well, I just tried it with GD 2.3.2a, both d2c and mindy, and the
code fragment posted works. Here it is again:
define constant <new_type> = one-of(#"t1", #"t2", #"t3", #"t4",
#"t5", #"t6", #"t7", #"t8",
#"t9", #"t10", #"t11", #"t12",
#"t13", #"t14", #"t15", #"t16",
#"t17");
define class <new_class> (<object>)
slot new_slot :: <new_type>;
end class <new_class>;
define method main(appname, #rest arguments)
let a = make(<new_class>);
a.new_slot := #"t5";
format-out("%=\n", a.new_slot);
end method main;
This prints out #"t5", just as it should.
Can you give a minimal example that provokes the error, and if this one
does, the version of GD that you're using?
Neel