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?
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
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Lift" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---