joaoraf / kiama

Automatically exported from code.google.com/p/kiama
GNU Lesser General Public License v3.0
7 stars 2 forks source link

Support rewrites on non-Products #31

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Work up an example for this and see what happens.  I think the idea is that you 
need to provide the 
Product interface on your non-Product classes and then everything is OK.

Original issue reported on code.google.com by inkytonik on 5 Nov 2009 at 5:26

GoogleCodeExporter commented 9 years ago
Also see Randall's version that allows non-Products via a similar interface.

Original comment by inkytonik on 5 Nov 2009 at 5:28

GoogleCodeExporter commented 9 years ago

Original comment by inkytonik on 8 Nov 2009 at 11:36

GoogleCodeExporter commented 9 years ago

Original comment by inkytonik on 10 Nov 2009 at 5:11

GoogleCodeExporter commented 9 years ago
So, this one is really about adding tests for rewriting on non-Products, since 
we will always rely on the Product 
interface for generic operations.

Original comment by inkytonik on 17 Nov 2009 at 2:18

GoogleCodeExporter commented 9 years ago
Another aspect is raised by Scala 2.8 collections.  It shouldn't be too hard to 
provide generic traversals for any 
Traversable collection type.  This seems to be the best way to automatically 
get rewriting for data structures that 
include collections such as lists and maps. The "map" combinator in Rewriter 
could disappear in this case, I think.

Original comment by inkytonik on 26 Nov 2009 at 10:12

GoogleCodeExporter commented 9 years ago
It would also be good to support rewriting of Scala XML data.

Original comment by inkytonik on 2 Dec 2009 at 8:32

GoogleCodeExporter commented 9 years ago

Original comment by inkytonik on 7 Apr 2010 at 10:13

GoogleCodeExporter commented 9 years ago
Some progress: revision 914fcbc926 extends rewriting support to rules that 
match on primitive types.

Original comment by inkytonik on 27 Jul 2010 at 4:03

GoogleCodeExporter commented 9 years ago
Some discussion in this StackOverflow thread:

http://stackoverflow.com/questions/3717265/copy-objects-in-scala-but-changing-ch
ildren-for-rewriting

Original comment by inkytonik on 20 Sep 2010 at 12:45

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Revision  ac703aee04 contains general support for any Traversable (incl Map) 
data structures plus a new interface called Rewritable that can be implemented 
in order to add operations needed by rewriting to a type. These are in addition 
to the basic Product support (which works well for case classes).

We are still to come up with a satisfactory design for rewriting of other 
structures, such as Java types that cannot be modified to implement Rewritable. 
Deferring this until a later release.  Suggestions welcome.

Original comment by inkytonik on 24 Jan 2011 at 2:15

GoogleCodeExporter commented 9 years ago
This has all been released in 1.1.0.  Closing, since the extra stuff is very 
low priority.  WIll create new issue when we think we might get to it, or if 
there is some demand.

Original comment by inkytonik on 18 May 2011 at 9:50