Your clone doc says this: "Outputs a new object equal to the given object. This is not guaranteed to actually copy the object; it does nothing with immutable objects, and does not copy words either. However, sequences and tuples can be cloned to obtain a shallow copy of the original."
I am confused as to what these limitation mean. What does "does not copy words" mean? If any of the slots contain objects rather than primitive datums, will they get their data moved over as well? I don't want to just clone a tuple, but change its type as well. If I have a child tuple that is derived from the parent tuple but has some extra slots, I want to clone an object of the parent type but simultaneously make it an object of the child type so that I can then manually fill in the extra slots, but have all of the original slots copied over automatically during the cloning process. Another possibility would be to just clone the tuple of the parent type using your clone word, but then have a word that converts it into the child type leaving the data alone in the original slots but appending the extra slots onto the object empty of data and ready to be manually filled in. Ideas? I don't want to have to manually fill in all of the original slots because the parent type is defined in another file and I don't necessarily know what all slots it contains, or what they are for. I am writing my slide-rule program that makes use of my list program. It is a three-step process. First I generate linked lists representing the scales, with each node being a mark on the scale. Then from these I generate linked lists representing the workpieces, with each node being a shape (either a line or an alpha-numeric character). Then from these I generate linked lists (of type file) representing the LaTeX and gcode programs (these get dumped to disk as ascii seq files). I have lots of tuples derived from the list tuple. I am using my own lists rather than the ones that come with Factor because I need to manipulate them --- split lists apart, link lists together, insert lists into the middle of other lists, fold lists at a specific node, etc.. I don't want a deep copy because my lists are circular and trying to copy the links will result in infinite recursion. I already wrote a word to clone a linked list by creating a new linked list with new link data. The problem is that I want the nodes in the new linked list to be of some child type rather than the parent type of the nodes in the source linked-list. Also, sometimes I want a variety of types of nodes in the same linked list, all of which are children of the list type. An example would be to have lines and characters and possibly other kinds of shapes as well (arcs, for example), all in a workpiece list. ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Factor-talk mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/factor-talk
