pass a compile time string?

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

pass a compile time string?

Alex Liebert
is it possible to pass a string to the haxe compiler and access it in code? (similar to defines and conditional compilation but with a string instead of bool?)
--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: pass a compile time string?

Baluta Cristian
Are the resources good for you? http://haxe.org/doc/advanced/resources

On Tue, Jul 19, 2011 at 9:30 PM, Alex Liebert <[hidden email]> wrote:
is it possible to pass a string to the haxe compiler and access it in code? (similar to defines and conditional compilation but with a string instead of bool?)
--
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: pass a compile time string?

Alex Liebert
I use them for other things but I'd prefer to pass small strings directly instead of having to create a text file- is that possible?

Thanks! Alex

On Tue, Jul 19, 2011 at 12:29 PM, Baluta Cristian <[hidden email]> wrote:
Are the resources good for you? http://haxe.org/doc/advanced/resources

On Tue, Jul 19, 2011 at 9:30 PM, Alex Liebert <[hidden email]> wrote:
is it possible to pass a string to the haxe compiler and access it in code? (similar to defines and conditional compilation but with a string instead of bool?)
--
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


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

Re: pass a compile time string?

Franco Ponticelli
In reply to this post by Baluta Cristian
You can also read some config file using macros.

Franco

On Tue, Jul 19, 2011 at 1:29 PM, Baluta Cristian <[hidden email]> wrote:
Are the resources good for you? http://haxe.org/doc/advanced/resources

On Tue, Jul 19, 2011 at 9:30 PM, Alex Liebert <[hidden email]> wrote:
is it possible to pass a string to the haxe compiler and access it in code? (similar to defines and conditional compilation but with a string instead of bool?)
--
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


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

Re: pass a compile time string?

Baluta Cristian
I'm using this on top of the hxml to write a class with the current date:

-cmd echo "class Now { public static var date = '`date`'; }" > src/Model/Now.hx


On Tue, Jul 19, 2011 at 11:04 PM, Franco Ponticelli <[hidden email]> wrote:
You can also read some config file using macros.

Franco


On Tue, Jul 19, 2011 at 1:29 PM, Baluta Cristian <[hidden email]> wrote:
Are the resources good for you? http://haxe.org/doc/advanced/resources

On Tue, Jul 19, 2011 at 9:30 PM, Alex Liebert <[hidden email]> wrote:
is it possible to pass a string to the haxe compiler and access it in code? (similar to defines and conditional compilation but with a string instead of bool?)
--
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


--
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: pass a compile time string?

Justin Donaldson-3
Yep, had the same thought:

-cmd echo "some string" > tmp.txt
--next
-cp src
-main Test
-x bin/Test.n
-resource tmp.txt@welcome

On Tue, Jul 19, 2011 at 1:46 PM, Baluta Cristian <[hidden email]> wrote:
I'm using this on top of the hxml to write a class with the current date:

-cmd echo "class Now { public static var date = '`date`'; }" > src/Model/Now.hx


On Tue, Jul 19, 2011 at 11:04 PM, Franco Ponticelli <[hidden email]> wrote:
You can also read some config file using macros.

Franco


On Tue, Jul 19, 2011 at 1:29 PM, Baluta Cristian <[hidden email]> wrote:
Are the resources good for you? http://haxe.org/doc/advanced/resources

On Tue, Jul 19, 2011 at 9:30 PM, Alex Liebert <[hidden email]> wrote:
is it possible to pass a string to the haxe compiler and access it in code? (similar to defines and conditional compilation but with a string instead of bool?)
--
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


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


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

Re: pass a compile time string?

Baluta Cristian
But this is only because the date is updated automatically, for simple variables i have created a static class. I mean, you still need to edit something, being it in hxml or hx file.


On Wed, Jul 20, 2011 at 12:02 AM, Justin Donaldson <[hidden email]> wrote:
Yep, had the same thought:

-cmd echo "some string" > tmp.txt
--next
-cp src
-main Test
-x bin/Test.n
-resource tmp.txt@welcome


On Tue, Jul 19, 2011 at 1:46 PM, Baluta Cristian <[hidden email]> wrote:
I'm using this on top of the hxml to write a class with the current date:

-cmd echo "class Now { public static var date = '`date`'; }" > src/Model/Now.hx


On Tue, Jul 19, 2011 at 11:04 PM, Franco Ponticelli <[hidden email]> wrote:
You can also read some config file using macros.

Franco


On Tue, Jul 19, 2011 at 1:29 PM, Baluta Cristian <[hidden email]> wrote:
Are the resources good for you? http://haxe.org/doc/advanced/resources

On Tue, Jul 19, 2011 at 9:30 PM, Alex Liebert <[hidden email]> wrote:
is it possible to pass a string to the haxe compiler and access it in code? (similar to defines and conditional compilation but with a string instead of bool?)
--
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


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


--
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: pass a compile time string?

Alex Liebert
Ok, thanks, that's not too bad.  I'm actually trying to pull off some conditional trickery in the NME Install Tool so I'll have to rethink it.

On Tue, Jul 19, 2011 at 8:27 PM, Baluta Cristian <[hidden email]> wrote:
But this is only because the date is updated automatically, for simple variables i have created a static class. I mean, you still need to edit something, being it in hxml or hx file.


On Wed, Jul 20, 2011 at 12:02 AM, Justin Donaldson <[hidden email]> wrote:
Yep, had the same thought:

-cmd echo "some string" > tmp.txt
--next
-cp src
-main Test
-x bin/Test.n
-resource tmp.txt@welcome


On Tue, Jul 19, 2011 at 1:46 PM, Baluta Cristian <[hidden email]> wrote:
I'm using this on top of the hxml to write a class with the current date:

-cmd echo "class Now { public static var date = '`date`'; }" > src/Model/Now.hx


On Tue, Jul 19, 2011 at 11:04 PM, Franco Ponticelli <[hidden email]> wrote:
You can also read some config file using macros.

Franco


On Tue, Jul 19, 2011 at 1:29 PM, Baluta Cristian <[hidden email]> wrote:
Are the resources good for you? http://haxe.org/doc/advanced/resources

On Tue, Jul 19, 2011 at 9:30 PM, Alex Liebert <[hidden email]> wrote:
is it possible to pass a string to the haxe compiler and access it in code? (similar to defines and conditional compilation but with a string instead of bool?)
--
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


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


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


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

Re: pass a compile time string?

Armén
The best way is to use macros. You avoid writing temporary stuff to
disk and get to stay within the comfortable haXe syntax.

/// Here is the class that lets you load a string of your choosing
"into the compiler" when invoking haXe (see below on invocation
details)

import haxe.macro.Expr;
import haxe.macro.Context;

class StringLoader
{
        static var str: String;

        #if macro

        static public function load_string(s: String)
        {
                str = s;
        }

        #end

        @:macro static public function get_string()
        {
                return {
                        expr: EConst(CString(str)),
                        pos: Context.currentPos() };
        }
}

And here is the class that tests the concept

class Test
{
        static function main()
        {
                trace(StringLoader.get_string()); /// This will actually be replaced
by haXe itself into an expression of the form 'trace("Hello world!");'
even BEFORE haXe starts compiling it, by the "macro processor"
        }
}

You can test the above with the following (you only need to add
platform specific switches to generate code for the platform of your
choosing):

haxe --macro "StringLoader.load_string('Hello world!')" -main Test

As you can see the macro function call code is escaped with double
quotes, because otherwise a shell like `bash or `sh will complain of
the round brackets and single quotes in all the wrong places.

One should also probably exclude the code for the StringBuilder class
itself from being injected into whatever haXe will produce, because
there most likely is no use for the class at runtime.

On Wed, Jul 20, 2011 at 08:50, Alex Liebert <[hidden email]> wrote:

> Ok, thanks, that's not too bad.  I'm actually trying to pull off some
> conditional trickery in the NME Install Tool so I'll have to rethink it.
>
> On Tue, Jul 19, 2011 at 8:27 PM, Baluta Cristian <[hidden email]>
> wrote:
>>
>> But this is only because the date is updated automatically, for simple
>> variables i have created a static class. I mean, you still need to edit
>> something, being it in hxml or hx file.
>>
>> On Wed, Jul 20, 2011 at 12:02 AM, Justin Donaldson <[hidden email]>
>> wrote:
>>>
>>> Yep, had the same thought:
>>>
>>> -cmd echo "some string" > tmp.txt
>>> --next
>>> -cp src
>>> -main Test
>>> -x bin/Test.n
>>> -resource tmp.txt@welcome
>>>
>>> On Tue, Jul 19, 2011 at 1:46 PM, Baluta Cristian
>>> <[hidden email]> wrote:
>>>>
>>>> I'm using this on top of the hxml to write a class with the current
>>>> date:
>>>> -cmd echo "class Now { public static var date = '`date`'; }" >
>>>> src/Model/Now.hx
>>>>
>>>> On Tue, Jul 19, 2011 at 11:04 PM, Franco Ponticelli
>>>> <[hidden email]> wrote:
>>>>>
>>>>> You can also read some config file using macros.
>>>>> Franco
>>>>>
>>>>> On Tue, Jul 19, 2011 at 1:29 PM, Baluta Cristian
>>>>> <[hidden email]> wrote:
>>>>>>
>>>>>> Are the resources good for you? http://haxe.org/doc/advanced/resources
>>>>>>
>>>>>> On Tue, Jul 19, 2011 at 9:30 PM, Alex Liebert
>>>>>> <[hidden email]> wrote:
>>>>>>>
>>>>>>> is it possible to pass a string to the haxe compiler and access it in
>>>>>>> code? (similar to defines and conditional compilation but with a string
>>>>>>> instead of bool?)
>>>>>>> --
>>>>>>> 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
>>>>>
>>>>>
>>>>> --
>>>>> 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
>>>
>>>
>>> --
>>> 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
>
>
> --
> 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: pass a compile time string?

Johann Borck
In reply to this post by Alex Liebert
On 07/20/2011 06:50 AM, Alex Liebert wrote:
> Ok, thanks, that's not too bad.  I'm actually trying to pull off some conditional trickery in the
> NME Install Tool so I'll have to rethink it.
>
Maybe I don't really understand what you want but isn't the Metadata API (
http://haxe.org/manual/metadata ) exactly what you need?

hth, Johann


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

Re: pass a compile time string?

Yanis Benson

flashtools library allows to read yaml files and expose them as native construction. This part works not only for flash. It doesn't support macros at the moment, only class generation by -cmd haxelib run flashtools ... but I plan to add this in near time.

On 20 Jul 2011 16:28, "Johann Borck" <[hidden email]> wrote:
> On 07/20/2011 06:50 AM, Alex Liebert wrote:
>> Ok, thanks, that's not too bad. I'm actually trying to pull off some conditional trickery in the
>> NME Install Tool so I'll have to rethink it.
>>
> Maybe I don't really understand what you want but isn't the Metadata API (
> http://haxe.org/manual/metadata ) exactly what you need?
>
> hth, Johann
>
>
> --
> 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: pass a compile time string?

Justin Donaldson-3
In reply to this post by Armén
Nice trick

On Wed, Jul 20, 2011 at 5:00 AM, Armén <[hidden email]> wrote:
The best way is to use macros. You avoid writing temporary stuff to
disk and get to stay within the comfortable haXe syntax.

/// Here is the class that lets you load a string of your choosing
"into the compiler" when invoking haXe (see below on invocation
details)

import haxe.macro.Expr;
import haxe.macro.Context;

class StringLoader
{
       static var str: String;

       #if macro

       static public function load_string(s: String)
       {
               str = s;
       }

       #end

       @:macro static public function get_string()
       {
               return {
                       expr: EConst(CString(str)),
                       pos: Context.currentPos() };
       }
}

And here is the class that tests the concept

class Test
{
       static function main()
       {
               trace(StringLoader.get_string()); /// This will actually be replaced
by haXe itself into an expression of the form 'trace("Hello world!");'
even BEFORE haXe starts compiling it, by the "macro processor"
       }
}

You can test the above with the following (you only need to add
platform specific switches to generate code for the platform of your
choosing):

haxe --macro "StringLoader.load_string('Hello world!')" -main Test

As you can see the macro function call code is escaped with double
quotes, because otherwise a shell like `bash or `sh will complain of
the round brackets and single quotes in all the wrong places.

One should also probably exclude the code for the StringBuilder class
itself from being injected into whatever haXe will produce, because
there most likely is no use for the class at runtime.

On Wed, Jul 20, 2011 at 08:50, Alex Liebert <[hidden email]> wrote:
> Ok, thanks, that's not too bad.  I'm actually trying to pull off some
> conditional trickery in the NME Install Tool so I'll have to rethink it.
>
> On Tue, Jul 19, 2011 at 8:27 PM, Baluta Cristian <[hidden email]>
> wrote:
>>
>> But this is only because the date is updated automatically, for simple
>> variables i have created a static class. I mean, you still need to edit
>> something, being it in hxml or hx file.
>>
>> On Wed, Jul 20, 2011 at 12:02 AM, Justin Donaldson <[hidden email]>
>> wrote:
>>>
>>> Yep, had the same thought:
>>>
>>> -cmd echo "some string" > tmp.txt
>>> --next
>>> -cp src
>>> -main Test
>>> -x bin/Test.n
>>> -resource tmp.txt@welcome
>>>
>>> On Tue, Jul 19, 2011 at 1:46 PM, Baluta Cristian
>>> <[hidden email]> wrote:
>>>>
>>>> I'm using this on top of the hxml to write a class with the current
>>>> date:
>>>> -cmd echo "class Now { public static var date = '`date`'; }" >
>>>> src/Model/Now.hx
>>>>
>>>> On Tue, Jul 19, 2011 at 11:04 PM, Franco Ponticelli
>>>> <[hidden email]> wrote:
>>>>>
>>>>> You can also read some config file using macros.
>>>>> Franco
>>>>>
>>>>> On Tue, Jul 19, 2011 at 1:29 PM, Baluta Cristian
>>>>> <[hidden email]> wrote:
>>>>>>
>>>>>> Are the resources good for you? http://haxe.org/doc/advanced/resources
>>>>>>
>>>>>> On Tue, Jul 19, 2011 at 9:30 PM, Alex Liebert
>>>>>> <[hidden email]> wrote:
>>>>>>>
>>>>>>> is it possible to pass a string to the haxe compiler and access it in
>>>>>>> code? (similar to defines and conditional compilation but with a string
>>>>>>> instead of bool?)
>>>>>>> --
>>>>>>> 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
>>>>>
>>>>>
>>>>> --
>>>>> 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
>>>
>>>
>>> --
>>> 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
>
>
> --
> 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: pass a compile time string?

Franco Ponticelli
In reply to this post by Yanis Benson
Adding on that in thx there are decoders for json and ini formats, so you can use those paired with macros to have compile time configuration parameters.
Yaml is on my todo list.

Franco

On Wed, Jul 20, 2011 at 6:51 AM, Yanis Benson <[hidden email]> wrote:

flashtools library allows to read yaml files and expose them as native construction. This part works not only for flash. It doesn't support macros at the moment, only class generation by -cmd haxelib run flashtools ... but I plan to add this in near time.

On 20 Jul 2011 16:28, "Johann Borck" <[hidden email]> wrote:
> On 07/20/2011 06:50 AM, Alex Liebert wrote:
>> Ok, thanks, that's not too bad. I'm actually trying to pull off some conditional trickery in the
>> NME Install Tool so I'll have to rethink it.
>>
> Maybe I don't really understand what you want but isn't the Metadata API (
> http://haxe.org/manual/metadata ) exactly what you need?
>
> hth, Johann
>
>
> --
> 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: pass a compile time string?

Justin Donaldson-3
Great, yaml option objects would be cool, and could be very powerful for mocking up more sophisticated objects.

-Justin

On Wed, Jul 20, 2011 at 2:55 PM, Franco Ponticelli <[hidden email]> wrote:
Adding on that in thx there are decoders for json and ini formats, so you can use those paired with macros to have compile time configuration parameters.
Yaml is on my todo list.

Franco

On Wed, Jul 20, 2011 at 6:51 AM, Yanis Benson <[hidden email]> wrote:

flashtools library allows to read yaml files and expose them as native construction. This part works not only for flash. It doesn't support macros at the moment, only class generation by -cmd haxelib run flashtools ... but I plan to add this in near time.

On 20 Jul 2011 16:28, "Johann Borck" <[hidden email]> wrote:
> On 07/20/2011 06:50 AM, Alex Liebert wrote:
>> Ok, thanks, that's not too bad. I'm actually trying to pull off some conditional trickery in the
>> NME Install Tool so I'll have to rethink it.
>>
> Maybe I don't really understand what you want but isn't the Metadata API (
> http://haxe.org/manual/metadata ) exactly what you need?
>
> hth, Johann
>
>
> --
> 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


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

Re: pass a compile time string?

Alex Liebert
i'm going to try to wrap my hound around the macro option.  lots of useful stuff there but I really don't understand how to use it yet.

that said a resource or option like -resource "kongregate"@platform would be awesome.

Alex

On Wed, Jul 20, 2011 at 3:20 PM, Justin Donaldson <[hidden email]> wrote:
Great, yaml option objects would be cool, and could be very powerful for mocking up more sophisticated objects.

-Justin

On Wed, Jul 20, 2011 at 2:55 PM, Franco Ponticelli <[hidden email]> wrote:
Adding on that in thx there are decoders for json and ini formats, so you can use those paired with macros to have compile time configuration parameters.
Yaml is on my todo list.

Franco

On Wed, Jul 20, 2011 at 6:51 AM, Yanis Benson <[hidden email]> wrote:

flashtools library allows to read yaml files and expose them as native construction. This part works not only for flash. It doesn't support macros at the moment, only class generation by -cmd haxelib run flashtools ... but I plan to add this in near time.

On 20 Jul 2011 16:28, "Johann Borck" <[hidden email]> wrote:
> On 07/20/2011 06:50 AM, Alex Liebert wrote:
>> Ok, thanks, that's not too bad. I'm actually trying to pull off some conditional trickery in the
>> NME Install Tool so I'll have to rethink it.
>>
> Maybe I don't really understand what you want but isn't the Metadata API (
> http://haxe.org/manual/metadata ) exactly what you need?
>
> hth, Johann
>
>
> --
> 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


--
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: Re: [haXe] pass a compile time string?

Rob Fell
In reply to this post by Justin Donaldson-3
A slight aside, but I use this "resource" method to include repository
revision in each build (useful for issue tracking):

In the hxml:
-cmd "C:\Program Files\TortoiseSVN\bin\SubWCRev.exe" revision.template
revision.txt
[include other compiler commands]
-resource revision.txt@revision

With revision.template containing:
$WCREV$

And the resource extraction in the source code:
var revision:String = haxe.Resource.getString( "revision" );

For SWF I display this revision info in a ContextMenu etc. The above
uses TortoiseSVN on Windows (there are probably alternatives for other
platforms?).

I also like that haxe.Resource bytes are "tucked away", neither in the
code, nor in a configuration file. A useful third option.



On 11:59 AM, Justin Donaldson wrote:

> Yep, had the same thought:
>
> -cmd echo "some string" > tmp.txt
> --next
> -cp src
> -main Test
> -x bin/Test.n
> -resource tmp.txt@welcome
>
> On Tue, Jul 19, 2011 at 1:46 PM, Baluta Cristian
> <[hidden email] <mailto:[hidden email]>> wrote:
>
>     I'm using this on top of the hxml to write a class with the
>     current date:
>
>     -cmd echo "class Now { public static var date = '`date`'; }" >
>     src/Model/Now.hx
>
>
>     On Tue, Jul 19, 2011 at 11:04 PM, Franco Ponticelli
>     <[hidden email] <mailto:[hidden email]>>
>     wrote:
>
>         You can also read some config file using macros.
>
>         Franco
>
>
>         On Tue, Jul 19, 2011 at 1:29 PM, Baluta Cristian
>         <[hidden email] <mailto:[hidden email]>> wrote:
>
>             Are the resources good for you?
>             http://haxe.org/doc/advanced/resources
>
>             On Tue, Jul 19, 2011 at 9:30 PM, Alex Liebert
>             <[hidden email]
>             <mailto:[hidden email]>> wrote:
>
>                 is it possible to pass a string to the haxe compiler
>                 and access it in code? (similar to defines and
>                 conditional compilation but with a string instead of
>                 bool?)
>                 --
>                 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
>
>
>
>         --
>         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
>
>


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