Boost logo

Boost :

From: David A. Greene (greened_at_[hidden])
Date: 2002-01-17 12:24:24


Vladimir Prus wrote:

> I'm sorry for extremely delayed reply -- I've missed the message I'm
> responding to.

No worries. I think we're mostly on the same page.

> Another attactive aspect of separation is that it would allow to write an
> *extremely* lightweight syntax parser, that will be usable separately. I
> guess someone will want to use only it, without any semantic features like
> validation.

Very good point. I now agree with you that syntax and
semantics should be separate. I was getting caught up
in the syntax for specifying options and confusing the
issue in my mind. :)

>>It's essentially the system you describe except that, as
>>you note, the syntax and semantics are mixed. I am starting
>>to like your separation idea. The academic in me is
>>starting to show. :)
>
> Good. Probably, we can refine the design for mutual benefit :-)

Absolutely. I may do some playing around with Spirit over the
next couple of weeks just to become familiar with the tool.
As an exercise I plan to implement our current CLA syntax.
But don't hold your breath -- I'm also trying to graduate. :)

>
>>That said, I still don't like this sort of syntax:
>>
>>parseOptions(argc, argv);
>>
>>if (wasPassed(options, "some-option-name")) {
>> doSomeOptionNameAction();
>>}
>>
> Sorry, but it is *not* my syntax.

My apologies. The quoting got messed up somewhere along the
way. In any event, it was important for me to explain why
the syntax (which was proposed by someone whose name escapes
me) isn't right for me.

>>I still much prefer this:
>>
>>options.register("some-option-name", "some-option-help",
>> someOptionSemanticActionFunctor());
>>
>>options.parse(argc, argv);
>>
>>It keeps everything more "together." The semantics
>>invocation can still be delayed with the model.
>
> Well... except for some details, this is the same method of describing
> options that I use!

I think we're pretty much in agreement, then. :)

                        -Dave

-- 
"Some little people have music in them, but Fats, he was all music,
  and you know how big he was."  --  James P. Johnson

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk