Long integers_(re)

Wed, 2 Jul 1997 00:57:13 +0200 (MET DST)


According to Frank Heckenbach:
> 
> How do you know about PXSC, anyway?

Everything I know about PXSC is from one book, "Pascal-SC", in German only,
I once have found at our library.  I was impressed by the possibilities of
exact (!) numerical calculations, and operator overloading.

> I did a Yahoo search on "PXSC", and it showed quite a few interesting
> things about PXSC (besides a few other things abbreviated by "PXSC" and
> several links to gpc pages :-), e.g. PXSC "home pages":
> 
> http://ma70.rz.uni-karlsruhe.de/~ae25/iam/html/language/xsc-sprachen.html
> http://wwwma.rz.uni-karlsruhe.de/~ae08/iam/html/language/pxsc.html
> 
> I also learned about even more Pascal extensions, like XL Pascal and
> Pascal++ (see
> http://www.informatik.uni-halle.de/lehre/pascal/sprache/pas0.html).

When I have the time :-( I "must" have a look at those pages.  Maybe we
can find more interesting ideas for GPC there ...

> On a page about BP, I found this remarkable statement:
> "Borland is the leader in Object-Oriented Programming, winning more awards
>  for technical innovation and customer support than anyone else. That means
>  that when you use Turbo Pascal, you're guaranteed to have the best
>  development environment available, backed by the best support available.
>  It's Borland's commitment to you.
>  [...]
>  Copyright ) 1995 Borland International, Inc."
> Things must have changed very much within 2 years... :-(

That's just the problem:  They didn't change (read: improve) anything since
2 years and more.

> > Think of a schema as a type declaration with parameters which can occur
> > anywhere in the declared type: as array or subrange boundaries, or as a
> > variant record selector.
> 
> Anywhere??? (roots:array[1..1+ord(sqr(p)/4-q<>0)] of complex;-)

Schema discriminants must be ordinal types, but the following compiles:

    Type
       roots ( p, q: Integer )
         = array [ 1..1 + ord ( sqr ( p ) / 4 - q <> 0 ) ] of Complex;

However it is useless since

    Var
      x: roots ( 4, 4 );

crashes GPC.  Expressions in schemata don't seem to work at all currently.

> [long numbers]
> 
> Not really the whole library; multiplying a long number by 10 (or any base)
> would be relatively easy to do manually. But you're right, it won't probably
> be needed too often, so this little inefficiency of the conversion at runtime
> seems tenable... :-) ... except, maybe, if PXSC demands it ...?

The compiler would have to deal with expressions formed by such numbers.
Better leave this for a library.

    Peter

 Dipl.-Phys. Peter Gerwinski, Essen, Germany, free physicist and programmer
peter.gerwinski@uni-essen.de - http://home.pages.de/~peter.gerwinski/ [970201]
 maintainer GNU Pascal [970624] - http://home.pages.de/~gnu-pascal/ [970125]


Peter Gerwinski (peter@agnes.dida.physik.uni-essen.de)

HTML conversion by Lluís de Yzaguirre i Maura
Institut de Lingüística Aplicada - Universitat "Pompeu Fabra"
e-mail: de_yza@upf.es