[Opa] looks like unicode problem

François-Régis Sinot francois-regis.sinot at mlstate.com
Wed Aug 31 03:48:02 EDT 2011


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.

While it's nice for UTF8 users, I agree it's a bit "elitist". We also
have a pull request on this subject on github (which completely removes
the flag). I'd be in favor of detecting the terminal type and choosing
appropriately.

So to sum up, yes, we'll try to do something for this.

Best,
François-Régis.

Le mardi 30 août 2011 à 13:23 +0000, Paulo J. Matos a écrit :
> Hi,
> 
> I am following the demo of the chat room and with the code (file attached):
> 
> 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



More information about the Opa mailing list