Sorry, I meant it as more of an example so I did not compile it, and Scala's type inferencer is never as good as I hope. Here is one that compiles:
SHtml.selectObj((0 until 11).map(i => Pair(i, i.toString)), Full(0), (i: Int) => { println("the number chosen was " + i + " and 10 plus that was " + (10 + i)) }) Just had to add a type annotation and put some braces in. The major point I had though was that you can use (0 until 11) to generate a range of ints and then map those into pairs. Hope this helps, -Ross On Jul 20, 2009, at 12:45 PM, glenn wrote: > > Ross, > > Your example does not compile. I get a "missing parameter type" error > on i =>... > function. > > > > On Jul 17, 3:29 pm, Ross Mellgren <dri...@gmail.com> wrote: >> selectObj((0 until 11).map(i => Pair(i, i.toString)), >> Full(0), >> i => println("the number chosen was " + i + " and 10 plus >> that was " + (10 + i))) >> >> -Ross >> >> On Jul 17, 2009, at 6:27 PM, glenn wrote: >> >> >> >>> I would like to know how to create a selectObj over a range of >>> integers. Do I have to use >> >>> val numList = List(0->"0", 1->"2", 2->"3" ...) >> >>> def numbers = selectObj(numLists, Full(0), someFunc)? >> >>> It seems a load to have to create a list of pairs. And what does the >>> third param to selectObj look like in >>> this instance? >> >>> Please tell me there is shortcut. > > --~--~---------~--~----~------------~-------~--~----~ 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 liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~----------~----~----~----~------~----~------~--~---