Category:Wren-trait: Difference between revisions

Changed description following transfer of iteration classes to Wren-iterate.
m (Tidied links.)
(Changed description following transfer of iteration classes to Wren-iterate.)
Line 2:
'''Wren-trait''' is a module which provides the abstract classes: Comparable, Cloneable and CloneableSeq. The first of these enables child classes to easily support the basic comparison operators and the latter two enables such classes to identify themselves as ''cloneable'' given a suitable mechanism.
 
It also contains the wrapper classes: Stepped, Reversed, Indexed, ByRef and ByKey plus a helper class SeqEntry. TheByRef firstenables twoa of these enable sequencesvalue to be iteratedpassed in''by eitherreference'' (or both)to a stepped fashion (steps > 1)method or infunction reverse.and The thirdByKey enables thea iterationreference totype includeobject theto zero-basedbe indexused ofas the sequence elements and SeqEntry assistsa withMap thiskey.
 
ByRef enables a value to be passed ''by reference'' to a method or function and ByKey enables a reference type object to be used as a Map key.
 
It is the fifth in a series of modules (listed on the language's [https://rosettacode.org/wiki/Category:Wren main page]) designed to assist with writing Rosetta Code tasks so the same code does not have to be written or copy/pasted time and time again thereby bloating a task's script code unnecessarily. It is also small enough to be used by other modules in the series which are usually organized and written to avoid inter-dependencies.
9,476

edits