[Opa] looks like unicode problem

Paulo J. Matos paulo at matos-sorge.com
Wed Aug 31 04:23:49 EDT 2011


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
>
>



-- 
PMatos



More information about the Opa mailing list