Escape prohibited chareacters.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Eno
Reply | Threaded
Open this post in threaded view
|

Escape prohibited chareacters.

Eno

I encounter again this issue while porting js codes:

<p>World population is <span id="world-population">0</span>.</p>

var comma_separator_number_step = $.animateNumber.number_step_factories.separator(',')
$('#world-population').animateNumber(
  {
    number: 7095217980,
    number_step: comma_separator_number_step
  }
);

all the words with '_' ( constants, functions etc) while writing in Amber would be rejected by the Amber compiler.

The same issures with the ", < and > in inline js codes were kindly answered but '_' was noted recently and remained
without clues in the formal posts.

There are many js system constants or functions were written as such, any help?

thanks.



--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: Escape prohibited chareacters.

Nicolas Petton
Yes, it is currently a problem in Amber, but It's planned to address it
by compiling message sends differently, thus allowing underscores.

Until then, the solution I would suggest is to inline JS code where you
cannot do otherwise.

Nico

EnoX1 writes:

> I encounter again this issue while porting js codes:
>
> <p>World population is <span id="world-population">0</span>.</p>
>
> var comma_separator_number_step = $.animateNumber.number_step_factories.separator(',')
> $('#world-population').animateNumber(
>   {
>     number: 7095217980,
>     number_step: comma_separator_number_step
>   }
> );
>
> all the words with '_' ( constants, functions etc) while writing in Amber would be rejected by the Amber compiler.
>
> The same issures with the ", < and > in inline js codes were kindly answered but '_' was noted recently and remained
> without clues in the formal posts.
>
> There are many js system constants or functions were written as such, any help?
>
> thanks.


--
Nicolas Petton
http://nicolas-petton.fr

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: Escape prohibited chareacters.

Herby Vojčík

Nicolas Petton wrote:
> Yes, it is currently a problem in Amber, but It's planned to address it
> by compiling message sends differently, thus allowing underscores.

LIke, `m$at_put_` and `m$yourself` for methods and `v$elements` for variables (and not having ["..."] there at all)?

> Until then, the solution I would suggest is to inline JS code where you
> cannot do otherwise.
>
> Nico

Herby

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: Escape prohibited chareacters.

Nicolas Petton
Yes, something like that :)

Nico

Herby Vojčík writes:

> Nicolas Petton wrote:
>> Yes, it is currently a problem in Amber, but It's planned to address it
>> by compiling message sends differently, thus allowing underscores.
>
> LIke, `m$at_put_` and `m$yourself` for methods and `v$elements` for variables (and not having ["..."] there at all)?
>
>> Until then, the solution I would suggest is to inline JS code where you
>> cannot do otherwise.
>>
>> Nico
>
> Herby


--
Nicolas Petton
http://nicolas-petton.fr

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.