$ variable names

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

$ variable names

Nathan
Hi,

Is there a reason haXe doesn't allow $ as (or in) a variable name? given
that it could rename the var on targets that don't support it.

If supported, it would allow for very easy migration of code which uses
certain target specific ultra-common libraries.

Best,

Nathan

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: $ variable names

blackdog-2
this would be very useful I e.g. mongodb has a little key dsl language
this utilises $ chars, and it's a work around to deal with it - useful,
but it won't happen :)

bd

On 08/16/2010 10:06 AM, Nathan wrote:

> Hi,
>
> Is there a reason haXe doesn't allow $ as (or in) a variable name? given
> that it could rename the var on targets that don't support it.
>
> If supported, it would allow for very easy migration of code which uses
> certain target specific ultra-common libraries.
>
> Best,
>
> Nathan
>


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: $ variable names

Nathan
obvious question then, why won't it happen?

Ritchie Turner wrote:

> this would be very useful I e.g. mongodb has a little key dsl language
> this utilises $ chars, and it's a work around to deal with it - useful,
> but it won't happen :)
>
> bd
>
> On 08/16/2010 10:06 AM, Nathan wrote:
>> Hi,
>>
>> Is there a reason haXe doesn't allow $ as (or in) a variable name? given
>> that it could rename the var on targets that don't support it.
>>
>> If supported, it would allow for very easy migration of code which uses
>> certain target specific ultra-common libraries.
>>
>> Best,
>>
>> Nathan
>>
>
>
>


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: $ variable names

Benjamin Dasnois
My quick take on it without really analyzing: the parser would need to be modified, and that could bring problems with the PHP generator? And maybe with other generators too.



On Mon, Aug 16, 2010 at 5:44 PM, Nathan <[hidden email]> wrote:
obvious question then, why won't it happen?


Ritchie Turner wrote:
this would be very useful I e.g. mongodb has a little key dsl language
this utilises $ chars, and it's a work around to deal with it - useful,
but it won't happen :)

bd

On 08/16/2010 10:06 AM, Nathan wrote:
Hi,

Is there a reason haXe doesn't allow $ as (or in) a variable name? given
that it could rename the var on targets that don't support it.

If supported, it would allow for very easy migration of code which uses
certain target specific ultra-common libraries.

Best,

Nathan






--
haXe - an open source web programming language
http://haxe.org



--
DASNOIS Benjamin
http://www.benjamindasnois.com

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: $ variable names

Nathan
parser modification shouldn't be much to accept one new char, as for PHP
and targets which either don't support / already use $, then why not
simply rewrite the var names on the fly, haxe is a syntax after all and
not what you expect the output to look like.

Best,

Nathan

Benjamin Dasnois wrote:

> My quick take on it without really analyzing: the parser would need to be
> modified, and that could bring problems with the PHP generator? And maybe
> with other generators too.
>
>
>
> On Mon, Aug 16, 2010 at 5:44 PM, Nathan <[hidden email]> wrote:
>
>> obvious question then, why won't it happen?
>>
>>
>> Ritchie Turner wrote:
>>
>>> this would be very useful I e.g. mongodb has a little key dsl language
>>> this utilises $ chars, and it's a work around to deal with it - useful,
>>> but it won't happen :)
>>>
>>> bd
>>>
>>> On 08/16/2010 10:06 AM, Nathan wrote:
>>>
>>>> Hi,
>>>>
>>>> Is there a reason haXe doesn't allow $ as (or in) a variable name? given
>>>> that it could rename the var on targets that don't support it.
>>>>
>>>> If supported, it would allow for very easy migration of code which uses
>>>> certain target specific ultra-common libraries.
>>>>
>>>> Best,
>>>>
>>>> Nathan
>>>>
>>>>
>>>
>>>
>> --
>> haXe - an open source web programming language
>> http://haxe.org
>>
>
>
>


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: $ variable names

Franco Ponticelli
One issue with name rewrite is that it doesn't play well with reflection. $ vars are already used in generated code for that reason, to not conflict with user vars ... sure we can find another special char but I guess that will never end :)

On Mon, Aug 16, 2010 at 5:20 PM, Nathan <[hidden email]> wrote:
parser modification shouldn't be much to accept one new char, as for PHP and targets which either don't support / already use $, then why not simply rewrite the var names on the fly, haxe is a syntax after all and not what you expect the output to look like.

Best,

Nathan


Benjamin Dasnois wrote:
My quick take on it without really analyzing: the parser would need to be
modified, and that could bring problems with the PHP generator? And maybe
with other generators too.



On Mon, Aug 16, 2010 at 5:44 PM, Nathan <[hidden email]> wrote:

obvious question then, why won't it happen?


Ritchie Turner wrote:

this would be very useful I e.g. mongodb has a little key dsl language
this utilises $ chars, and it's a work around to deal with it - useful,
but it won't happen :)

bd

On 08/16/2010 10:06 AM, Nathan wrote:

Hi,

Is there a reason haXe doesn't allow $ as (or in) a variable name? given
that it could rename the var on targets that don't support it.

If supported, it would allow for very easy migration of code which uses
certain target specific ultra-common libraries.

Best,

Nathan




--
haXe - an open source web programming language
http://haxe.org






--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: $ variable names

Baluta Cristian
what will happen with the language then? why don't we add cpp style also, then the next step is to simply write in the original targeted language.
i'm sarcastic here, sorry for offtopic.

On Mon, Aug 16, 2010 at 7:28 PM, Franco Ponticelli <[hidden email]> wrote:
One issue with name rewrite is that it doesn't play well with reflection. $ vars are already used in generated code for that reason, to not conflict with user vars ... sure we can find another special char but I guess that will never end :)


On Mon, Aug 16, 2010 at 5:20 PM, Nathan <[hidden email]> wrote:
parser modification shouldn't be much to accept one new char, as for PHP and targets which either don't support / already use $, then why not simply rewrite the var names on the fly, haxe is a syntax after all and not what you expect the output to look like.

Best,

Nathan


Benjamin Dasnois wrote:
My quick take on it without really analyzing: the parser would need to be
modified, and that could bring problems with the PHP generator? And maybe
with other generators too.



On Mon, Aug 16, 2010 at 5:44 PM, Nathan <[hidden email]> wrote:

obvious question then, why won't it happen?


Ritchie Turner wrote:

this would be very useful I e.g. mongodb has a little key dsl language
this utilises $ chars, and it's a work around to deal with it - useful,
but it won't happen :)

bd

On 08/16/2010 10:06 AM, Nathan wrote:

Hi,

Is there a reason haXe doesn't allow $ as (or in) a variable name? given
that it could rename the var on targets that don't support it.

If supported, it would allow for very easy migration of code which uses
certain target specific ultra-common libraries.

Best,

Nathan




--
haXe - an open source web programming language
http://haxe.org






--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org



--
Băluță Cristian
http://ralcr.com
http://imagin.ro

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: $ variable names

Justin Donaldson-2
HaXe isn't designed around global variables/methods.  AFAIK trace() is the only function Nicolas put in the global namespace.  I'm pretty sure he would see this as one of haXe's big features...  avoiding global methods means avoiding naming conflicts for big javascript libraries. 

I'm not sure if you use textmate or equivalent, but my approach has been to use Andy's jQuery library:
http://blog.onthewings.net/2010/08/03/using-jquery-in-haxe/

and then to set up a tab snippet for the dollar sign to generate "new JQuery(...)".  


-Justin

On Mon, Aug 16, 2010 at 10:48 AM, Baluta Cristian <[hidden email]> wrote:
what will happen with the language then? why don't we add cpp style also, then the next step is to simply write in the original targeted language.
i'm sarcastic here, sorry for offtopic.


On Mon, Aug 16, 2010 at 7:28 PM, Franco Ponticelli <[hidden email]> wrote:
One issue with name rewrite is that it doesn't play well with reflection. $ vars are already used in generated code for that reason, to not conflict with user vars ... sure we can find another special char but I guess that will never end :)


On Mon, Aug 16, 2010 at 5:20 PM, Nathan <[hidden email]> wrote:
parser modification shouldn't be much to accept one new char, as for PHP and targets which either don't support / already use $, then why not simply rewrite the var names on the fly, haxe is a syntax after all and not what you expect the output to look like.

Best,

Nathan


Benjamin Dasnois wrote:
My quick take on it without really analyzing: the parser would need to be
modified, and that could bring problems with the PHP generator? And maybe
with other generators too.



On Mon, Aug 16, 2010 at 5:44 PM, Nathan <[hidden email]> wrote:

obvious question then, why won't it happen?


Ritchie Turner wrote:

this would be very useful I e.g. mongodb has a little key dsl language
this utilises $ chars, and it's a work around to deal with it - useful,
but it won't happen :)

bd

On 08/16/2010 10:06 AM, Nathan wrote:

Hi,

Is there a reason haXe doesn't allow $ as (or in) a variable name? given
that it could rename the var on targets that don't support it.

If supported, it would allow for very easy migration of code which uses
certain target specific ultra-common libraries.

Best,

Nathan




--
haXe - an open source web programming language
http://haxe.org






--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org



--
Băluță Cristian
http://ralcr.com
http://imagin.ro

--
haXe - an open source web programming language
http://haxe.org



--
blog: http://www.scwn.net
aim: iujjd
twitter: jjdonald


--
haXe - an open source web programming language
http://haxe.org