[Lift] Re: JPA questions (was Re: SnippetFailure)

2008-10-15 Thread Jorge Ortiz
Derek, With the upcoming release of 2.7.2, you can update all this classOf[T] stuff to use scala.reflect.Manifest[T], which handles all that stuff for you almost automagically. I've been meaning to blog about this, but haven't found the time. The short example is: def find[A](id:

[Lift] Re: A stupid question

2008-10-15 Thread David Pollak
Please also see: http://blog.lostlake.org/index.php?/archives/50-The-Scala-Option-class-and-how-lift-uses-it.html Can[T] is just like Option[T] Marius wrote: to get stuff out of a can you can do: 1. Pattern matching having c a Can[String] c match { case Full(value) = //do something

[Lift] Re: A stupid question

2008-10-15 Thread Charles F. Munat
Thanks. I have read everything I could find on this but I think I'm just a bit dense about it. Probably, it's just unfamiliarity with the syntax of Scala as a whole and functional programming in general (or maybe I'm just stupid). Hopefully, at some point the light bulb will come on and this

[Lift] Tools

2008-10-15 Thread Charles F. Munat
One of the hardest parts about learning Lift and Scala is not really know what objects look like. Things get pretty complicated and it's difficult to remember what's in what. It would be very nice to be able to step through Lift and see exactly what is where in memory and how things change,

[Lift] Re: A stupid question

2008-10-15 Thread David Pollak
Charles, A Can is a container... it can contain a thing or be empty. You can transform the contents of a Can from one thing to another using map(). map() on Can, Option, List is exactly the same as map() on Array in Ruby: irb(main):004:0 [1,2,3].map{|v| v.to_s + Cats} = [1 Cats, 2 Cats, 3

[Lift] Re: Menu Builder active element

2008-10-15 Thread Bjarte S. Karlsen
How do I create a new 0.10-SNAPSHOT project with the mvn archetype? regards Bjarte Bjarte S. Karlsen: Hello David, I am using 0.9 it looks like. But I can upgrade to 0.10-SNAPSHOT tonight and check out this change. The only thing I have done in the project is to try to adapt the

[Lift] Re: Menu Builder active element

2008-10-15 Thread David Pollak
mvn archetype:create -U \ -DarchetypeGroupId=net.liftweb \ -DarchetypeArtifactId=lift-archetype-basic \ -DarchetypeVersion=0.10-SNAPSHOT\ -DremoteRepositories=http://scala-tools.org/repo-snapshots \

[Lift] Re: A stupid question

2008-10-15 Thread Jorge Ortiz
Also check out CanSpec.scala to get an idea of how Cans can be used. --j On Wed, Oct 15, 2008 at 9:33 AM, David Pollak [EMAIL PROTECTED] wrote: Charles, A Can is a container... it can contain a thing or be empty. You can transform the contents of a Can from one thing to another using

[Lift] Re: Menu Builder active element

2008-10-15 Thread Bjarte S. Karlsen
Never mind I got it working :) I will play around with it and ask questions here or in #lift on freenode. regards Bjarte Bjarte S. Karlsen: How do I create a new 0.10-SNAPSHOT project with the mvn archetype? regards Bjarte Bjarte S. Karlsen: Hello David, I am using 0.9

[Lift] Re: A stupid question

2008-10-15 Thread Derek Chen-Becker
Charles, to put this in the context of the JPA stuff I'm working on, here's the pattern I would use for, say, viewing an Author when I have a corresponding RequestVar: object passedAuthor extends RequestVar[Can[Author]](Empty) def view (xhtml : NodeSeq) : NodeSeq = passedAuthor.map({ author =

[Lift] Re: JPA questions (was Re: SnippetFailure)

2008-10-15 Thread Derek Chen-Becker
Jorge, that's great news! Having to use the classOf definitely felt a little clunky so this will help clean things up a lot. The undocumented and experimental part scares me a little, but if this will eventually be core functionality I think we'll definitely move to it. Thanks, Derek On Wed,

[Lift] Re: A stupid question

2008-10-15 Thread Charles F. Munat
Ah, that's a good idea. Didn't think of that. Chas. Jorge Ortiz wrote: Also check out CanSpec.scala to get an idea of how Cans can be used. --j On Wed, Oct 15, 2008 at 9:33 AM, David Pollak [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Charles, A Can is a container...

[Lift] Re: A stupid question

2008-10-15 Thread Charles F. Munat
Yes, this does help a bit. I actually understand the Can (and Option) very well, and I think it's a great idea (though the added advantage of the Can doesn't seem to be heavily used yet). The problem I was having was dealing with cans inside cans inside cans. But after reading everything