Adriaan van Os wrote:
(Or, actually, I think they should have separated implementation details like segmentation from the logical unit structure, i.e. allow segmentation on a smaller than unit basis.)
I couldn't agree more, but look where we are twenty-four-years-later with a gcc back-end on platforms that do not support the section ("section-name") attribute ?
Actually not quite the same. The attribute is an explicit mechanism (which a high-level programmer should not need to be concerned with), whereas UCSD would have needed implicit segmentation (which could be platform-dependent since it's an implementation issue).
- INTEGER type can be modified by a length attribute
Well, we have the `Size' attribute (probably different syntax, but the semantics might be the same?).
The 'Size' attribute denotes the number of decimal digits (BCD), not the number of bits.
<snip> > > Again, if we have 128 bit integers someday, we could implement it > (though binary, not BCD, but it shouldn't matter) -- though I don't > like the syntax, of course ...
OK, if we have 128-bit integers someday, we can write ... attribute( decimals = 25) ?
Or perhaps just `-(10 pow 25 - 1) .. 10 pow 25 - 1'.
- LONG INTEGER type, represented internally as a binary-coded
decimal (BCD) number (up to 36 digits)
Nice. :-( I guess when GCC will support 128 bit integers, we can declare it as such (or the exact subrange), since the internal representation shouldn't matter.
Because integer values are "discrete" numbers. In non-BCD floating point you have the problem that you cannot even represent something simple like 2 euro 13 exactly (which is a horror for accounting applications).
I know, but that's nothing to do with BCD, just integer (or fixed point) vs. floating point.
Well, in BCD floating-point 2 euro 13 can be represented exactly, in binary floating-point it can't.
My (non-floating ;-) point is that using floating point for currency amounts is silly, anyway.
SCAN( LIMIT, PEXPR, SOURCE)
You mean `Scan (42, <> 'A', Foo)'???
Quite amusing, isn't it ?
Yeah, let's invent some token combination that's not even allowed in C. ;-)
<rant subject="syntax" level="200%"> ...
Oh dear, I'm quite shocked. Why do people make up such strange things?
Well, it took evolution a million years (or so) to get from a dino to a Pascal programmer. In all those million years (or so) creativity has been a greater force than intelligence (otherwise no small dino's would have been born). That's the basic idea of evolution, unbound creativity limited by survival only, not by intelligence.
Yeah, survival. Fortunately, nature's evolution wasn't so much concerned with backward-compatibility. ;-)
You can't change the rules that easily, it has been with us for many million years. So, that's why it is so hard to be a real good programmer, it is against the unspelled creative forces of nature. You have to think with everything you do, think through the smallest detail and reject any bad idea. Besides, if you weren't very creative also, you wouldn't be a programmer.
What helps is a strong character - one that sternly says "you can't do that" - and a true sense of beauty - which makes you feel horrible if you do it anyway.
Nice description.
I also think it takes two -- one who makes the suggestions, and one who examins them very critically. I remember when I was just a user of GPC, I made some suggestions, some of which got implemented too easily -- which I later regretted when I had to remove or change them as a GPC developer ...
(*) Just a thought.
Perhaps the syntax could be handled with more-advanced preprocessor features, in particular string handling. Something like:
{$define Scan(A, B, C) {$if MacroIsPrefix (<>, MacroTrim (B))} ScanNE (A, MacroRemovePrefix (<>, MacroTrim (B)), C) {$else} ScanEQ (A, MacroRemovePrefix (=, MacroTrim (B)), C) {$endif} }
But how do you propagate a "Scan" macro out of a UCSD compatibility unit ?
Not possible in units. You could use an include file (Pascal declarations: units, macros: includes, might make some sense), and use `{$i}' instead of `uses' or `-include' instead of `--uses'.
Frank