Zcoin implementation bug enabled attacker to create 548, 000 Zcoins

H. S. Teoh via Digitalmars-d digitalmars-d at puremagic.com
Mon Mar 13 07:54:13 PDT 2017


On Sat, Mar 11, 2017 at 08:55:12PM +0000, Ola Fosheim Grøstad via Digitalmars-d wrote:
> On Friday, 10 March 2017 at 22:41:43 UTC, H. S. Teoh wrote:
> > The problem is that "<<" was designed to be a bit-shift operator,
> > and as such it has a specific precedence level in the hierarchy of
> > operators.
> 
> Fair point. IIRC Algol68 allowed custom precedence levels. Found this:
> http://www.kestrel.edu/home/people/meertens/publications/papers/Operator-Priority_Grammar_for_ALGOL_68+.pdf

Custom precedence levels make the language a pain to parse, esp. by
external 3rd party tools.  Which generally also means (good) tooling
will be harder to come by.  Doesn't seem like a commensurate price with
the little replaceable benefit that you get.


> At the other end of the spectrum Pony requires explicit parens for
> operators outside the most familiar ones ("+", "-", "*"...).

This may not be a bad idea, actually. How many among us can actually
memorize the entire precedence hierarchy of C/C++ operators? I certainly
can't. Meaning that most of the time you'd already be writing
parentheses anyway, just to be sure, so it wouldn't be an onerous
requirement to always write them.


T

-- 
My program has no bugs! Only undocumented features...


More information about the Digitalmars-d mailing list