On Tue, Oct 21, 2008 at 11:09 AM, Tim Perrett <[EMAIL PROTECTED]> wrote:
> > Doh!! Scratch that: > > val badger = for(val p <- paramaters) yield MyItem(p._1,p._2) > println(badger.toList) > > This gives my what I want - any reason I *shouldnt* be doing it this > way? Tim, I've been in the PayPal code this morning. ;-) I've changed the input from Array[NameValuePair] to Seq[(String, String)] and I do the translation very late in the process (just before stuff is handed off the the Apache code). > > > Cheers, Tim > > Tim Perrett wrote: > > Hey guys, > > > > I have an instance of RequestState, and request.params yields a Map() > > full of the request parameters. What I want to do is iterate through > > the map and convert into into an Array of my custom types (for the > > paypal verification) > > > > However, as the Map contains a bunch of tuples, im not sure how best > > to iterate through it and get those key/value pairs? > > > > Something simple like: > > > > // given that request: Map("a" -> "XX", "b" -> "ZZ") > > > > request.flatMap(param => { > > MyItem(param._1, param._2) > > }) > > > > This however errors with: > > > > found : this.MyItem > > required: Iterable[?] > > MyItem(param._1, param._2) > > ^ > > > > Sorry this is more of a scala question - I dont usually use Map() > > > > Cheers > > > > Tim > > > -- Lift, the simply functional web framework http://liftweb.net Collaborative Task Management http://much4.us Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~----------~----~----~----~------~----~------~--~---