haXe get string interpolation

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

haXe get string interpolation

Nicolas Cannasse
Hi,

I have commited on SVN the new Std.format method which allow you to use
String interpolation with compile time error reporting :

http://haxe.org/manual/string_interpolation

Now available on all platforms.

Enjoy !

Nicolas

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

Re: haXe get string interpolation

Franco Ponticelli
After all Dash is not that bad of an influence ;)

On Wed, Oct 12, 2011 at 10:40 PM, Nicolas Cannasse <[hidden email]> wrote:
Hi,

I have commited on SVN the new Std.format method which allow you to use String interpolation with compile time error reporting :

http://haxe.org/manual/string_interpolation

Now available on all platforms.

Enjoy !

Nicolas

--
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: haXe get string interpolation

sledorze
In reply to this post by Nicolas Cannasse
is it reentrant?
are you trying to make erazor obsolete?
:)
Reply | Threaded
Open this post in threaded view
|

Re: haXe get string interpolation

Nicolas Cannasse
In reply to this post by Franco Ponticelli
Le 12/10/2011 23:44, Franco Ponticelli a écrit :
> After all Dash is not that bad of an influence ;)

Well that was the trigger to include it as Std ;)
But it was already used although less well designed in
haxe.macro.DefaultJSGenerator for instance.

Best,
Nicolas


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

Re: haXe get string interpolation

sledorze
In reply to this post by sledorze
Yes you did..
Reply | Threaded
Open this post in threaded view
|

Re: haXe get string interpolation

Nicolas Cannasse
In reply to this post by sledorze
Le 12/10/2011 23:51, sledorze a écrit :
> is it reentrant?

Yes

> are you trying to make erazor obsolete?
> :)

Not at all ;)

Templates languages are still very useful since you don't have to
recompile your app in order to change your website design (for instant)

Best,
Nicolas

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

Re: haXe get string interpolation

Jason O'Neil-2
In reply to this post by Nicolas Cannasse

> Enjoy !

I think I will... Very nice indeed!

Thanks
Jason


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

Re: haXe get string interpolation

sledorze
Will you changed your tutorial?
or add a variation in addition to erazor?
Reply | Threaded
Open this post in threaded view
|

Re: haXe get string interpolation

Jason O'Neil-2

I think for full blown web apps erazor will still provide a better separation of logic, presentation and content, so I'm going to continue with that for now.  Also because new Std.format() runs at compile time, it does not allow you to pass a variable string, only a literal string - so there is still plenty of room for other templating technologies :)

But I can imagine many uses where quick variable interpolation like this:

trace (Std.format("There was an error loading the file $filename from the directory $dirname, the error message was: $error"));

would be much nicer than:

trace ("There was an error loading the file " + filename + " from the directory " + dirname + ", the error message was: " + error);

I'd even be tempted to create my own custom trace that automatically uses Std.format()

Jason
 
On Oct 13, 2011 6:43 AM, "sledorze" <[hidden email]> wrote:
Will you changed your tutorial?
or add a variation in addition to erazor?


--
View this message in context: http://haxe.1354130.n2.nabble.com/haXe-get-string-interpolation-tp6886846p6887009.html
Sent from the Haxe mailing list archive at Nabble.com.

--
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: haXe get string interpolation

Baluta Cristian
In reply to this post by Nicolas Cannasse
This is fantastic, much better than a standard log command

Baluta Cristian
http://imagin.ro

On 12.10.2011, at 22:40, Nicolas Cannasse <[hidden email]> wrote:

> Hi,
>
> I have commited on SVN the new Std.format method which allow you to use String interpolation with compile time error reporting :
>
> http://haxe.org/manual/string_interpolation
>
> Now available on all platforms.
>
> Enjoy !
>
> Nicolas
>
> --
> 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: haXe get string interpolation

sledorze
In reply to this post by Jason O'Neil-2
I understand and you're right.
However, I've been caught many time by runtime errors with erazor while refactoring.
I am lazy, I like my compiler warns me.
So on small one person project I think I will use this quicker path.
As for css I use less with client side execution.
Just want to do RAD really quickly, so it's a bless for me :)

Stephane

On Thu, Oct 13, 2011 at 4:40 AM, Jason O'Neil-2 [via Haxe] <[hidden email]> wrote:

I think for full blown web apps erazor will still provide a better separation of logic, presentation and content, so I'm going to continue with that for now.  Also because new Std.format() runs at compile time, it does not allow you to pass a variable string, only a literal string - so there is still plenty of room for other templating technologies :)

But I can imagine many uses where quick variable interpolation like this:

trace (Std.format("There was an error loading the file $filename from the directory $dirname, the error message was: $error"));

would be much nicer than:

trace ("There was an error loading the file " + filename + " from the directory " + dirname + ", the error message was: " + error);

I'd even be tempted to create my own custom trace that automatically uses Std.format()

Jason
 
On Oct 13, 2011 6:43 AM, "sledorze" <[hidden email]> wrote:
Will you changed your tutorial?
or add a variation in addition to erazor?


--
View this message in context: http://haxe.1354130.n2.nabble.com/haXe-get-string-interpolation-tp6886846p6887009.html
Sent from the Haxe mailing list archive at Nabble.com.


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

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


If you reply to this email, your message will be added to the discussion below:
http://haxe.1354130.n2.nabble.com/haXe-get-string-interpolation-tp6886846p6887420.html
To unsubscribe from haXe get string interpolation, click here.



--
Stéphane Le Dorze


Reply | Threaded
Open this post in threaded view
|

Re: haXe get string interpolation

Baluta Cristian
Btw, would be mega cool if the trace function will use Std.format by default.


On Thu, Oct 13, 2011 at 9:22 AM, sledorze <[hidden email]> wrote:
I understand and you're right.
However, I've been caught many time by runtime errors with erazor while refactoring.
I am lazy, I like my compiler warns me.
So on small one person project I think I will use this quicker path.
As for css I use less with client side execution.
Just want to do RAD really quickly, so it's a bless for me :)

Stephane

On Thu, Oct 13, 2011 at 4:40 AM, Jason O'Neil-2 [via Haxe] <[hidden email]> wrote:

I think for full blown web apps erazor will still provide a better separation of logic, presentation and content, so I'm going to continue with that for now.  Also because new Std.format() runs at compile time, it does not allow you to pass a variable string, only a literal string - so there is still plenty of room for other templating technologies :)

But I can imagine many uses where quick variable interpolation like this:

trace (Std.format("There was an error loading the file $filename from the directory $dirname, the error message was: $error"));

would be much nicer than:

trace ("There was an error loading the file " + filename + " from the directory " + dirname + ", the error message was: " + error);

I'd even be tempted to create my own custom trace that automatically uses Std.format()

Jason
 
On Oct 13, 2011 6:43 AM, "sledorze" <[hidden email]> wrote:
Will you changed your tutorial?
or add a variation in addition to erazor?


--
View this message in context: http://haxe.1354130.n2.nabble.com/haXe-get-string-interpolation-tp6886846p6887009.html
Sent from the Haxe mailing list archive at Nabble.com.


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

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


If you reply to this email, your message will be added to the discussion below:
http://haxe.1354130.n2.nabble.com/haXe-get-string-interpolation-tp6886846p6887420.html
To unsubscribe from haXe get string interpolation, click here.



--
Stéphane Le Dorze


Tel: <a href="tel:%2B33%20%280%29%206%2008%20%C2%A076%2070%2015" value="+33608767015" target="_blank">+33 (0) 6 08  76 70 15




View this message in context: Re: haXe get string interpolation

Sent from the Haxe mailing list archive at Nabble.com.

--
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: haXe get string interpolation

sledorze
or have an alternative naming to prevent breaking too much stuff (or in 3.0 ??)

On Thu, Oct 13, 2011 at 10:32 AM, Baluta Cristian [via Haxe] <[hidden email]> wrote:
Btw, would be mega cool if the trace function will use Std.format by default.


On Thu, Oct 13, 2011 at 9:22 AM, sledorze <[hidden email]> wrote:
I understand and you're right.
However, I've been caught many time by runtime errors with erazor while refactoring.
I am lazy, I like my compiler warns me.
So on small one person project I think I will use this quicker path.
As for css I use less with client side execution.
Just want to do RAD really quickly, so it's a bless for me :)

Stephane

On Thu, Oct 13, 2011 at 4:40 AM, Jason O'Neil-2 [via Haxe] <[hidden email]> wrote:

I think for full blown web apps erazor will still provide a better separation of logic, presentation and content, so I'm going to continue with that for now.  Also because new Std.format() runs at compile time, it does not allow you to pass a variable string, only a literal string - so there is still plenty of room for other templating technologies :)

But I can imagine many uses where quick variable interpolation like this:

trace (Std.format("There was an error loading the file $filename from the directory $dirname, the error message was: $error"));

would be much nicer than:

trace ("There was an error loading the file " + filename + " from the directory " + dirname + ", the error message was: " + error);

I'd even be tempted to create my own custom trace that automatically uses Std.format()

Jason
 
On Oct 13, 2011 6:43 AM, "sledorze" <[hidden email]> wrote:
Will you changed your tutorial?
or add a variation in addition to erazor?


--
View this message in context: http://haxe.1354130.n2.nabble.com/haXe-get-string-interpolation-tp6886846p6887009.html
Sent from the Haxe mailing list archive at Nabble.com.


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

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


If you reply to this email, your message will be added to the discussion below:
http://haxe.1354130.n2.nabble.com/haXe-get-string-interpolation-tp6886846p6887420.html
To unsubscribe from haXe get string interpolation, click here.



--
Stéphane Le Dorze
Tel: <a href="tel:%2B33%20%280%29%206%2008%20%C2%A076%2070%2015" value="<a href="tel:%2B33608767015" value="+33608767015" target="_blank">+33608767015" target="_blank"><a href="tel:%2B33%20%280%29%206%2008%20%C2%A076%2070%2015" value="+33608767015" target="_blank">+33 (0) 6 08  76 70 15




View this message in context: Re: haXe get string interpolation

Sent from the Haxe mailing list archive at Nabble.com.

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


If you reply to this email, your message will be added to the discussion below:
http://haxe.1354130.n2.nabble.com/haXe-get-string-interpolation-tp6886846p6888089.html
To unsubscribe from haXe get string interpolation, click here.



--
Stéphane Le Dorze


Reply | Threaded
Open this post in threaded view
|

Re: haXe get string interpolation

Franco Ponticelli
In reply to this post by sledorze
On Thu, Oct 13, 2011 at 9:22 AM, sledorze <[hidden email]> wrote:
I understand and you're right.
However, I've been caught many time by runtime errors with erazor while refactoring.
I am lazy, I like my compiler warns me.

I have a feature I'd love to add to erazor that is in my mind for a very long time now. Adding compile-time templates. Basically you point a folder of templates and through macros or an app they are transformed in haXe classes. If I only had the time :)

Franco

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

Re: haXe get string interpolation

Gamehaxe
While we are pinching ideas from dart, could we add this one,
to "ease the burden".  Perhaps even go one step better (we always do)
and allow arbitrary expressions.

If an instance variable declaration has one of the forms T v = e;, var v =
e;, final T v = e; or final v = e; then the expression e must be a  
compile-time
constant (10.1).
In Dart, all uninitialized variables have the value null, regardless of  
type.
Numeric variables in particular are therefore best explicitly initialized;  
such vari-
ables will not be initialized to 0 by default. The form above is intended  
to ease
the burden of such initialization.

Hugh


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