Open semaperepelitsa opened 11 years ago
i remember seeing this before. we talked about this, then. the problem is that assigning a struct to a comstamt doesn't actually set its name. the constant of the name Letter simply points to the new class, but that doesnt mean the name of the strucy class is now Letter.
A workaround could be
class Letter < Struct.new(:char); end
But this works fine: Letter = Class.new
.
I won't have time to look into it today (Christmas and everything ;)), but I'll take a look. Associating classes with names on the Smalltalk side of things happens through instances of RubyNamespace. We had some oddities there before. @MagLev/hpi-bp is working on persistence, so they will take a look, too.
First script prints class name "Letter" as expected.
Second script prints empty line instead of class name.
It works fine if I replace struct with a regular class.