[Baypiggies] Baypiggies snippets

Keith Dart ♂ keith at dartworks.biz
Thu Mar 29 07:42:11 CEST 2007


Max Slimmer wrote the following on 2007-03-28 at 22:27 PDT:
===
> What doug is asking for is any sequence to have some method say flatten such
> that
> Seq = [a,b,c]
> Flatseq = Seq.flatten()
> 
> Your answer below could import some function util.flatten
> And then Flatseq = util.flatten(Seq) but not quit what was asked for.

===

Perhaps. But what's implied is that what he's asking for isn't really
the right thing to ask. ;-) It should not be a method, but a function
that works on any object implementing the sequence/iterator interface
(duck typing).



-- 
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   Keith Dart <keith at dartworks.biz>
   public key: ID: 19017044
   <http://www.dartworks.biz/>
   =====================================================================



More information about the Baypiggies mailing list