Bug 477216 - Support for closure() and iterate()
Summary: Support for closure() and iterate()
Status: RESOLVED FIXED
Alias: None
Product: Acceleo
Classification: Modeling
Component: Query Language (show other bugs)
Version: 3.6.0   Edit
Hardware: PC Windows NT
: P3 normal
Target Milestone: ---   Edit
Assignee: Yvan Lussaud CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-11 10:59 EDT by Laurent Goubet CLA
Modified: 2016-05-03 05:09 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Laurent Goubet CLA 2015-09-11 10:59:46 EDT
AQL currently has no support for recursive queries such as closure() or for "generic" iteration (only the specialized collect, select, reject, ...)

For example, in the case of a parent-children relationship, OCL allowed users to write
parent->closure(children)
to get *all* children of 'parent', recursively.

Likewise, we could use iterate as a generic iterator instead of specialized one. For example,
classes->collect(name)
could be written
classes->iterate(c : Class ; acc : Set{} | acc->including(c.name))
Comment 1 Eclipse Genie CLA 2015-12-28 10:28:18 EST
New Gerrit change created: https://git.eclipse.org/r/63316
Comment 2 Yvan Lussaud CLA 2015-12-28 10:31:16 EST
Th patch provides the closure() service but doesn't provide a complete validation for this service. We need to have access to variables to be able to compute the type of the lambda expression in a closure fashion. This will impact a lot of code to fix this. We should settle other patches before going that way...
Comment 4 Yvan Lussaud CLA 2016-05-03 05:09:48 EDT
The closure() service is implemented. The iterate() service seems useless. It's hard to read and maintain in expressions. We rather prefer a custom Java service approach.

If you want the iterate() service to be implemented reopen this bug.