Re: [fpc-pascal] Typed Constants vs. Variables

2009-04-05 Thread Jonas Maebe
On 06 Apr 2009, at 03:37, Richard Ward wrote: Where/why would one use a typed constant vs. a variable. i.e. const myConst : double = 2.0*Pi; var myVar : double = 2.0*Pi; It seems to me the typed constant is superfluous and can potentially lead to bugs. Typed constants pr

Re: [fpc-pascal] Typed Constants vs. Variables

2009-04-05 Thread leledumbo
Typed constants ARE changeable (just like variables), the only place where they behave differently from variables is if they're declared in a local scope (i.e. function / procedure). Typed constants act like a static variables in C, where it's initialized only once during program execution. -- Vi

Re: [fpc-pascal] Generating code form xmi files

2009-04-05 Thread leledumbo
Err... how to use this codegen thing? Do I need to run it over Dia generated diagrams or what? Sorry, I don't understand Python. Johann Glaser wrote: > > Hi! > > Am Sonntag, den 05.04.2009, 11:24 -0300 schrieb Osvaldo Filho: >> http://www.opensubscriber.com/message/dia-l...@gnome.org/11515637.

Re: [fpc-pascal] Typed Constants vs. Variables

2009-04-05 Thread Francisco Reyes
Richard Ward writes: Where/why would one use a typed constant vs. a variable. i.e. Any time you have a value you want to have in an accessible holder, but want to ensure you will not change it's value by mistake. It seems to me the typed constant is superfluous and can potentially lead

[fpc-pascal] Typed Constants vs. Variables

2009-04-05 Thread Richard Ward
Where/why would one use a typed constant vs. a variable. i.e. const myConst : double = 2.0*Pi; var myVar : double = 2.0*Pi; It seems to me the typed constant is superfluous and can potentially lead to bugs. ___ fpc-pascal maillis

[fpc-pascal] Re: Case Sensitivity / Multiple Names

2009-04-05 Thread Richard Ward
Francisco Reyes wrote: I was refering to not seeing a note that one can not have a unit name be the same as a function name. I was never refering to case sensitivity. Sorry for not been more clear. --- Ahh, OK. Yes, I've run into that problem myself. The one I remember was where I

Re: [fpc-pascal] Case Sensitivity

2009-04-05 Thread Vinzent Höfler
Richard Ward writes: > I was refering to not seeing a note that one can not > have a unit name be the same as a function name. Sure you can, the function just should not reside in the very same unit. This is a short-coming of the Pascal language definition. Vinzent. -- Pt! Schon vom neue

[fpc-pascal] PasJS: Ext-Core v3 as the RTL

2009-04-05 Thread Bee
Hi all, Especially who is interesting in web programming. I saw yesterday Ext released their first beta for Ext-Core. I think it's the best candidate to be used as default RTL for PasJS. It's also will ease PasJS development because lots of things are already provided by this library, including cr

Re: [fpc-pascal] Syntax problem with first unit

2009-04-05 Thread Tomas Hajny
On Sun, April 5, 2009 17:23, Francisco Reyes wrote: > Michael Van Canneyt writes: > >>> It may help newcomers like myself if this was mentioned on the ref >>> document. >>> Just double checked and it does not mention this. . . > In particular it would be helpful if that note (ie name of fuction a

Re: [fpc-pascal] Syntax problem with first unit

2009-04-05 Thread Mehmet Erol Sanliturk
Tomas Hajny wrote: Note that although having the unit named equally to a function, procedure or a variable defined within the unit (or elsewhere) is not really advisable, it is possible, but you need to take scoping rules into account when trying to access the function, procedure or variable.

Re[6]: [fpc-pascal] Remove unused functions in a class

2009-04-05 Thread JoshyFun
Hello Jonas, Sunday, April 5, 2009, 5:27:02 PM, you wrote: >> Something like this could kill the dead code detection ? A simple >> yes/no is enoght :) JM> Not in case of whole-program optimization: JM> --- dead.sorg 2009-04-05 17:24:25.0 +0200 JM> +++ dead.s 2009-04-05 17:24:32.

Re: [fpc-pascal] Case Sensitivity

2009-04-05 Thread Francisco Reyes
Richard Ward writes: Interestingly, I was going over the lang ref guide last night and found that the case sensitivity is mentioned in section 1.3 for I think from seen this new thread and a few other posts that there is some confusion. When I posted my sample code I had the unit name an

Re: Re[4]: [fpc-pascal] Remove unused functions in a class

2009-04-05 Thread Jonas Maebe
On 05 Apr 2009, at 17:12, JoshyFun wrote: TCustomFoo=class(TObject); TDerivedFoo=class(TCustomFoo) procedure Myprocedure(); virtual; end; TDeDerivedFoo=class(TDerivedFoo) procedure MyProcedure(); override; end; And in the code: var MyObj: TCustomFoo; begin MyObj:=TDeDerivedFoo.Create(); TD

Re: [fpc-pascal] Syntax problem with first unit

2009-04-05 Thread Francisco Reyes
Tomas Hajny writes: Note that although having the unit named equally to a function, procedure or a variable defined within the unit (or elsewhere) is not really advisable, it is possible, but you need to take scoping rules into account Thanks for the note. I wasn't purposedly trying to do it t

Re: [fpc-pascal] Syntax problem with first unit

2009-04-05 Thread Francisco Reyes
Michael Van Canneyt writes: It may help newcomers like myself if this was mentioned on the ref document. Just double checked and it does not mention this. It most certainly does: see the section on reserved words, first paragraph. In the ref document? Page10? Section 1.3? Just looked there a

Re: [fpc-pascal] Generating code form xmi files

2009-04-05 Thread Johann Glaser
Hi! Am Sonntag, den 05.04.2009, 11:24 -0300 schrieb Osvaldo Filho: > http://www.opensubscriber.com/message/dia-l...@gnome.org/11515637.html The current version is available at http://k7103.svn.sourceforge.net/viewvc/k7103/branch/ng/dia-codegen/ Bye Hansi ___

Re[4]: [fpc-pascal] Remove unused functions in a class

2009-04-05 Thread JoshyFun
Hello Jonas, Sunday, April 5, 2009, 2:09:33 PM, you wrote: JM> If you have a class hierarchy tbase->tderived1->tderived2 with a JM> virtual method called "vmethod", and nowhere in the program there is a JM> call to vmethod, then it is unused. Or if it is only called using JM> tderived2 instances,

[fpc-pascal] Case Sensitivity

2009-04-05 Thread Richard Ward
(snipped) Pascal is case insensitive . It may help newcomers like myself if this was mentioned on the ref document. Just double checked and it does not mention this. --- Interestingly, I was going over the lang ref guide last night and found that the case sensitivity is mentioned in se

Re: [fpc-pascal] Syntax problem with first unit

2009-04-05 Thread Michael Van Canneyt
On Sun, 5 Apr 2009, Francisco Reyes wrote: > Mehmet Erol Sanliturk writes: > > > Unit and function names DebugPrint are the same . > > Pascal is case insensitive . Making their cases different does NOT > > make them different . > > > > Please make them different and retry . > > Thanks. That w

Re: [fpc-pascal] Syntax problem with first unit

2009-04-05 Thread David W Noon
On Sun, 2009-04-05 at 10:03 -0400, Francisco Reyes wrote: > Mehmet Erol Sanliturk writes: > > > Unit and function names DebugPrint are the same . > > Pascal is case insensitive . Making their cases different does NOT > > make them different . > > > > Please make them different and retry . > > T

Re: [fpc-pascal] Syntax problem with first unit

2009-04-05 Thread Tomas Hajny
On Sun, April 5, 2009 16:03, Francisco Reyes wrote: > Mehmet Erol Sanliturk writes: > >> Unit and function names DebugPrint are the same . >> Pascal is case insensitive . Making their cases different does NOT >> make them different . >> >> Please make them different and retry . > > Thanks. That wor

Re: [fpc-pascal] Generating code form xmi files

2009-04-05 Thread Osvaldo Filho
http://www.opensubscriber.com/message/dia-l...@gnome.org/11515637.html Em Dom, 2009-04-05 às 11:05 +0200, Michael Fuchs escreveu: > Graeme Geldenhuys schrieb: > > I currently use "Dia Diagram editor" to design UML diagrams, but as > > far as I know it does generate any code. :-( > > Try > http:

Re: [fpc-pascal] Memory Size

2009-04-05 Thread Markus Glugla
Hi Jonas, > First of all, you set the global system unit variable > 'ReturnNilIfGrowHeapFails' to true, so that instead of a run time > error (or exception) you will simply get nil if a memory allocation > fails. This is a very good tip! I have read about 'ReturnNilIfGrowHeapFails' but I for

Re: [fpc-pascal] Syntax problem with first unit

2009-04-05 Thread Francisco Reyes
Mehmet Erol Sanliturk writes: Unit and function names DebugPrint are the same . Pascal is case insensitive . Making their cases different does NOT make them different . Please make them different and retry . Thanks. That worked. It may help newcomers like myself if this was mentioned on the

Re: Re[2]: [fpc-pascal] Remove unused functions in a class

2009-04-05 Thread Jonas Maebe
On 05 Apr 2009, at 13:28, JoshyFun wrote: JM> If you use FPC 2.3.1 with whole-program optimization and the compiler JM> can prove that it is never callable: yes. See JM> http://wiki.freepascal.org/Whole_Program_Optimization JM> for more information. In case this is in relation to the th

Re[2]: [fpc-pascal] Remove unused functions in a class

2009-04-05 Thread JoshyFun
Hello Jonas, Sunday, April 5, 2009, 11:20:59 AM, you wrote: JM> If you use FPC 2.3.1 with whole-program optimization and the compiler JM> can prove that it is never callable: yes. See JM> http://wiki.freepascal.org/Whole_Program_Optimization JM> for more information. In case this is in relatio

Re: [fpc-pascal] Constructors & Destructors 101

2009-04-05 Thread Nikolay Nikolov
Jonas Maebe wrote: If you had two different create constructors (for whatever reason), might you not also need two different destroy destructors? No, the default destructor should always free all resources, regardless of how the class instance was created. Otherwise, it would also make your c

Re: [fpc-pascal] Remove unused functions in a class

2009-04-05 Thread Jonas Maebe
On 05 Apr 2009, at 00:40, JoshyFun wrote: If a virtual method of a class is not used at all in the programm will the compiler remove it from the executable ? If you use FPC 2.3.1 with whole-program optimization and the compiler can prove that it is never callable: yes. See http://wiki.freep

Re: [fpc-pascal] Compiler raise an EAbort exception

2009-04-05 Thread Jonas Maebe
On 04 Apr 2009, at 21:47, ik wrote: I can't reproduce it with a stand alone test (made many attempts). I can however place my original unit, because it is a LGPL unit I'm creating in the bug report, and see what is wrong there. Will it be ok to do that in the bug report ? As long as you at

Re: [fpc-pascal] Memory Size

2009-04-05 Thread Jonas Maebe
On 04 Apr 2009, at 20:47, Markus Glugla wrote: But, if I allocate 2GB memory the program crashs with an access violation. I have read that fpc can handle arrays up to a size of 2GB, isn't? How great can be an array? First of all, you set the global system unit variable 'ReturnNilIfGrowHeap

Re: [fpc-pascal] Generating code form xmi files

2009-04-05 Thread Michael Fuchs
Graeme Geldenhuys schrieb: > I currently use "Dia Diagram editor" to design UML diagrams, but as > far as I know it does generate any code. :-( Try http://www.uni-ulm.de/~s_mgerla/dia2pas.html mfg Michael ___ fpc-pascal maillist - fpc-pascal@lists.f

Re: [fpc-pascal] Generating code form xmi files

2009-04-05 Thread Philippe Martinole
It seem there is nothing available. If it is confirmed, I'll try to write something. I'll have a lot of time because I'm stoping World of Wordcraft :) Philippe ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/ma