Want more features on Pastebin? Sign Up, it's FREE!
Guest

Syntax error (expression unary '-')

By: bahman on Oct 22nd, 2011  |  syntax: None  |  size: 0.81 KB  |  views: 22  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. 18 join_room() =
  2. 19 (
  3. 20   net = Network.cloud("PEYK")
  4. 21   room_name = Dom.get_value(#room)
  5. 22   server_channel = "{room_name}__SERVER"
  6. 23   Network.add(room_name, net)
  7. 24   Network.add(server_channel, net)
  8. 25
  9. 26   user = String.to_lower(Dom.get_value(#user))
  10. 27   do notify_room_join(server_channel, user)
  11. 28
  12. 29   user_callback = room_update_user(_, user)
  13. 30   line =
  14. 31     <h1>Room {room_name}</h1><hr/>
  15. 32     <div id=#room onready={_ -> (Network.add_callback(user_callback, room_name)
  16. 33                                  Network.add_callback(room_update_server, server_channel))}/>
  17. 34     <input id=#entry onnewline={_ -> broadcast_room(room_name, user)}/>
  18. 35     <input type="button" vlaue="Send" onclick={broadcast_room(room_name, user)}/>
  19.  
  20. 36   do Dom.transform([#room <- line])
  21. 37   void
  22. 38 )
  23.  
clone this paste RAW Paste Data