Re: [fpc-pascal] Compiling / Make problems, latest SVN

2007-10-29 Thread Jonas Maebe


On 29 Oct 2007, at 07:54, Tobias Giesen wrote:


I am trying to compile the latest FPC 2.3 SVN on OS X i386 with
CPU_TARGET=powerpc.

The crosscompiling guide on the freepascal web site says to do a:
make cycle


make cycle only works in the compiler subdirectory.


But cycle seems to be no longer there, so I tried compiler_cycle and
also make all.

Make all and make install both produce this error compiling
pkgwget.pp:

Fatal: Can't find unit process used by pkgglobals

How can I fix this?


That's a bug in the current svn sources (which breaks compilation on  
virtually all platforms), and will probably be fixed somewhere today.



Jonas
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Compiling / Make problems, latest SVN

2007-10-29 Thread Vincent Snijders

Jonas Maebe schreef:


On 29 Oct 2007, at 07:54, Tobias Giesen wrote:


I am trying to compile the latest FPC 2.3 SVN on OS X i386 with
CPU_TARGET=powerpc.

The crosscompiling guide on the freepascal web site says to do a:
make cycle


make cycle only works in the compiler subdirectory.


But cycle seems to be no longer there, so I tried compiler_cycle and
also make all.

Make all and make install both produce this error compiling
pkgwget.pp:

Fatal: Can't find unit process used by pkgglobals

How can I fix this?


That's a bug in the current svn sources (which breaks compilation on 
virtually all platforms), and will probably be fixed somewhere today.


FYI, on windows it breaks earlier:

d:/lazarus/source/fpc/2.3/compiler/ppc386.exe -Ur -Xs -O2 -n -S2h 
-FuD:/lazarus/source/fpc/2.3/rtl/units/i386-win32 
-FuD:/lazarus/source/fpc/2.3/packages/base/netdb/units/i386-win32 
-FuD:/lazarus/source/fpc/2.3/packages/fcl-base/units/i386-win32 
-FuD:/lazarus/source/fpc/2.3/packages/fcl-xml/units/i386-win32 
-FuD:/lazarus/source/fpc/2.3/packages/fcl-passrc/units/i386-win32 
-FuD:/lazarus/source/fpc/2.3/packages/fcl-async 
-FuD:/lazarus/source/fpc/2.3/packages/base/winunits/units/i386-win32 -FE. 
-FUunits/i386-win32 -g -gl -O- -O1 -di386 -dRELEASE src/resolve.pp

resolve.pp(199,2) Fatal: Can't open include file "resolve.inc"
Fatal: Compilation aborted

a -Fisrc/win seems missing.

Vincent
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] no_dead_strip not recognized by OS X 10.3 assembler

2007-10-29 Thread Jonas Maebe


On 29 Oct 2007, at 11:03, Tobias Giesen wrote:


I am now trying the latest Lazarus snapshots on OS X 10.3 on a powerpc
Mac. The application compiles 99% fine but at the end it fails with  
the

following errors (from the assembler, I assume):

unknown section attribute: no_dead_strip
[...]
Error while assembling Exit Code 1

Is there a solution for this problem?


Yes, add the -CX- -X- command line options. Dead code stripping is  
not supported by the 10.3 assembler/linker. The compiler has however  
no clue on which OS version it is running, so if Lazarus tells it to  
generate smart linkable code, it will do so.



Jonas
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Compiling / Make problems, latest SVN

2007-10-29 Thread Jonas Maebe


On 29 Oct 2007, at 09:35, Jonas Maebe wrote:


Fatal: Can't find unit process used by pkgglobals

How can I fix this?


That's a bug in the current svn sources (which breaks compilation  
on virtually all platforms), and will probably be fixed somewhere  
today.


Should be fixed now.


Jonas
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] no_dead_strip not recognized by OS X 10.3 assembler

2007-10-29 Thread Tobias Giesen
Hello,

I am now trying the latest Lazarus snapshots on OS X 10.3 on a powerpc
Mac. The application compiles 99% fine but at the end it fails with the
following errors (from the assembler, I assume):

unknown section attribute: no_dead_strip
[...]
Error while assembling Exit Code 1

Is there a solution for this problem?

Thanks!

Cheers,
Tobias


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] no_dead_strip not recognized by OS X 10.3 assembler

2007-10-29 Thread Jonas Maebe


On 29 Oct 2007, at 11:36, Mattias Gaertner wrote:


Yes, add the -CX- -X- command line options. Dead code stripping is
not supported by the 10.3 assembler/linker. The compiler has however
no clue on which OS version it is running, so if Lazarus tells it to
generate smart linkable code, it will do so.


I added the hint to the FAQ. Please review:
http://wiki.lazarus.freepascal.org/Lazarus_Faq#Mac_OS_X


Thanks, I've slightly reworded it.


Jonas
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] no_dead_strip not recognized by OS X 10.3 assembler

2007-10-29 Thread Mattias Gaertner
On Mon, 29 Oct 2007 11:08:48 +0100
Jonas Maebe <[EMAIL PROTECTED]> wrote:

> 
> On 29 Oct 2007, at 11:03, Tobias Giesen wrote:
> 
> > I am now trying the latest Lazarus snapshots on OS X 10.3 on a
> > powerpc Mac. The application compiles 99% fine but at the end it
> > fails with the
> > following errors (from the assembler, I assume):
> >
> > unknown section attribute: no_dead_strip
> > [...]
> > Error while assembling Exit Code 1
> >
> > Is there a solution for this problem?
> 
> Yes, add the -CX- -X- command line options. Dead code stripping is  
> not supported by the 10.3 assembler/linker. The compiler has however  
> no clue on which OS version it is running, so if Lazarus tells it to  
> generate smart linkable code, it will do so.

I added the hint to the FAQ. Please review:
http://wiki.lazarus.freepascal.org/Lazarus_Faq#Mac_OS_X

Mattias
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] FPC and JAVA

2007-10-29 Thread Jonas Maebe


On 27 Oct 2007, at 17:22, Mattias Gaertner wrote:


Also, all those icons in the menus look pretty weird (very few Mac
apps have that, and none that I currently use does),


Should they be hidden?


In general, I would say: yes. Maybe it should be an option which by  
default is off, or so.



Jonas
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Compiling / Make problems, latest SVN

2007-10-29 Thread Tobias Giesen
Hello,

thanks for the new Makefiles! I am now at SVN rev. 8988 and when I 
enter 

cd fpc/compiler
make cycle CPU_TARGET=powerpc

I get:

Makefile:125: *** Compiler ppcrossppc not found. Stop.

I don't know what's happening. In this step, I do not want to
crosscompile. I want to _make_ the cross-compiler.

Thanks for any help!!

Cheers,
Tobias

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Compiling / Make problems, latest SVN

2007-10-29 Thread Jonas Maebe


On 29 Oct 2007, at 11:26, Tobias Giesen wrote:


thanks for the new Makefiles! I am now at SVN rev. 8988 and when I
enter

cd fpc/compiler
make cycle CPU_TARGET=powerpc

I get:

Makefile:125: *** Compiler ppcrossppc not found. Stop.

I don't know what's happening. In this step, I do not want to
crosscompile. I want to _make_ the cross-compiler.


Tell the Makefile explicitly with which compiler you want to start, e.g.

make cycle CPU_TARGET=powerpc FPC=ppc386


Jonas
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] FPC and JAVA

2007-10-29 Thread Daniël Mantione


Op Mon, 29 Oct 2007, schreef Jonas Maebe:

> 
> On 27 Oct 2007, at 17:22, Mattias Gaertner wrote:
> 
> > > Also, all those icons in the menus look pretty weird (very few Mac
> > > apps have that, and none that I currently use does),
> > 
> > Should they be hidden?
> 
> In general, I would say: yes. Maybe it should be an option which by default is
> off, or so.

I think it doesn't apply just for Mac, the latest Lazarus snapshots have 
menu bars that are overcrowded with icons. This is unusual for any 
platform I use.

Daniël___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] no_dead_strip not recognized by OS X 10.3 assembler

2007-10-29 Thread Tobias Giesen
> Yes, add the -CX- -X- command line options.
> Or better: turn off all smart linking related options in Lazarus.

Thanks!

I did both, but somehow the error is still there. All the units compile
fine, only the last step where the .dpr file is compiled fails. The 
.s file of the main program remains in the folder. Can I edit it and
do the final steps manually, just for a test?

Cheers,
Tobias


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] no_dead_strip not recognized by OS X 10.3 assembler

2007-10-29 Thread Jonas Maebe


On 29 Oct 2007, at 11:08, Jonas Maebe wrote:


unknown section attribute: no_dead_strip
[...]
Error while assembling Exit Code 1

Is there a solution for this problem?


Yes, add the -CX- -X- command line options.


Or better: turn off all smart linking related options in Lazarus.


Jonas
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] FPC and JAVA

2007-10-29 Thread Mattias Gaertner
On Mon, 29 Oct 2007 11:36:44 +0100 (CET)
Daniël Mantione <[EMAIL PROTECTED]> wrote:

> 
> 
> Op Mon, 29 Oct 2007, schreef Jonas Maebe:
> 
> > 
> > On 27 Oct 2007, at 17:22, Mattias Gaertner wrote:
> > 
> > > > Also, all those icons in the menus look pretty weird (very few
> > > > Mac apps have that, and none that I currently use does),
> > > 
> > > Should they be hidden?
> > 
> > In general, I would say: yes. Maybe it should be an option which by
> > default is off, or so.
> 
> I think it doesn't apply just for Mac, the latest Lazarus snapshots
> have menu bars that are overcrowded with icons. This is unusual for
> any platform I use.

Maybe this discussion can be moved to the lazarus list.


Mattias
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] FPC and JAVA

2007-10-29 Thread Michael Van Canneyt


On Mon, 29 Oct 2007, Daniël Mantione wrote:

> 
> 
> Op Mon, 29 Oct 2007, schreef Jonas Maebe:
> 
> > 
> > On 27 Oct 2007, at 17:22, Mattias Gaertner wrote:
> > 
> > > > Also, all those icons in the menus look pretty weird (very few Mac
> > > > apps have that, and none that I currently use does),
> > > 
> > > Should they be hidden?
> > 
> > In general, I would say: yes. Maybe it should be an option which by default 
> > is
> > off, or so.
> 
> I think it doesn't apply just for Mac, the latest Lazarus snapshots have 
> menu bars that are overcrowded with icons. This is unusual for any 
> platform I use.

I don't know about that? 
I use quite some programs and they all have icons in front of many many 
menus. Kile, konqueror, k3b etc. Not much less than Lazarus.

Normally, under Windows the convention is that you put an icon in front of 
any menu item that corresponds with a toolbar button (with the same icon).
It makes clear that the menu item/button have the same function.
Menu items for which no toolbar button exists, do not have an icon.

Michael.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] FPC and JAVA

2007-10-29 Thread L
> >> Also, all those icons in the menus look pretty weird (very few Mac
> >> apps have that, and none that I currently use does),

Also, on Windows I found the spacing was a bit big but not sure if this is
normal MS OFfice style look and feel since I don't use that software much.

For example it looks like a tab between the icon and the menu item, rather than
say two spaces.

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: Why this evaluates on "if" wrong ?

2007-10-29 Thread L
> It's just one more funny thing one must realize,
> when comparing real numbers with some exact
> real constants. After this, I will try to never
> compare doubles directly, but using tricks like
> above. Because, in this digital world
> 1 + 0.4 - 0.4 <> 1.

My opinion:
This is ludicrous.

The end user is using a high level language and should not care whether the
computer is digital or analog.

For example, my calculator subtracts 0.4 just fine, and it is digital!

I don't care about decimal points or any other excuses. THe fact is people
expect languages on computers to work like their calculator does or like
how grade school math worked.. simple, sensible. 

1 minus 0.4 is 0.6. We need a Type to solve this problem if there isn't 
already one using currency or the suggested units. We are using high level 
languages here, not assembly code for creeps sake.

Maybe currencies or the unit suggested by Florian solves the (IMO) ludicrous
problem of todays languages. Imagine if we could not send emails because
'digital computers don't store text, they just store numbers, so you'll have to
send your mail using numbers Sir'.


L505

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: Why this evaluates on "if" wrong ?

2007-10-29 Thread Michael Van Canneyt


On Mon, 29 Oct 2007, L wrote:

> > It's just one more funny thing one must realize,
> > when comparing real numbers with some exact
> > real constants. After this, I will try to never
> > compare doubles directly, but using tricks like
> > above. Because, in this digital world
> > 1 + 0.4 - 0.4 <> 1.
> 
> My opinion:
> This is ludicrous.
> 
> The end user is using a high level language and should not care whether the
> computer is digital or analog.

The programmer definitely should care. He has to make the right choice
in what type he chooses, so he must be aware of any 'quircks' of the type
he is using, and that includes how things are rounded and how they are
stored in memory. That's why there are IEEE references for this.

It's his job to make sure that the end user gets something sensible on the
screen, and that includes rounding to a usable number of digits.

The currency type calculates with a certain precision for you if you really
don't want to be bothered with the gory details. The opposite side of the
medal is that it's limited to 4 digits, and cannot be larger than 2^59 or
thereabouts.

Michael.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: Why this evaluates on "if" wrong ?

2007-10-29 Thread L

> The programmer definitely should care. He has to make the right choice
> in what type he chooses, so he must be aware of any 'quircks' of the type
> he is using, and that includes how things are rounded and how they are
> stored in memory. That's why there are IEEE references for this.
>
> It's his job to make sure that the end user gets something sensible on the
> screen, and that includes rounding to a usable number of digits.

Agree.

>
> The currency type calculates with a certain precision for you if you really
> don't want to be bothered with the gory details. The opposite side of the
> medal is that it's limited to 4 digits, and cannot be larger than 2^59 or
> thereabouts.
>

As long as there is some type where you can treat the language like a regular
old dumb casio calculator that was used in grade school math, then I'm happy. I
haven't done much currency work or float work with Pascal and wanted to confirm
there was at least a dumb/simple high level decimal type out there somewhere for
when you need one ;-)

L505

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: Why this evaluates on "if" wrong ?

2007-10-29 Thread Jonas Maebe


On 29 Oct 2007, at 15:30, L wrote:


It's just one more funny thing one must realize,
when comparing real numbers with some exact
real constants. After this, I will try to never
compare doubles directly, but using tricks like
above. Because, in this digital world
1 + 0.4 - 0.4 <> 1.


My opinion:
This is ludicrous.

The end user is using a high level language and should not care  
whether the

computer is digital or analog.


It's not about digital vs analog, it's about limited precision. And  
you simply cannot ignore that, unless you only use extremely high  
level primitives. For example, when adding a bunch of floating point  
numbers, you should sort them from small to large because otherwise  
you lose a lot more precision. So unless you use an "AddFloat 
(realarray, count): float" function, you also have to care.



For example, my calculator subtracts 0.4 just fine, and it is digital!


It has been explained earlier in this thread why that is so.

I don't care about decimal points or any other excuses. THe fact is  
people
expect languages on computers to work like their calculator does or  
like

how grade school math worked.. simple, sensible.


Then they should not use floating point in programming languages, but  
Mathlab, Maple, or special purpose libraries/types.



Jonas
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: Why this evaluates on "if" wrong ?

2007-10-29 Thread Daniël Mantione


Op Mon, 29 Oct 2007, schreef L:

> > It's just one more funny thing one must realize,
> > when comparing real numbers with some exact
> > real constants. After this, I will try to never
> > compare doubles directly, but using tricks like
> > above. Because, in this digital world
> > 1 + 0.4 - 0.4 <> 1.
> 
> My opinion:
> This is ludicrous.
> 
> The end user is using a high level language and should not care whether the
> computer is digital or analog.
> 
> For example, my calculator subtracts 0.4 just fine, and it is digital!

Your Casio doesn't do comparisons. Just round to 10 digits before you 
compare and it'll work just as fine as on your Casio.

Daniël___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Re: Why this evaluates on "if" wrong ?

2007-10-29 Thread L
> Your Casio doesn't do comparisons. Just round to 10 digits before you
> compare and it'll work just as fine as on your Casio.
>
> Daniël


And some off topic trivia:

My casio says "10 + 2 digits" near the model number.

Does this mean it displays 10 digits and stores 2 in the background, or that I
can somehow scroll and access these 2 digits? I should RTFM but thought you
folks might know.

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: Why this evaluates on "if" wrong ?

2007-10-29 Thread Michael Van Canneyt


On Mon, 29 Oct 2007, L wrote:

> 
> > The programmer definitely should care. He has to make the right choice
> > in what type he chooses, so he must be aware of any 'quircks' of the type
> > he is using, and that includes how things are rounded and how they are
> > stored in memory. That's why there are IEEE references for this.
> >
> > It's his job to make sure that the end user gets something sensible on the
> > screen, and that includes rounding to a usable number of digits.
> 
> Agree.
> 
> >
> > The currency type calculates with a certain precision for you if you really
> > don't want to be bothered with the gory details. The opposite side of the
> > medal is that it's limited to 4 digits, and cannot be larger than 2^59 or
> > thereabouts.
> >
> 
> As long as there is some type where you can treat the language like a regular
> old dumb casio calculator that was used in grade school math, then I'm happy. 
> I
> haven't done much currency work or float work with Pascal and wanted to 
> confirm
> there was at least a dumb/simple high level decimal type out there somewhere 
> for
> when you need one ;-)

Currency should do fine, as long as you don't need more than 4 decimal
places.

Michael.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: Why this evaluates on "if" wrong ?

2007-10-29 Thread Daniël Mantione


Op Mon, 29 Oct 2007, schreef L:

> > Your Casio doesn't do comparisons. Just round to 10 digits before you
> > compare and it'll work just as fine as on your Casio.
> >
> > Daniël
> 
> 
> And some off topic trivia:
> 
> My casio says "10 + 2 digits" near the model number.
> 
> Does this mean it displays 10 digits and stores 2 in the background, or that I
> can somehow scroll and access these 2 digits? I should RTFM but thought you
> folks might know.

It means it displays 10 and has 2 additional digits for internal use. As I 
said, the easiest way to check this is to push the pi button and subtract 
the number you see in the display. If remember well some Casio calculators 
also have a button to truncate the internal digits.

Daniël___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Re: Why this evaluates on "if" wrong ?

2007-10-29 Thread Tom Verhoeff
On Mon, Oct 29, 2007 at 07:30:03AM -0700, L wrote:
> > It's just one more funny thing one must realize,
> > when comparing real numbers with some exact
> > real constants. After this, I will try to never
> > compare doubles directly, but using tricks like
> > above. Because, in this digital world
> > 1 + 0.4 - 0.4 <> 1.
> 
> My opinion:
> This is ludicrous.
> 
> The end user is using a high level language and should not care whether the
> computer is digital or analog.

Unfortunately, there is a problem.  One can try to hide it (as calculators
attempt to do), but in the longer run that is going to be unsuccessful
and even dangerous.

The mathematical structures of floating point numbers and of real numbers
do not match, and cannot be made to match faithfully.

See e.g. any good textbook on numerical mathematics.  However, most
of those texts are not so accessible to the layman.  I have written
a short article on it for secondary educations, that I hope is more
accessible:

Gyula Horvath, Tom Verhoeff.
``Numerical Difficulties in Pre-University Informatics Education
  and Competitions'',
Informatics in Education, Vol. 2, Number 1, pp.21-38.

URL checked OK

(Sidenote: If your program only needs to deal with decimal fractions,
then it is stronly advised not to use Real/Single/Double, but e.g. Currency.
Floating-point numbers are useful in scientific and engineering applications.)

Tom
-- 
E-MAIL: T.Verhoeff @ TUE.NL | Dept. of Math. & Comp. Science
PHONE:  +31 40 247 41 25| Technische Universiteit Eindhoven
FAX:+31 40 247 54 04| PO Box 513, NL-5600 MB Eindhoven
http://www.win.tue.nl/~wstomv/  | The Netherlands
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: Why this evaluates on "if" wrong ?

2007-10-29 Thread L
> >
> > The end user is using a high level language and should not care whether the
> > computer is digital or analog.
>
> Unfortunately, there is a problem.  One can try to hide it (as calculators
> attempt to do), but in the longer run that is going to be unsuccessful
> and even dangerous.

Same as ansistring.. it can be dangerous to hide all the intricate details of a
pchar/bytearray, which is what ansistring does. But ansistrings are really
useful for 'every day' use.

It took about 30 years for someone to finally invent the ansistring because all
those other people thought that something like an ansistring would be too
slow/dangerous on the current hardware available. And maybe back then it was. So
we used Pchar and 255string and it limited our thinking back then (and I wasn't
born back then in the 70's so I shouldn't talk, but I've looked over history and
can see patterns).

Eventually, people realize that programming languages should be 'easy to use' by
default, and learn that you should be able to escape this 'easy to use' system
by using other types or turning off switches (i.e. range checking, {$H+} etc.).
So my point is.. I hope we have solutions.. and we do.. currency and others.
Currency just seems to be kind of hack compared to something more like a TCasio
would be.. We should have something like that. Most people that use programming
languages are using them as general purpose tools... and if they want to do
engineering then they can pull in the engineering library in their uses clause.
But by default, we should have TCasio available. Currency seems to be close..
but maybe not close enough to a casio calculator. Plus, it's called currency..
which is dedicated for currency, not calculating every day math (patches
welcome, yes yes I know).

My point mainly was that we have high level types like ansistrings, so why not
have good decimal type that acts just like a calculator. Could be called
'TCasio'. Don't call it that, I'm kidding on the type name.

Lately during parsing I've had to defeat the compiler by using uniquestring and
setlength.. but ansistrings are still worth it because in general this is what
people need to be doing.. adding/concatenating strings of unknown final lengths
;-)

I assume in general, pascal is used for every day programming.. not scientic
computing. I assume that most people would want to do every day math like on a
Casio calculator.. and only some people would want to do engineering.. so those
folks can pull in the engineering units when they need to.

>
> The mathematical structures of floating point numbers and of real numbers
> do not match, and cannot be made to match faithfully.
>
> See e.g. any good textbook on numerical mathematics.  However, most
> of those texts are not so accessible to the layman.  I have written
> a short article on it for secondary educations, that I hope is more
> accessible:
>
> Gyula Horvath, Tom Verhoeff.
> ``Numerical Difficulties in Pre-University Informatics Education
>   and Competitions'',
> Informatics in Education, Vol. 2, Number 1, pp.21-38.
> 
> URL checked OK


I will download and read, thanks.

>
> (Sidenote: If your program only needs to deal with decimal fractions,
> then it is stronly advised not to use Real/Single/Double, but e.g. Currency.
> Floating-point numbers are useful in scientific and engineering applications.)


Absolutely agree and was the point I was trying to make.. there are some times
when you just want a computer to concatenate strings.. and there are times when
you really want the computer to act like  regular old calculator. So we
shouldn't limit our thinking to 255 strings and shouldn't limit our thinking to
floats/extended/double. We should have floats/extended/double available and 255
strings available for when we need them.. but maybe we should also have a TCasio
and Currency available too.

Mainly, it seems now my point is that we have a 'currency' type that maybe isn't
the best we could have.. and quite possibly we are limiting our thinking around
this currency type and these float types. Remember back when 255 string was 'the
thing' to use.. and no one would possibly think of an ansistring since it didn't
exist at the time and couldn't POSSIBLY be useful to use since 255 was enough..
or that pchars were enough when 255strings weren't fit?

Just being devils advocate as always.. trying to encourage creative thought and
invention..

Lars

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: Why this evaluates on "if" wrong ?

2007-10-29 Thread Daniël Mantione


Op Mon, 29 Oct 2007, schreef L:

> Same as ansistring.. it can be dangerous to hide all the intricate details of 
> a
> pchar/bytearray, which is what ansistring does. But ansistrings are really
> useful for 'every day' use.

Wrong. A string can be represented "alphadequate", as it is called; an 
ansistring can handle any string you can imagine supposed there is enough 
memory available.

An adequate or alphadequate representation of a real number cannot exists. 
Regardless what datastructure you use, there always exists a real number 
that cannot be represented by it.

> My point mainly was that we have high level types like ansistrings, so why not
> have good decimal type that acts just like a calculator. Could be called
> 'TCasio'. Don't call it that, I'm kidding on the type name.

Feel free to make a proposal.

Daniël___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

RE: [fpc-pascal] Re: Why this evaluates on "if" wrong ?

2007-10-29 Thread Stephen Dickason
> It's just one more funny thing one must realize,
> when comparing real numbers with some exact
> real constants. After this, I will try to never
> compare doubles directly, but using tricks like
> above. Because, in this digital world
> 1 + 0.4 - 0.4 <> 1.

In binary that is 0001 + 0.0110011001100 - 0.0110011001100 because
we hit recurring decimals a lot more in binary than decimal.  I wonder why we
don't have a standard format (maybe we do?) that factors in the remainder as
part of the number also?  4 bits with recurring fraction ("decimal") debugging
power could do some good.  Maybe it's just too messy and slows FP operations
even more.  Would think that  for recurring length too big, 0001 for no
recurring, and 0010- (2-15) would be length of recurring bits from lsb.  Not
sure if one would be able to detect longer easily.  That would be able to cover
4 decimal digits of repeating bits.

  0.0110011001100 (was 4/10)
+ 0.0110011001100 (was 4/10)
+ 0.0011001100110 (was 2/10)
= 0.1 (was 10/10)
 (0.1 short)

With the above, they all repeat on 4 bits:
  1100
  1100
  0110
=0 - this would translate to a series of 1s if recurred.
Would here be able to surmise that we need to add the 0001 that is short.
because the recursion has been undone.  It would probably lead to a pile of new
problems but, that's another story.

Stephen
*---

This E-Mail may contain confidential and/or privileged information. It
is only intended for the use of the addressee indicated in this message.
If you are not an intended addressee of this email (or responsible for
delivery of the message to such person), the disclosure, copying or
delivering of the contents of this email to anyone else is strictly
prohibited and may be unlawful. If you receive this e-mail by mistake
destroy the message and please notify us immediately by e-mail,
[EMAIL PROTECTED]

Information or opinions in this message that do not relate to the
business of ELCB Information Services shall be treated as neither 
given or endorsed by it.


*---

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


RE: [fpc-pascal] Re: Why this evaluates on "if" wrong ?

2007-10-29 Thread Daniël Mantione


Op Mon, 29 Oct 2007, schreef Stephen Dickason:

> > It's just one more funny thing one must realize,
> > when comparing real numbers with some exact
> > real constants. After this, I will try to never
> > compare doubles directly, but using tricks like
> > above. Because, in this digital world
> > 1 + 0.4 - 0.4 <> 1.
> 
> In binary that is 0001 + 0.0110011001100 - 0.0110011001100 because
> we hit recurring decimals a lot more in binary than decimal.  I wonder why we
> don't have a standard format (maybe we do?) that factors in the remainder as
> part of the number also? 

The answer can be found in the fact that any number with recurring 
decimals is a rational number and therefore does not need floating point 
numbers.

Daniël___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Re: Why this evaluates on "if" wrong ?

2007-10-29 Thread Micha Nelissen
Stephen Dickason wrote:
> In binary that is 0001 + 0.0110011001100 - 0.0110011001100 because
> we hit recurring decimals a lot more in binary than decimal.  I wonder why we
> don't have a standard format (maybe we do?) that factors in the remainder as
> part of the number also?

It's possible to create a type that stores the numerator and
denominator, but then you would need to "simplify" to extract common
factors on every calculation, otherwise it would quickly run out of
range (Integer or whatever you choose). Extracting common factors takes
exponential time, so it's quite slow. The range would be quite limited
as well, it's as wide as the numerator.

Micha
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: Why this evaluates on "if" wrong ?

2007-10-29 Thread Florian Klaempfl
L schrieb:
>> It's just one more funny thing one must realize,
>> when comparing real numbers with some exact
>> real constants. After this, I will try to never
>> compare doubles directly, but using tricks like
>> above. Because, in this digital world
>> 1 + 0.4 - 0.4 <> 1.
> 
> My opinion:
> This is ludicrous.
> 
> The end user is using a high level language and should not care whether the
> computer is digital or analog.
> 
> For example, my calculator subtracts 0.4 just fine, and it is digital!

Yes, but how long does it take? 1ms? 10ms? People will even complain if
it takes more than 1ns on a PC in contrary and even more about the blow
of the system unit growing by the size of the fmtbcd unit ;)
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] no_dead_strip not recognized by OS X 10.3 assembler

2007-10-29 Thread Jonas Maebe


On 29 Oct 2007, at 11:42, Tobias Giesen wrote:


Yes, add the -CX- -X- command line options.
Or better: turn off all smart linking related options in Lazarus.


Thanks!

I did both, but somehow the error is still there. All the units  
compile

fine, only the last step where the .dpr file is compiled fails. The
.s file of the main program remains in the folder. Can I edit it and
do the final steps manually, just for a test?


You can use the -s option so make the compiler only generate  
assembler files, together with a script (called ppas.sh) to perform  
the assembling and linking.



Jonas
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: Why this evaluates on "if" wrong ?

2007-10-29 Thread Florian Klaempfl
Daniël Mantione schrieb:
> 
> Op Mon, 29 Oct 2007, schreef L:
> 
>>> Your Casio doesn't do comparisons. Just round to 10 digits before you
>>> compare and it'll work just as fine as on your Casio.
>>>
>>> Daniël
>>
>> And some off topic trivia:
>>
>> My casio says "10 + 2 digits" near the model number.
>>
>> Does this mean it displays 10 digits and stores 2 in the background, or that 
>> I
>> can somehow scroll and access these 2 digits? I should RTFM but thought you
>> folks might know.
> 
> It means it displays 10 and has 2 additional digits for internal use. As I 
> said, the easiest way to check this is to push the pi button and subtract 
> the number you see in the display. 

Probably -4*10-10 :)

Another funny thing is:
Enter sqrt(sqrt(sqrt(1.1))) and you've 1 in the display. Then
calculate this Result^1e10. I wonder if 1^1e10=3.000...(on my Casio) is
what you call intuitive ;)

Unfortunatly I don't use calculators that much any more, but during my
school time I knew a lot of waysto crash, fool or whatever calculators.
During school time we had one (was in the 90s, a simple Casio) which
could be send into an endless loop with some easy calculation, I don't
remember how though :(. While doing this, it turned off the display and
looked off, but sucked a lot of power because it was still calculating.
Guess what we prefer to do with the teacher's calculator, he never got
an idea why the batteries of his caluclator were permanently empty :)

> If remember well some Casio calculators 
> also have a button to truncate the internal digits.
>

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: Why this evaluates on "if" wrong ? (GMP)

2007-10-29 Thread Tom Verhoeff
On Mon, Oct 29, 2007 at 06:36:11PM +0100, Micha Nelissen wrote:
> 
> It's possible to create a type that stores the numerator and
> denominator, but then you would need to "simplify" to extract common
> factors on every calculation, otherwise it would quickly run out of
> range (Integer or whatever you choose). Extracting common factors takes
> exponential time, so it's quite slow. The range would be quite limited
> as well, it's as wide as the numerator.

In fact, the GMP (GNU Multiple Precision Arithmetic Library )
offers this and more.  Unfortunately, there does not seem to be a complete
FreePascal interface for it.  Maybe it is easy to adapt (if necessary?)
the GNU Pascal interface for GMP .
I would be interested.

There is also an initial attempt 
to make the GMP functions available as operators under GNU Pascal.
The (ultimate) goal is that you can simply write things like
r := (a + b) * c where a, b, and c have a GMP number type,
instead of writing things like mpq_add ( r, a, b ) ; mpq_mul ( r, r, c ) .

Tom
-- 
E-MAIL: T.Verhoeff @ TUE.NL | Dept. of Math. & Comp. Science
PHONE:  +31 40 247 41 25| Technische Universiteit Eindhoven
FAX:+31 40 247 54 04| PO Box 513, NL-5600 MB Eindhoven
http://www.win.tue.nl/~wstomv/  | The Netherlands
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: Why this evaluates on "if" wrong ?

2007-10-29 Thread L
> It means it displays 10 and has 2 additional digits for internal use. As I
> said, the easiest way to check this is to push the pi button and subtract
> the number you see in the display.

> > Probably -4*10-10 :)

Yes, that's what happens on mine.

> > Unfortunatly I don't use calculators that much any more, but during my
> > school time I knew a lot of waysto crash, fool or whatever calculators.

The kids in my advanced math class would play a game called 'Drug Wars' or
similar on their calculator.. even during exams. They'd copy the answers from me
when they realized they'd been playing Drug Wars on their Ti-83's and didn't
have time to complete their assignment.. ticked me off but for some reason I let
them copy my answers. Probably so they'd remain dumb for the rest of their life.
I just used my casio and never purchased any special calculators for advanced
math class. Of course people would also use Ti-83's to store text information
for cheating.

L505

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: Why this evaluates on "if" wrong ?

2007-10-29 Thread Daniël Mantione


Op Mon, 29 Oct 2007, schreef L:

> > Same as ansistring.. it can be dangerous to hide all the intricate details 
> > of
> a
> > pchar/bytearray, which is what ansistring does. But ansistrings are really
> > useful for 'every day' use.
> 
> > > Wrong. A string can be represented "alphadequate", as it is called; an
> > > ansistring can handle any string you can imagine supposed there is enough
> > > memory available.
> 
> http://www.google.ca/search?q=alphadequate

Noted. Perhaps the reason is it is written with an alpha sign in my books.

> > An adequate or alphadequate representation of a real number cannot exists.
> > Regardless what datastructure you use, there always exists a real number
> > that cannot be represented by it.
> 
> A string with infinite characters cannot be represented.
> Therefore, there is always a string that cannot be represented.

This is the difference between adequate and alphadequate. 
Alphadequate="supposed there is enough memory available". Supposed you 
have enough memory, you can store any string.

On the other hand a Pascal boolean is adequate for storing a 
mathematical boolean, regardless how much memory you have.

And, as said before, no datastructure is adequate for storing a 
mathematical real number. Not even if you have infinite memory.

Daniël___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Re: Why this evaluates on "if" wrong ?

2007-10-29 Thread L
> Same as ansistring.. it can be dangerous to hide all the intricate details of
a
> pchar/bytearray, which is what ansistring does. But ansistrings are really
> useful for 'every day' use.

> > Wrong. A string can be represented "alphadequate", as it is called; an
> > ansistring can handle any string you can imagine supposed there is enough
> > memory available.

http://www.google.ca/search?q=alphadequate


Your search - alphadequate - did not match any documents.

Suggestions:
-Make sure all words are spelled correctly.
-Try different keywords.
-Try more general keywords.
-Tell Google they are wrong with a capital w.


> An adequate or alphadequate representation of a real number cannot exists.
> Regardless what datastructure you use, there always exists a real number
> that cannot be represented by it.

A string with infinite characters cannot be represented.
Therefore, there is always a string that cannot be represented.

RealToStr() for example.


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: Why this evaluates on "if" wrong ? (GMP)

2007-10-29 Thread mm

Tom Verhoeff a écrit :


In fact, the GMP (GNU Multiple Precision Arithmetic Library )
offers this and more.  Unfortunately, there does not seem to be a complete
FreePascal interface for it.  Maybe it is easy to adapt (if necessary?)
the GNU Pascal interface for GMP .
I would be interested.


But there are multi-precision libraries for Free Pascal.

The one I am writing:
"NX" (big integers, big reals, big complexes, big polynomials
over GF(2)) at
http://www.ellipsa.net/

An other one:
"MPINT" (big integers, big rationals) at
http://home.netsurf.de/wolfgang.ehrhardt/misc_en.html#mpint

And there are others.

mm
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: Why this evaluates on "if" wrong ?

2007-10-29 Thread Joao Morais

Daniël Mantione wrote:
And, as said before, no datastructure is adequate for storing a 
mathematical real number. Not even if you have infinite memory.


Nope. If infinite memory was tangible, you would be able to store any 
real number.


--
Joao Morais

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: Why this evaluates on "if" wrong ?

2007-10-29 Thread mm

Joao Morais a écrit :

Daniël Mantione wrote:
And, as said before, no datastructure is adequate for storing a 
mathematical real number. Not even if you have infinite memory.


Nope. If infinite memory was tangible, you would be able to store any 
real number.


How many time would it take to store Pi in an infinite memory? :-)

mm
http://www.ellipsa.net/
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal