Re: How to best implement a DSL?

2018-08-24 Thread Matthew OConnor via Digitalmars-d-learn

On Saturday, 28 July 2018 at 17:01:22 UTC, rikki cattermole wrote:

You missed my point here.
There is nothing special about parsing at CTFE, you're just 
restricted as to the language features you can use (e.g. no 
extern's), that's it.


Is there an example of how this could be done?



"The D Way" to run a sequence of executables?

2018-08-24 Thread Matthew OConnor via Digitalmars-d-learn
I'd like to run a sequence of executables with something like 
std.process.execute, but I would like the sequence to error out 
if one of the executables returns a non-zero return code. What is 
the recommended way to do this? A wrapper that throws exceptions? 
Checking return values?


Using dub and rdmd together?

2018-07-11 Thread Matthew OConnor via Digitalmars-d-learn
Hi, I'm new to D and trying to make some command line tools that 
are run with `#!/usr/bin/env rdmd`. But I would also like to 
reference external packages from dub. I know I can do this with:



#!/usr/bin/env dub
/+ dub.sdl:
  name "get"
  dependency "requests" version="~>0.3.2"
+/

But when I run it (with `dub get.d` on Windows), it rebuilds 
every time.


Is there a way to integrate the two so that `rdmd` is used for 
the builds, but `dub` is used to download the necessary packages?


Thanks,
Matthew