[M3devel] Enumeration or subrange value out of range

Michael Richter ttmrichter at gmail.com
Thu Dec 2 15:36:59 CET 2010


On 2 December 2010 22:12, Hendrik Boom <hendrik at topoi.pooq.com> wrote:

> > The semantics of concatenation are hugely different from the
> > semantics of addition.  Consider 3+4 vs. 4+3.
> > Now consider "three"+"four"
> > vs. "four"+"three".  If you want to do concatenation, have an operator
> for
> > concatenation.  (++, say, as a random example.)  Do not overload addition
> > with an operation that isn't even vaguely analogous.
>


> The semantics of matrix multiplication are hugely different from those
> of integer multiplication.  Consider A*B vs B*A.
>

This is why, if memory serves, there's two different "multiplication"
operations and operators for matrices?


> > > I'm surprised that is overloadable, but indeed it appears it is. I
> don't
> > > think I have *ever* seen anyone overload it, and I have seen a lot.
>


> > I would tell you how I used it, but I'm utterly ashamed of that portion
> of
> > my life.  ;)  (It was in a type-safe SQL query builder.)
>


> That sounds as if you were defining . to be a reasonable approximation
> to SQL's . That sounds like a reasonable thing to do -- except if any of
> its uses would have to be disambiguated with C++'s hopelessly
> complicated disambiguation rules.
>

Yeah, that was a problem.  It also required some utterly retarded constructs
like function calls that had double-parentheses because the comma is used
differently in argument lists than in expressions and so forth.  The final
product was marginally better to use than the traditional format
string-style SQL statement builders, but only marginally so and at a huge
expense in implementation comprehension (and thus testing and debugging).


> > Operator overloading can multiply these by orders of magnitude and have
> the
> > added problem of being, in effect, "COME FROM" statements.
>


> Those were fun.  Good thing no one took hem seriously.
>

Sure they did.  It's called "Aspect-Oriented Programming".  ;)


> I use the subset of C++ that's more or less equivalent to C.  It gives
> me slightly better type-checking, but that's the main benefit.
>

I think this plus limited use of inheritance is the majority use of C++.


> > What is the FFI lingua franca again?  C or C++?  (Hint: one of those two
> > languages has syntax to make it compatible with the other, but not vice
> > versa.)
>


> C has interfacing specs that are more or less consistent from machine to
> machine.
>


> C++ doesn't seem to.
>

C++ doesn't even have interfacing specs that are consistent and compatible
from compiler to compiler.  Or, often, compiler version to compiler version
in the same family.


> > "Perhaps people don't believe this, but throughout all of the discussions
> of

> entering China our focus has really been what's best for the Chinese
> people.

> It's not been about our revenue or profit or whatnot."

> --Sergey Brin, demonstrating the emptiness of the "don't be evil" mantra.


More demonstrating how difficult some ethical decisions, even with the

best of intentions.


This presumes you actually believe what Brin says.  I don't.  I think
revenue and profit was their only concern in moving into China and a lack
thereof on both fronts was their motive to leave.

-- 
"Perhaps people don't believe this, but throughout all of the discussions of
entering China our focus has really been what's best for the Chinese people.
It's not been about our revenue or profit or whatnot."
--Sergey Brin, demonstrating the emptiness of the "don't be evil" mantra.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20101202/e2a17a09/attachment-0002.html>


More information about the M3devel mailing list