April 06, 2005
"Andrew Fedoniouk" <news@terrainformatica.com> wrote in message news:d2uorf$2ot6$1@digitaldaemon.com...
>>> Probably I am too deep in C++ where exceptions in constructors are "persons non grata" and, apropos, bad design.
>>
>> Really? Since when?
>>
>> Please offer some sources to substantiate this opinion.
>>
>
> Sorry, Matthew, I've propagated problem with exceptions in destructors [1] onto constructors also. Mea culpa.

Ok. Phew! <g>

Of course, throwing exceptions from dtors in C++ is an (almost) absolute no-no.

> BTW:  MmFile destructor is also generating exceptions.

Sigh. I don't doubt it. I need to rewrite it

> In any case general rule: "you should avoid unnecessary try blocks" [2] sounds reasonable as a general recommendation.
>
> IMHO, System resource wrappers should not throw exceptions or at least should allow non exceptional forms of operations.

I totally agree.

I instinctively go for a two layer approach - vestigial evidence of which can be seen in std.loader - whereby non/little-throwing core functions are used in throwing class layers. I write my C/C++ in this way, and don't see anything fundamentally different in D that it should be otherwise. (Of course, such an approach is open to being criticised as being overly complex. C'est la vie!)

In that way, there's full and proper support for both procedural and OO programming, without any bias/disaccommodation to practitioners in either camp.




April 06, 2005
Regan Heath wrote:
> A "byte" is a 8 bit long /self contained/ piece of memory, as in it's a  complete /thing/ in 8 bits. Whereas a "void" from a void[] is an 8 bit  long piece of memory, likely part of a whole /thing/.

One could think of void as being an address only.

And since such don't need / can't know, what we imagine there being, then the size is 1.

Actually, the size should be 0 to emphasize this, bat technically that would become cumbersome, since you most often itreate through ranges of voids. With size 0 there would have to be extra measures created in the compiler (and philosophy) to enable this iteration to actually move forward.

So, for practical reasons, void is of size 1.

Another way of putting it is, we do need occasionally to address memory without knowing/caring about the type of data there is. A byte being the smallest location traditionally addressable by programming languages, it is natural that "this smallest address-difference" is used as the "size of void".
April 07, 2005
> In that way, there's full and proper support for both procedural and OO
> programming, without any bias/disaccommodation
> to practitioners in either camp.

This 'and' in "procedural and OO programming" sounds like murmur of Styx river separating these two kingdoms.

Where Matthew is like Charon on duty. :) ( No offence )

Literature:
[1] http://www.pantheon.org/articles/s/styx_river.html





April 07, 2005
"Andrew Fedoniouk" <news@terrainformatica.com> wrote in message news:d32mf5$1b65$1@digitaldaemon.com...
>> In that way, there's full and proper support for both procedural and OO programming, without any
>> bias/disaccommodation
>> to practitioners in either camp.
>
> This 'and' in "procedural and OO programming" sounds like murmur of Styx river separating these two kingdoms.
>
> Where Matthew is like Charon on duty. :) ( No offence )

LOL! Brilliant. I shall be thus known henceforth. :-)



1 2 3
Next ›   Last »