Open eclipse-viatra-bot opened 6 months ago
By Gabor Bergmann on Jan 03, 2014 04:31
+1
As for the escape syntax brainstorm: I have some reservations about adding more special characters for the user to learn. One solution for escaping without special characters:
School.(find students).name(Sch, SName)
It reuses the existing keyword for pattern composition. But this is not completely satisfying either, as it is only half as concise as the special character based approach. Any better ideas?
Fortunately, such escaping should not be required in most cases.
By Eric Lépicier on Jan 03, 2014 07:17
(In reply to Gabor Bergmann from comment #1)
+1
As for the escape syntax brainstorm: I have some reservations about adding more special characters for the user to learn.
Well, I easily learnt the ^ and _ usage with the really clear warnings ...
One solution for escaping without special characters:
School.(find students).name(Sch, SName)
It reuses the existing keyword for pattern composition. But this is not completely satisfying either, as it is only half as concise as the special character based approach.
I can't say I like this syntax ... The idea was to have it looking identical to a real feature in most cases.
Any better ideas?
An escape character, suggested by a good warning ? ;-)\
Fortunately, such escaping should not be required in most cases.
Sure.\ Another solution would be to mark an ambiguity as an error, thus not allowing this syntax in case there is a real feature.
In fact, this kind of syntax is common in Acceleo. One can write queries which can be called like a method on their first parameter.\ [query say(c : Class, p : String) : String = p /]\ [aClass.say('hello')/]\ I don't know how Acceleo complains if Class has already a 'say' feature ... I'll verify and keep you informed.
By Eric Lépicier on Jan 06, 2014 12:45
(In reply to Eric Lépicier from comment #2)
In fact, this kind of syntax is common in Acceleo. One can write queries which can be called like a method on their first parameter. [query say(c : Class, p : String) : String = p /] [aClass.say('hello')/] I don't know how Acceleo complains if Class has already a 'say' feature ... I'll verify and keep you informed.
Well, Acceleo gives the priority to the model feature operation, it seems it ignores the overriding user query without warning ...
By Istvan Rath on Apr 08, 2014 18:02
Moving this feature to post-0.8.
By Istvan Rath on Apr 24, 2014 04:30
I'm expecting this to be addressed for 0.9.
By Abel Hegedus on Apr 19, 2016 05:25
Updating to correct milestone.
By Zoltan Ujhelyi on Oct 04, 2017 05:26
Moving potential tasks from future to 2.0.
By Zoltan Ujhelyi on Feb 08, 2018 07:21
Postponing to a future release.
By Zoltan Ujhelyi on May 27, 2019 07:45
Postponing tickets to FUTURE until effort is allocated to fix them.
| --- | --- | | Bugzilla Link | 424612 | | Status | NEW | | Importance | P3 enhancement | | Reported | Dec 23, 2013 09:00 EDT | | Modified | May 27, 2019 07:45 EDT | | Version | oldinquery | | Reporter | Eric Lépicier |
Description
The only way to re-use a pattern is the “find” syntax.\ When patterns have two parameters, they could be considered as a pseudo query-based feature.\ It would then be great to be able to use them like features.\ An example:\ With:\ pattern students(Sch, S) {\ School.courses.schoolClass.students(Sch,S);\ }\ The pattern:\ pattern schoolStudentsName(Sch, SName) {\ find students(Sch, S);\ Student.name(S, SName);\ }\ Could be written:\ pattern schoolStudentsName(Sch, SName) {\ School.students.name(Sch, SName);\ }
This syntax would be more compact and allows dot notation cascading.\ A special character may be added (like _ for expliciting unused variables, or ^ escape character for keywords) to make it explicitly a sub-pattern call whenever it would be ambiguous with a real feature.