On Wed, Oct 22, 2008 at 1:28 AM, tacobandit <[EMAIL PROTECTED]> wrote:
>
> Jorge,
>
> Awesome thanks. I guess that should have been obvious to me looking at
> the docs if I knew Scala better? The method signature was => Any..
> which i took to mean a Function0 which I tried to do as () => xyz.
> But obviously I read it wrong...
>
This, unfortunately, is a tricky one for even experienced users of Scala.
Anything you could throw at it conforms to => Any. What "=> T" means is,
"give me a T, but I promise not to evaluate it until I need it". In this
case, "give me an Any, but I promise not to evaluate it until I need it".
This makes it safe to pass in a "println" and know that it won't get
evaluated until it's needed.
On the flipside, you can also pass in an expression that makes a Function0.
In this case, evaluating the expression means -making- the Function0, not
-executing- it, which is the bug you were seeing.
I don't mind sticking with the latest and greatest, especially if it's
> proven stable. But one thing that seems missing from my hunting is a
> thorough example site, that I can pretty much refer to for all the
> basics.. Is the code for demo.liftweb.net available? Or something
> similar? That's updated in tandem with the framework? I think that
> could keep me from spinning my wheels on some of these things like the
> Submit trick..
>
Yes, there certainly is. Check out liftweb/sites in the git repository.
There are several sample Lift sites, including demo.liftweb.net (which is
liftweb/sites/example I believe).
Happy Lifting!
--j
On Oct 22, 12:36 am, "Jorge Ortiz" <[EMAIL PROTECTED]> wrote:
> > Yeah, that's a really bad backwards incompatibility, but fortunately the
> fix
> > is fairly easy:
> >
> > SHtml.submit("Submit", println("here"))
> >
> > I'd encourage you to stay on SNAPSHOT. The APIs might suffer a little
> > instability (that are always announced to the mailing list) but there are
> > several in-production sites on SNAPSHOT, so the code itself is pretty
> rock
> > solid.
> >
> > --j
> >
> > On Wed, Oct 22, 2008 at 12:16 AM, tacobandit <[EMAIL PROTECTED]>
> wrote:
> >
> > > David,
> >
> > > I appreciate the response. It was very helpful. Your suspicions were
> > > right, and this is not an issue for me in the current SNAPSHOT.
> >
> > > However, given the instability of the SNAPSHOT I'm not sure this does
> > > me much good. I can't figure out any workarounds to apparent bugs
> > > which I would are show stoppers. For example, both
> > > SHtml.Submit("Submit", () => println("here")) and
> > > SHtml.Submit("Submit", x => println("here")) silently don't do
> > > anything. Which is fine, I mean I don't expect the snapshot to be
> > > stable. But what might I do? Would 0.8 work for me? Or should I
> > > *shudder* use a less scala friendly framework until Lift is ready?
> >
> > > Eric
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---