Created
          August 24, 2011 17:16 
        
      - 
      
- 
        Save gkossakowski/1168581 to your computer and use it in GitHub Desktop. 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | package com.google.gwt.sample.jribble.client; | |
| import com.google.gwt.core.client.EntryPoint; | |
| import com.google.gwt.event.dom.client.ClickEvent; | |
| import com.google.gwt.event.dom.client.ClickHandler; | |
| import com.google.gwt.user.client.ui.Button; | |
| import com.google.gwt.user.client.Window; | |
| import com.google.gwt.user.client.ui.RootPanel; | |
| class Hello extends EntryPoint { | |
| def onModuleLoad() { | |
| val numbers = List(1, 2, 3, 4) | |
| val strings = numbers map (_.toString + "...") | |
| val a = foo(1) | |
| val s = a.toList.toString | |
| val b = new Button("Click me", (_: ClickEvent) => Window.alert("Hello, AJAX, said Scala\nThose numbers are coming from list!\n" + s)); | |
| RootPanel.get().add(b); | |
| } | |
| def foo[T: ClassManifest](x: T): Array[Array[T]] = foo2(Array.tabulate(2)(_ => x)) | |
| def foo2[T: ClassManifest](x: T): Array[T] = Array.tabulate(2)(_ => x) | |
| implicit def clickHandler(f: ClickEvent => Unit): ClickHandler = new ClickHandler { | |
| def onClick(event: ClickEvent) = f(event) | |
| } | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment