Scala for the WebWill it blend?def ol(items: Seq[String]) =  <ol> { items.map { s =>    <li> { s } </li>  } } </ol>Scala i...
<ajax:select>  You selected <sel:number></sel:number> From the select box.</ajax:select>Scalate   •   Mustache   •   Scaml...
case Path(Seg(p :: Nil)) => ResponseString(p)}unfiltered.jetty.Http.anylocal.filter(echo).run()object Stream extends unfil...
Upcoming SlideShare
Loading in...5
×

Scala for the web Lightning Talk

8,199

Published on

Nathan Hamblen gives a lightning talk about Scala

Published in: Technology, Design
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
8,199
On Slideshare
0
From Embeds
0
Number of Embeds
8
Actions
Shares
0
Downloads
1
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Scala for the web Lightning Talk

  1. 1. Scala for the WebWill it blend?def ol(items: Seq[String]) = <ol> { items.map { s => <li> { s } </li> } } </ol>Scala is hybrid.λ+☃=?LiftAjax.scala// create an ajax select boxdef doSelect(msg: NodeSeq) = ajaxSelect((1 to 50).toList.map { i => (i.toString, i.toString) }, Full(1.toString), { v => DisplayMessage(msgName, bind("sel", msg, "number" -> Text(v)), 5 seconds, 1 second) })// bind the view to the functionalitybind("select" -> doSelect _, ...ajax.html
  2. 2. <ajax:select> You selected <sel:number></sel:number> From the select box.</ajax:select>Scalate • Mustache • Scaml • Jade • SSPXML literals.Seriously.val myDiv = <div>Yo</div>Scalatraclass MyScalatraFilter extends ScalatraFilter { get("/") { <html> <body> <h1>Hello, world!</h1> </body> </html> }}def ol(items: Seq[String]) = <ol> { items.map { s => <li> { s } </li> } } </ol>Unfilteredimport unfiltered.request._import unfiltered.response._val echo = unfiltered.filter.Planify {
  3. 3. case Path(Seg(p :: Nil)) => ResponseString(p)}unfiltered.jetty.Http.anylocal.filter(echo).run()object Stream extends unfiltered.netty.async.Planwith ServerErrorResponse { val ChunkedMp3 = unfiltered.response.Connection(HttpHeaders.Values.CLOSE) ~> TransferEncoding(HttpHeaders.Values.CHUNKED) ~> ContentType("audio/mp3") val listeners = new DefaultChannelGroup def intent = { case req => val initial = req.underlying.defaultResponse(ChunkedMp3) val ch = req.underlying.event.getChannel ch.write(initial).addListener { () => listeners.add(ch) } } ...Scala for the WebYes, it blends!http://meetup.com/ny-scala  

×