The return types of the Get_Next functions on classes Attribute Question and Name Question are generated as Attribute Question and Name Question, i.e. there are spaces instead of underscores and .Handle is not appended.
Last edit: Alex Proudfoot 2013-06-01
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If I attempt to work round by removing the spaces from the class names (creating AttributeQuestion and NameQuestion) the generated code does not compile (see screenshot) ...
The trouble is that CF doesn't use programming language inheritance to implement super/subtypes. Both the parent and the child are independently derived from ColdFrame.Instances.Instance_Base.
In any case, Get_Next() would need to return the same type in both parent and child, which I would expect to be Question (if not, aside from the profile mismatch, what is going to happen if the last Attribute_Question wants to answer with a Name_Question?).
Even if you do that, there is a translation-related problem: in Question, ':Question' is translated to 'return Handle' i.e. 'access all Instance', whereas in Attribute_Question it's translated as 'ColdFrame.Instances.Handle', i.e. 'access all Instance_Base'Class'.
You might think that a function-returning-this-class should be translated to 'return ColdFrame.Instances.Handle', like a function-returning-another-class. But, for now, the way round is to declare a type say CIH which is a renaming of ColdFrame.Instances.Handle and have both Question.Get_Next and Attribute_Question.Get_Next return CIH.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hmmm. That rings a bell. :)
Did a function-returning-this-class not return ColdFrame.Instances.Handle in the Rational Rose days? Anyway, I'll download the update when available, try your work round and let you know how it goes. Thanks.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hmmm. That rings a bell. :)
Did a function-returning-this-class not return ColdFrame.Instances.Handle in the Rational Rose days? Anyway, I'll download the update when available, try your work round and let you know how it goes. Thanks.
** [bugs:#79] Incorrect Code Generated**
Status: pending Labels: generation Created: Sat Jun 01, 2013 07:04 AM UTC by Alex Proudfoot Last Updated: Sun Jun 02, 2013 12:16 PM UTC Owner: Simon Wright
The return types of the Get_Next functions on classes Attribute Question and Name Question are generated as Attribute Question and Name Question, i.e. there are spaces instead of underscores and .Handle is not appended.
Last edit: Alex Proudfoot 2013-06-01
Ticket moved from /p/coldframe/support-requests/6/
If I attempt to work round by removing the spaces from the class names (creating AttributeQuestion and NameQuestion) the generated code does not compile (see screenshot) ...
You could equally have put the underscores in.
The trouble is that CF doesn't use programming language inheritance to implement super/subtypes. Both the parent and the child are independently derived from ColdFrame.Instances.Instance_Base.
In any case, Get_Next() would need to return the same type in both parent and child, which I would expect to be Question (if not, aside from the profile mismatch, what is going to happen if the last Attribute_Question wants to answer with a Name_Question?).
Even if you do that, there is a translation-related problem: in Question, ':Question' is translated to 'return Handle' i.e. 'access all Instance', whereas in Attribute_Question it's translated as 'ColdFrame.Instances.Handle', i.e. 'access all Instance_Base'Class'.
You might think that a function-returning-this-class should be translated to 'return ColdFrame.Instances.Handle', like a function-returning-another-class. But, for now, the way round is to declare a type say CIH which is a renaming of ColdFrame.Instances.Handle and have both Question.Get_Next and Attribute_Question.Get_Next return CIH.
Fixed in rev 96a801ba7910, which will be uploaded asap.
Hmmm. That rings a bell. :)
Did a function-returning-this-class not return ColdFrame.Instances.Handle in the Rational Rose days? Anyway, I'll download the update when available, try your work round and let you know how it goes. Thanks.
Looking at the generator XSL, function-returning-this-class has returned Handle since at least 2005 (date of a comment) and probably 2003.
On 2 Jun 2013, at 15:30, Alex Proudfoot alexproudfoot@users.sf.net wrote: