Calling a method from other snippet

4 views
Skip to first unread message

sunanda

unread,
Oct 21, 2009, 7:06:44 PM10/21/09
to Lift
Hi,
I have a method updateColumn() in ColumnInfo.scala snippet.
I need to call this method form another snippet GridInfo.scala

How can I do this.

Sunanda

Ross Mellgren

unread,
Oct 21, 2009, 9:43:04 PM10/21/09
to lif...@googlegroups.com
Just call it:

class FirstSnippet {
def render(ns: NodeSeq): NodeSeq = {
bind("foobar", ns,
"otherSnippet" -> new SecondSnippet.render _)
}
}

class SecondSnippet {
def render(ns: NodeSeq): NodeSeq = <div>hello!</div>
}

-Ross

Naftoli Gugenheim

unread,
Oct 21, 2009, 9:50:38 PM10/21/09
to lif...@googlegroups.com
That needs to be new SecondSnippet().render or (new SecondSnippet).render

-------------------------------------

Ross Mellgren

unread,
Oct 21, 2009, 9:54:54 PM10/21/09
to lif...@googlegroups.com
So true. I need a REPL built in to my email client ;-)

-Ross

Naftoli Gugenheim

unread,
Oct 21, 2009, 10:03:37 PM10/21/09
to lif...@googlegroups.com
How about building an email client into your REPL? ;)

Ross Mellgren

unread,
Oct 21, 2009, 10:18:29 PM10/21/09
to lif...@googlegroups.com
Screw it, I'll just do all three in emacs. GUIs are for wimps anyway,
right?

-Ross

Jim Barrows

unread,
Oct 21, 2009, 10:20:46 PM10/21/09
to lif...@googlegroups.com
Doesn't emacs already do all three?

Sent on the Now Network™ from my Sprint® BlackBerry

Ross Mellgren

unread,
Oct 21, 2009, 10:25:44 PM10/21/09
to lif...@googlegroups.com
It sure does, but I'm a wimp and use Mail.app for mail, Terminal.app
for REPL and terminal, and Emacs for editing, mostly.

-Ross
Reply all
Reply to author
Forward
0 new messages