Two standard libraries?
Chris Nicholson-Sauls
ibisbasenji at gmail.com
Tue Jul 31 19:04:48 PDT 2007
renoX wrote:
> Daniel Keep Wrote:
>> renoX wrote:
>>> I don't think that %08x{X} is ambiguous (and it has the advantage that it looks very much like printf formatter which is a plus in a language which is the successor of C/C++): anything between % and { is the 'formatter', anything inside {..} is the expression to be formatted.
>>>
>>> Could you explain why you think it's ambiguous?
> []
>> No, you're right; it's not ambiguous. I suppose I just don't like that
>> the format options aren't explicitly delimited by anything; the parser I
>> wrote for mine is a bit stricter.
>>
>> The other problem is that, as you said, it looks like a printf string.
>> My personal stance is that unless printf syntax is actually valid, it
>> shouldn't look like it is.
>
> I agree that if it looks like printf then it should behave like printf: that's why the printf syntax was also valid in the function I made and that the same formater had the same result.
>
>> I suppose it all boils down to taste in the end; viva-la-dollar! :)
>
> Well, using printf-like formatter in a language which reuse C/C++ syntax make more sense to me, but sure that's a matter of taste and in any case your $ notation is far better than what there is currently in the libraries..
>
> renoX
>> -- Daniel
>
Here's an odd thought: "%{08x:X}"
Wherein the {}'s mean, "this is looking at a variable outside", and the
':' means "everything after this point is the variable's name".
-- Chris Nicholson-Sauls
More information about the Digitalmars-d
mailing list