[Opa] looks like unicode problem

François-Régis Sinot francois-regis.sinot at mlstate.com
Wed Aug 31 05:09:14 EDT 2011


Hi,

Oh... sorry, yes, I've spotted a few things that are wrong in your code
snippet; here's what the corrsponding lines should look like:

* 'message = {author=author; text=text}' (so ';' instead of ','; you can
also avoid any separation symbol)
* 'Dom.clear_value(#entry)' ('clear' instead of 'clean')
* 'user_update(x: message)' = (remove the spurious ':' before '=')

I guess you've manually copied (I mean, not copy-pasted). If it's really
copy-pasted, please point me to the url with this wrong piece of code.

Cheers,
François-Régis.

Le mercredi 31 août 2011 à 08:23 +0000, Paulo J. Matos a écrit :
> Quoting François-Régis Sinot <francois-regis.sinot at mlstate.com>:
> 
> > Hi,
> >
> > Indeed the strange looking (to you -- it looks perfectly fine to me even
> > in this email ;-)) character is a red UTF8 flag, signaling the position
> > of the syntax error.
> >
> 
> Ahhaha, now I can see the flag.
> 
> > So to sum up, yes, we'll try to do something for this.
> >
> 
> But the second part of the question is... what's the problem with the  
> code at that point? I just copied it from the website.
> 
> Cheers,
> 
> PMatos
> 
> >>
> >> type message = {author: string; text: string}
> >>
> >> room = Network.cloud("room"): Network.network(message)
> >>
> >> start() =
> >> (
> >>          author = Random.string(8)
> >>          <div id=#header><div id=#logo></div></div>
> >>          <div id=#conversation></div>
> >>          <input id=#entry/>
> >>          <div class="button">Send!</div>
> >> )
> >>
> >> broadcast(author) =
> >> (
> >>          text = Dom.get_value(#entry)
> >>          message = {author=author, text=text}
> >>          do Network.broadcast(message, room)
> >>          Dom.clean_value(#entry)
> >> )
> >>
> >> user_update(x: message): =
> >> (
> >>          line = <div class="line">
> >>                      <div class="user">{x.author}:</div>
> >>                      <div class="message">{x.text}</div>
> >>                 </div>
> >>          do Dom.transform([ #conversation +<- line ])
> >>          Dom.scroll_to_bottom(#conversation)
> >> )
> >>
> >> I get the following in the terminal:
> >> $ opa test.opa
> >> In test.opa [17:38-17:38 | global chars=405-405]
> >> Syntax error at line 17, column 38
> >> The error may be in the following citation, usually in the red part
> >> (starting at ⚐) or just before:
> >> <<)
> >>
> >> broadcast(author) =
> >> (
> >>          text = Dom.get_value(#entry)
> >>          message = {author=author, text⚐=text}
> >>          do Network.broadcast(message, room)
> >>          Dom.clean_value(#entry)
> >> )
> >>
> >> u>>
> >> Hint: expected "," or "->" or ":" or "as" or <spacing>
> >> (while parsing <pattern> starting at line 17, column 33)
> >> Error
> >> Syntax error
> >>
> >>
> >> The strange thing is the character in the message assignment line
> >> after 'author=author, text'.
> >> Any idea of what's happening?
> >>
> >> Cheers,
> >
> > --
> > François-Régis Sinot
> > R&D @ MLstate
> > 104 rue du Faubourg Saint-Antoine, 75012 Paris, France
> >
> >
> 
> 
> 

-- 
François-Régis Sinot
R&D @ MLstate
104 rue du Faubourg Saint-Antoine, 75012 Paris, France



More information about the Opa mailing list