Re: weird behave of Array?

2019-07-28 Thread dmm via Digitalmars-d-learn
On Sunday, 28 July 2019 at 17:45:16 UTC, Adam D. Ruppe wrote: On Sunday, 28 July 2019 at 17:21:25 UTC, dmm wrote: test(str); The array is passed by value here, so changes to its ptr and length will not be seen outside the function. However, what goes *through* the pointer - which includes

Re: Calling / running / executing .d script from another .d script

2019-07-28 Thread Ali Çehreli via Digitalmars-d-learn
On 07/28/2019 05:56 AM, BoQsc wrote: Right now, I'm thinking what is correct way to run another .d script from a .d script. Do you have any suggestions? I can be easier than a shared library solution that Max Haughton described. (None of the following code are compiled.) If you have the foll

Re: vibe / self contained standalone executable?

2019-07-28 Thread bauss via Digitalmars-d-learn
On Sunday, 28 July 2019 at 18:54:37 UTC, Sebastiaan Koppe wrote: On Sunday, 28 July 2019 at 14:42:48 UTC, Robert M. Münch wrote: On 2019-07-28 14:14:06 +, Sebastiaan Koppe said: I am using https://dlang.org/spec/expression.html#import_expressions for text files. Don't know if it works on

Re: Calling / running / executing .d script from another .d script

2019-07-28 Thread Max Haughton via Digitalmars-d-learn
On Sunday, 28 July 2019 at 12:56:12 UTC, BoQsc wrote: Right now, I'm thinking what is correct way to run another .d script from a .d script. Do you have any suggestions? You'd need to bring a compiler with you and then build it into a shared library (then dlopen it). To do this you'd need a

Re: vibe / self contained standalone executable?

2019-07-28 Thread Sebastiaan Koppe via Digitalmars-d-learn
On Sunday, 28 July 2019 at 14:42:48 UTC, Robert M. Münch wrote: On 2019-07-28 14:14:06 +, Sebastiaan Koppe said: I am using https://dlang.org/spec/expression.html#import_expressions for text files. Don't know if it works on binary files as well. And this works than good together with the

Re: weird behave of Array?

2019-07-28 Thread Adam D. Ruppe via Digitalmars-d-learn
BTW If you want those length changes to be seen in the original, pass the array by ref to the functions doing the changes.

Re: weird behave of Array?

2019-07-28 Thread Adam D. Ruppe via Digitalmars-d-learn
On Sunday, 28 July 2019 at 17:21:25 UTC, dmm wrote: test(str); The array is passed by value here, so changes to its ptr and length will not be seen outside the function. However, what goes *through* the pointer - which includes the contents and the capacity - will be seen. The runtime tri

weird behave of Array?

2019-07-28 Thread dmm via Digitalmars-d-learn
import std.stdio : writefln; void test(string str) { writefln("%d, %d", str.length, str.capacity); str.length = 10; writefln("%d, %d", str.length, str.capacity); } void main() { string str; str.reserve(1024); //str.length = str.capacity; writefln("%d, %d", str.length, str.capacity)

Re: vibe / self contained standalone executable?

2019-07-28 Thread rikki cattermole via Digitalmars-d-learn
On 29/07/2019 2:42 AM, Robert M. Münch wrote: On 2019-07-28 14:14:06 +, Sebastiaan Koppe said: I am using https://dlang.org/spec/expression.html#import_expressions for text files. Don't know if it works on binary files as well. And this works than good together with the vibe framework? So

Re: vibe / self contained standalone executable?

2019-07-28 Thread Robert M. Münch via Digitalmars-d-learn
On 2019-07-28 14:14:06 +, Sebastiaan Koppe said: I am using https://dlang.org/spec/expression.html#import_expressions for text files. Don't know if it works on binary files as well. And this works than good together with the vibe framework? So, it's not requiring or forcing one to use fil

Re: vibe / self contained standalone executable?

2019-07-28 Thread bauss via Digitalmars-d-learn
On Sunday, 28 July 2019 at 14:14:06 UTC, Sebastiaan Koppe wrote: On Sunday, 28 July 2019 at 13:45:50 UTC, Robert M. Münch wrote: Is it possible to pack a complete "web-app" (serving web-pages and providing REST API) into a single executable so that no other files need to be accessed and everyth

Re: vibe / self contained standalone executable?

2019-07-28 Thread Sebastiaan Koppe via Digitalmars-d-learn
On Sunday, 28 July 2019 at 13:45:50 UTC, Robert M. Münch wrote: Is it possible to pack a complete "web-app" (serving web-pages and providing REST API) into a single executable so that no other files need to be accessed and everything is servered from something like a "virtual filesystem" which

vibe / self contained standalone executable?

2019-07-28 Thread Robert M. Münch via Digitalmars-d-learn
Is it possible to pack a complete "web-app" (serving web-pages and providing REST API) into a single executable so that no other files need to be accessed and everything is servered from something like a "virtual filesystem" which is in memory only? -- Robert M. Münch http://www.saphirion.com

Calling / running / executing .d script from another .d script

2019-07-28 Thread BoQsc via Digitalmars-d-learn
Right now, I'm thinking what is correct way to run another .d script from a .d script. Do you have any suggestions?