Re: Argon: an alternative parser for command-line arguments

2019-01-26 Thread Victor Porton via Digitalmars-d-announce

On Wednesday, 9 March 2016 at 18:56:10 UTC, Markus Laker wrote:

To support git-style syntax while using Argon, I'd do this:

1. Find the (possibly empty) initial sequence of tokens that 
start with a dash.  Pass them to an Argon-derived class which 
we'll call `Stem', which parses them.


2. If no more tokens exist (as in "my-command --help"), do what 
we can with the options we've seen, and then exit.


3. Otherwise, the next token must be a subcommand name: we've 
seen something "my-command --verbose display-widgets 
--paginate".
 Use that token to select a leaf class, also derived from 
Argon.  There's one leaf class per subcommand.


4. Pass the remaining tokens (in this example, just 
"--paginate") to the selected leaf pass for parsing.  Also pass 
a reference to Stem, so that the leaf code can use any options 
garnered by Stem.


It is a wrong way, because switches may have arguments (not 
starting with a dash).


I am now considering to write a new object-oriented command line 
parser from scratch because it is sometimes easier to write new 
code than to understand other's one.


It shouldn't be hard to write some reusable code to do this, if 
it were a common requirement.


Now D supports semantic Web (RDF and SPARQL particularly)

2019-01-22 Thread Victor Porton via Digitalmars-d-announce

Now D supports semantic Web (RDF and SPARQL particularly):

I've created a D wrapper around C semantic Web library librdf.

Here is the code (it also supports several other programming 
languages, particularly I did also Ada2012 wrapper, the Ada 
wrapper is however somehow not stable):


https://github.com/vporton/redland-bindings

See also https://codereview.stackexchange.com/q/212017/189213 
about some future plans and probable some future API 
incompatibility.


Please participate in code review and adding more unittests.