Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2003-02

Classes/Objects/Pointers

19 messages · 7 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

James Mills

Hi all,

Sorry to bother you again, can't seem to see what I'm doing wrong it's the same as my dynamic code for strings...

var
   nicks:   PNick;
   nNicks:  Integer;
procedure initialiseDataNicks;
procedure addNick(data: String);
procedure updateNick(index: Integer; nick: pNick);
function getNick(nick: String; var index: Integer): pNick;
procedure delNick(nick: String);
implementation
procedure initialiseDataNicks;
begin
   nNicks := 0;
end;
procedure addNick(data: String);
var
   tokens:  PTokenizer;
   nick:    String;
   hops:    Integer;
   signon:  longInt;
   ident:   String;
   host:    String;
   server:  String;
   unused:  String;
   name:    String;
begin
   tokens := new(PTokenizer, init(data));
   nick := tokens^.nextToken;
   hops := strToInt(tokens^.nextToken);
   signon := strToInt(tokens^.nextToken);
   ident := tokens^.nextToken;
   host := tokens^.nextToken;
   server := tokens^.nextToken;
   unused := tokens^.nextToken;
   name := tokens^.nextToken;
   getMem(nicks, sizeOf(TNick) * nNicks);
50:   nicks := new(PNick, init(nick, hops, signon, ident, host, server, unused, name));
   inc(nNicks);
   dispose(tokens, deInit);
end;

...

$ fpc datanicks.pas
Free Pascal Compiler version 1.0.6 [2002/08/10] for i386
Copyright (c) 1993-2002 by Florian Klaempfl
Target OS: Linux for i386
Compiling datanicks.pas
datanicks.pas(50,19) Error: Incompatible types: got "PNICK" expected
"TNICK"
datanicks.pas(58,16) Error: Illegal qualifier
datanicks.pas(58,25) Error: Illegal qualifier
datanicks.pas(67,26) Error: Illegal qualifier
datanicks.pas(70,26) Error: Illegal qualifier
datanicks.pas(83,31) Error: Illegal qualifier
datanicks.pas(100) Fatal: There were 6 errors compiling module, stopping

If I can fix that error at line 50, I'm sure I can fix the others. Obviously trying to create arrays of type TNick on the fly, but am a little confused here...

thanks for your help
James

Anton Tichawa
to James Mills

Hello!

If TNick is a class - I don't have the declarations - it must be initialized with

  nicks := new(TNick, init(nick, hops, signon, ident, host, server, unused,
  name));

That's correct because TNick is already a pointer, not an object, and init is required to call TNick's constructor.

But the problem ist a more generic one .. I'll try to formulate the questions: A procedure (Alice) passes Data to another procedure (Bob):

***
procedure Alice;
begin
  Bob(Data);
end;
***

Questions:

1. is Data "empty", i. e. is the call to Bob parameterless? Note that even in this case, there is still information flow between them, because 1. Bob knows having been called by Alice (which is information > 0 bit), and 2. might read input and return results in a predefined, global manner.

2. is Data readable?

3. is it writeable?

4. is it a special (CPU, hardwre) register, or global memory?

5. Is Data the only one of it's kind, or does it need addressing? If it needs addressing, is the address defined? Does Data have a fixed size? If not, is the size known or unknown?

6. Other questions that I don't see at the moment. One of these is the SWITCH mentioned below.

7. Is Data a pointer? If this is the case, then pointer types should be able to point to "null", "readable", "writeable", "register / memory", and other.

I think the solution isa kindof redundancy. As a legacy example, look at pointers: Pointers with value $00000000 are defined as "nil". That disallows pointing to a variable at address 0. On one hand, that excludes memory at address 0 to be used for "pointed-to" data. On the other hand, low-level access with references to address 0 might still be required in some cases, simply to increase performance.

There should be some kind of aggreement about Data. As a second example, Classes e. g. are now checked (the VMT contains a kind of checksum), but this is dangerous for every-day run-time type information, because a pice of arbitrary data might contain a correct checksum, thus pretending to be a class .. trak! exception.

I suggest the words "SAFE" and "FAST" for these two "modes of operation".

SAFE mode obeys legacy agreements, forces redundancy, and Bob is guaranteed to find a solution for the questions mentioned above, converning Data. In case of misunderstandings, exception handling moves the system to the safe side.

In FAST mode, there is no redundancy, i. e. hardware runs at full speed, but software might crash.

I suggest a BIG RED SWITCH on top / front of the computer, which is normally switched OFF, forcing SAFE mode, disallowing references to address 0 with a pointer, requiring action to follow previous negotiations.

Any ideas how to continue this topic?

Anton Tichawa.

----------

"Adas Methode war, wie sich zeigen wird, Tagträume in offenbar korrekte Berechnungen einzuweben."

Doris Langley Moore: Ada, Countess of Lovelace (London 1977).

----------

Anton Tichawa
Volkertstrasse 19 / 20
A-1020 Wien
mobil: +43 664 52 07 907
email:

----------

James Mills
to Anton Tichawa
Anton Tichawa wrote 13 lines
Hello! If TNick is a class - I don't have the declarations - it must be initialized with nicks := new(TNick, init(nick, hops, signon, ident, host, server, unused, name)); That's correct because TNick is already a pointer, not an object, and init is required to call TNick's constructor. But the problem ist a more generic one .. I'll try to formulate the questions: A procedure (Alice) passes Data to another procedure (Bob):

So you say I should be using class declarations instead of object ? Fair enough if that's the case, but could you show a simple example that uses just object declarations ?

ie:

type
   TmyObject = object
      constructor init;
      destructor deInit;
      private
      public
         procedure test;
   end;
   PmyObject = ^TmyObject;
procedure TmyObject.test;
begin
   writeLn('test');
end;

...

James

Show quoted text 83 lines
*** procedure Alice; begin Bob(Data); end; *** Questions: 1. is Data "empty", i. e. is the call to Bob parameterless? Note that even in this case, there is still information flow between them, because 1. Bob knows having been called by Alice (which is information > 0 bit), and 2. might read input and return results in a predefined, global manner. 2. is Data readable? 3. is it writeable? 4. is it a special (CPU, hardwre) register, or global memory? 5. Is Data the only one of it's kind, or does it need addressing? If it needs addressing, is the address defined? Does Data have a fixed size? If not, is the size known or unknown? 6. Other questions that I don't see at the moment. One of these is the SWITCH mentioned below. 7. Is Data a pointer? If this is the case, then pointer types should be able to point to "null", "readable", "writeable", "register / memory", and other. I think the solution isa kindof redundancy. As a legacy example, look at pointers: Pointers with value $00000000 are defined as "nil". That disallows pointing to a variable at address 0. On one hand, that excludes memory at address 0 to be used for "pointed-to" data. On the other hand, low-level access with references to address 0 might still be required in some cases, simply to increase performance. There should be some kind of aggreement about Data. As a second example, Classes e. g. are now checked (the VMT contains a kind of checksum), but this is dangerous for every-day run-time type information, because a pice of arbitrary data might contain a correct checksum, thus pretending to be a class .. trak! exception. I suggest the words "SAFE" and "FAST" for these two "modes of operation". SAFE mode obeys legacy agreements, forces redundancy, and Bob is guaranteed to find a solution for the questions mentioned above, converning Data. In case of misunderstandings, exception handling moves the system to the safe side. In FAST mode, there is no redundancy, i. e. hardware runs at full speed, but software might crash. I suggest a BIG RED SWITCH on top / front of the computer, which is normally switched OFF, forcing SAFE mode, disallowing references to address 0 with a pointer, requiring action to follow previous negotiations. Any ideas how to continue this topic? Anton Tichawa. ---------- "Adas Methode war, wie sich zeigen wird, Tagtr?ume in offenbar korrekte Berechnungen einzuweben." Doris Langley Moore: Ada, Countess of Lovelace (London 1977). ---------- Anton Tichawa Volkertstrasse 19 / 20 A-1020 Wien mobil: +43 664 52 07 907 email: ---------- _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal
James Mills
to Anton Tichawa: Hello, James! Personally, I would prefer an even simpler way - but that depends on the…
Anton Tichawa wrote 27 lines
Hello, James! Personally, I would prefer an even simpler way - but that depends on the future development and backwards compatibility of Free Pascal. Basically, the first step towards objects is ENCAPSULATION, which is PURE SYTNAX, i. e. there are no constructors / destructors required. Your example, including a procedure "main" actually using the object would then be: *** type TmyObject = object procedure test; end; procedure TmyObject.test; begin ? ?writeLn('test'); end; procedure main; var MyObject: TmyObject; begin MyObject.Test; end; *** That's all. Next question?

Yes ok, fair enough, this much is in my knowledge of Pascal :) hehe, but the real question is, how do you create these objects on the fly in a program, ie: dynamic array...
I have tried using plain objects, and have failed in frustration. When you suggested using classes, it worked right away (of course :P).

cheers
James

Show quoted text 24 lines
HTH Anton Tichawa. ---------- "Adas Methode war, wie sich zeigen wird, Tagtr?ume in offenbar korrekte Berechnungen einzuweben." Doris Langley Moore: Ada, Countess of Lovelace (London 1977). ---------- Anton Tichawa Volkertstrasse 19 / 20 A-1020 Wien mobil: +43 664 52 07 907 email: ---------- _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Matt D. Emson

James,

One important question... If you are using Delphi source (as you implied in the pointers thread), why use Turbo Pascal style objects in your conversion? If you used classes, it would be much easier on yourself. No pointer notation needed etc, could use the Tinifile class (I assume this is in the classes unit of RTL/FCL.) You seem to be beating your head with a rock, just to use obsolete (as Borland sees it) syntax.

Matt

James Mills
to Matt D. Emson
Matt D. Emson wrote 8 lines
James, One important question... If you are using Delphi source (as you implied in the pointers thread), why use Turbo Pascal style objects in your conversion? If you used classes, it would be much easier on yourself. No pointer notation needed etc, could use the Tinifile class (I assume this is in the classes unit of RTL/FCL.) You seem to be beating your head with a rock, just to use obsolete (as Borland sees it) syntax.

No I've been using FPC all along, haven't touched Delphi in years since I moved to Debian Linux. (Hate windoze :P hehe). But I'd still like to know how it's done the (obsolete way)...

cheers
James

Using classes now does work and works nicely, however the documentation doesn't say what the default constructor and destructors are

Show quoted text 7 lines
Matt _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Matt D. Emson

-----Original Message-----

Earlier message 57 lines
From: Matt Emson Sent: 10 February 2003 13:29 To: '' Subject: RE: [fpc-pascal]Classes/Objects/Pointers / Pointer Help This is where Classes are better than objects... This will only work if you don't reference any thing that is instantiated by the constructor, i.e. all Methods and fields. > *** > type TmyObject = object > procedure test; > end; type TMyClass = class class procedure test; end; > procedure TmyObject.test; > begin >    writeLn('test'); > end; As is, but add 'class' prefix.. > procedure main; > var > MyObject: TmyObject; > begin > MyObject.Test; > end; > *** No changes. What you want is garbage collection, not a lack of constructors/destructors... What you will get is VBPascal. Nasty. You could try: IMyClass = interface procedure Test; end; TMyClass = class(TInterfacedObject, IMyClass) class function Get(): TMyClass; procedure Test; end; Class function TMyClass.Get() : IMyClass; Begin result := TMyClass.Create; End; Though this is quite nasty in itself too. Matt
Matt D. Emson
Basically, the first step towards objects is ENCAPSULATION, which is PURE SYTNAX, i. e. there are no constructors / destructors required.

An Object is an Instance of a Class. A class needs to be constructed. Even C++ stack based instances have a constructor. What you want is for the constructor to be implicetly called. This is something quite different.

The Turbo Pascal style is very outdated.

Your example, including a procedure "main" actually using the object

would then be:

I would like to see the removal of the distiction between procedure and function. This would be replaced by a generic 'method'. I would like to see static methods, as in C++, that can be used as if they were external procedures or functions, but are logically bound to the class. This would make things like WindProcs and WinAPI call backs much cleaner. I would like to see a Java like mode, with no external items, everything is part of a class. I would like to see namespaces, and therefore easier scope resolution that just relying on the unit name (maybe a bit like packages in ADA??) No more Units. Separate Interface and implementation files. Inline code!

Maybe I should just wait for Delphi.NET ;-) that will be at least part of the way there!

// file : MyPascalModification.Int[erface]
Interface MyPascalModification;
Namespace MattsStuff;
Type
  MyWin = class(Windows.Forms.Window);
  MyApp = class(Windows.Application.WinApplication)
    static method WinProcWindow: HWND; Message, WParam: Longint; LParam:
Longint): Longint; stdcall;
    static method Main(cmdline: Tstrings): void; inline;
    begin
      app := MyApp.Create(...);
      try
        app.MainWindow := MyWin.Create(...);
        app.Run();
      finally
        app.free;
      end;
    end;
    method Test: void;
  end;
End.
// file : MyPascalModification.imp[lementation]
Implementation MyPascalModification;
Interfaces MyPascalModification; //overkill??
Using namespace MattsStuff;
method MyApp.Test: void;
Begin
  Console.writeln('test');
End;
static method MyApp.WinProcWindow: HWND; Message, WParam: Longint;
LParam: Longint): Longint; stdcall;
Begin
  ...
End;
End.
Thomas Schatzl
to James Mills: Yes ok, fair enough, this much is in my knowledge of Pascal :) hehe, but the real…

From: "James Mills"
Sent: Monday, February 10, 2003 2:04 PM
Subject: Re: [fpc-pascal]Classes/Objects/Pointers / Pointer Help

Hi,

Show quoted text 5 lines
Yes ok, fair enough, this much is in my knowledge of Pascal :) hehe, but the real question is, how do you create these objects on the fly in a program, ie: dynamic array... I have tried using plain objects, and have failed in frustration. When you suggested using classes, it worked right away (of course :P).

If you're bound to 1.0.6 which doesn't support dynamic arrays by using compiler magic you have to do it like this:

-----------
program Project1;

uses
SysUtils; { IntToStr() }

type
  PMyObject = ^TMyObject;
  { note: this is our template for our object container array. With the
  upper bound set to zero you might get range check errors while
  compiling and run time errors if you turn runtime range checking on...
  You could set the upper bound to a ridiculously high value if this
  disturbs you (since it's just a template and not really allocated
  anywhere). I assume that the number of elements is dynamic though, so
  if you *know* that you only need 5 elements max it's better to say
  that here.
  Better might be using dynamic arrays available in FPC 1.1 than this
  construct. And even better might be (depending on your needs)
  other concepts to store data dynamically, e.g. linked lists (see
  the 'net or any introductionary algorithm book).
  }
  TMyObjectArr = array[0..0] of PMyObject;
  { big note: better use the Object pascal 'classes' concept instead of
  'objects'... see FPC reference guide chapter 4 and 5 respectively - but
  I'll stick to old-fashioned objects here :-) }
  TMyObject = object
  private
    fString : String;
  public
    constructor Init(s : String);
    { note: the empty brackets after methods are sort of personal coding
convention }
    destructor Done();
    procedure DoSomething();
  end;
constructor TMyObject.Init(s : String);
begin
  Writeln('Calling Init...');
  fString := s;
end;
destructor TMyObject.Done();
begin
  Writeln('Calling Done...');
end;
procedure TMyObject.DoSomething();
begin
  Writeln(fString);
end;
var
  dynObjArr : ^TMyObjectArr;
  i : Integer;
begin
  { initialize container (assume we need 5 elements) }
  getmem(dynObjArr, sizeof(PMyObject) * 5);
  { since we overwrite all elements later on this isn't really required }
  for i := 0 to 5-1 do begin
    dynObjArr^[i] := nil;
  end;
  for i := 0 to 5-1 do begin
   dynObjArr^[i] := new(PMyObject, Init('Hello World (' + IntToStr(i) +
')'));
  end;
  { [....]
   display a few of the elements in the array... }
  Writeln('Looking what''s inside...');
  for i := 2 to 5-1 do begin
   dynObjArr^[i]^.DoSomething();
  end;
  { [....]
   free the 2nd element (index 1) }
  Writeln('Freeing one element...');
  dispose(dynObjArr^[1], Done());
  { convention: invalid element entries are nil'ed; if you iterate
   over the element to do something with them *don't* call nil'ed
   elements... (didn't check this here in all the output loops at all
   though) }
  dynObjArr^[1] := nil;
  { stick another one in its place }
  Writeln('Putting another element into the array...');
  dynObjArr^[1] := new(PMyObject, Init('Good Bye'));
  { display them all again }
  Writeln('Looking what''s inside...');
  for i := 0 to 5-1 do begin
   dynObjArr^[i]^.DoSomething();
  end;
  Writeln('Removing everything...');
  for i := 0 to 5-1 do begin
   dispose(dynObjArr^[i], Done());
  end;
  { remove container }
  freemem(dynObjArr, sizeof(PMyObject) * 5);
  readln;
end.
---------

I hope this addresses your questions.

Regards,
Thomas

Anton Tichawa
to James Mills: So you say I should be using class declarations instead of object ? Fair enough if that's…

Hello, James!

Personally, I would prefer an even simpler way - but that depends on the future development and backwards compatibility of Free Pascal. Basically, the first step towards objects is ENCAPSULATION, which is PURE SYTNAX, i. e. there are no constructors / destructors required. Your example, including a procedure "main" actually using the object would then be:

***
type TmyObject = object
  procedure test;
end;
procedure TmyObject.test;
begin
   writeLn('test');
end;
procedure main;
var
  MyObject: TmyObject;
begin
  MyObject.Test;
end;
***

That's all. Next question?

HTH

Anton Tichawa.

----------

"Adas Methode war, wie sich zeigen wird, Tagträume in offenbar korrekte Berechnungen einzuweben."

Doris Langley Moore: Ada, Countess of Lovelace (London 1977).

----------

Anton Tichawa
Volkertstrasse 19 / 20
A-1020 Wien
mobil: +43 664 52 07 907
email:

----------

Anton Tichawa
to James Mills: Yes ok, fair enough, this much is in my knowledge of Pascal :) hehe, but the real…

Hello, James!

Yes ok, fair enough, this much is in my knowledge of Pascal :) hehe, but the real question is, how do you create these objects on the fly in a program, ie: dynamic array...

The object TmyObject from our previous example uses no your object contains fields, you might declare it statically, as in TmyObject, but "on the fly" requires dynamic allocation on the heap:

*** example 2
type t_my_object = object
  f_name: shortstring;
  procedure draw;
  end;
type p_my_objects = ^ t_my_object;
function allocate_my_objects (n: cardinal): p_my_objects;
begin
  getmem(result, n * sizeof(t_my_object));
end;
procedure main;
const
  num = 3;
var
  i: integer;
  p: p_my_objects;
begin
  p := allocate_my_objects (num);
  for i := 0 to num - 1 do begin
    p[i].f_name := 'instance ' + intstr(i);  // C-like syntax
  end;
  for i := 0 to num - 1 do begin
    p[i].draw;
  end;
  freemem(p);  // the memory manager knows where and how much to free
end.
***

I didn't actually compile and test this piece of code - there might be errors.

cheers - anton tichawa.

----------

"Adas Methode war, wie sich zeigen wird, Tagträume in offenbar korrekte Berechnungen einzuweben."

Doris Langley Moore: Ada, Countess of Lovelace (London 1977).

----------

Anton Tichawa
Volkertstrasse 19 / 20
A-1020 Wien
mobil: +43 664 52 07 907
email:

----------

Lee, John

If you keep it runnnable on windoze and go32v2, I'll help you to test it. I can also contribute eg a (non OO) FP test unit? if you like. Any ideas about how to define the 'features' to be tested? Regards John

Earlier message 13 lines
-----Original Message----- Hello, List! > Do you want to write that? :) If nobody else does, I do. But I'd prefer doing it for linux only. Anton. This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.
Michael Van Canneyt
to Anton Tichawa: Hello! Well, the test program I think of needs to: 1. create pascal sources and…
Anton Tichawa wrote 24 lines
Hello! > If you keep it runnnable on windoze and go32v2, I'll help you to test it. I Well, the test program I think of needs to: 1. create pascal sources and configuration files & write them to disk 2. start the compiler and review it's console output 3. start the created application 4. check the results of the created application, including "killing crashed applications" It's a lot of work, if not impossible, to view output, and to start and kill applications under microsoft widowsm, and there's more danger in actually letting an application crash. So what would be needed for keeping it running under windows and go32v2? The idea of a non-OOP test first is good. I think the first test target should be a 'hello, world?' program that display 'hello, world?' and then continuously examines the keyboard and draws some kind of progress. This, too, is very hard to do under windows.

I suggest you check out the tests; it does all you describe.

cvs co tests

will get all tests. The tests can be run on any platform.

Michael.

Anton Tichawa
to Lee, John: If you keep it runnnable on windoze and go32v2, I'll help you to test it. I can also…

Hello!

If you keep it runnnable on windoze and go32v2, I'll help you to test it. I

Well, the test program I think of needs to:

1. create pascal sources and configuration files & write them to disk

2. start the compiler and review it's console output

3. start the created application

4. check the results of the created application, including "killing crashed applications"

It's a lot of work, if not impossible, to view output, and to start and kill applications under microsoft widowsm, and there's more danger in actually letting an application crash. So what would be needed for keeping it running under windows and go32v2?

The idea of a non-OOP test first is good. I think the first test target should be a 'hello, world?' program that display 'hello, world?' and then continuously examines the keyboard and draws some kind of progress. This, too, is very hard to do under windows.

Anton Tichawa.

Show quoted text 24 lines
can also contribute eg a (non OO) FP test unit? if you like. Any ideas about how to define the 'features' to be tested? Regards John -----Original Message----- Hello, List! > Do you want to write that? :) If nobody else does, I do. But I'd prefer doing it for linux only. Anton. This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you. _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal
---------- "Adas Methode war, wie sich zeigen wird, Tagträume in offenbar korrekte Berechnungen einzuweben." Doris Langley Moore: Ada, Countess of Lovelace (London 1977). ---------- Anton Tichawa Volkertstrasse 19 / 20 A-1020 Wien mobil: +43 664 52 07 907 email: ----------
Anton Tichawa
to Michael Van Canneyt: I suggest you check out the tests; it does all you describe. cvs co tests will get all…
you wrote
I suggest you check out the tests; it does all you describe.

ok.

In no particular order:

i long to be a member of the free pascal development team. comments are welcome. are there any rites involved, such as programming a 4d-visualization of the fourier transform or creating an aboriginal version of the VCL?

Show quoted text 8 lines
Thank you, Carl. Thank you, Daniël. Thank you, Florian. Thank you, Jonas. Thank you, Marco. Thank you, Michael. Thank you, Peter. Thank you, Pierre.

i aggree.

anton tichawa.

----------

"Adas Methode war, wie sich zeigen wird, Tagträume in offenbar korrekte Berechnungen einzuweben."

Doris Langley Moore: Ada, Countess of Lovelace (London 1977).

----------

Anton Tichawa
Volkertstrasse 19 / 20
A-1020 Wien
phone: +43 1 218 97 59
mobil: +43 664 52 07 907
email:

----------

Anton Tichawa
to Lee, John: If you keep it runnnable on windoze and go32v2, I'll help you to test it. I can also…

Hello, John!

can also contribute eg a (non OO) FP test unit? if you like. Any ideas about how to define the 'features' to be tested? Regards John
***
procedure define;
begin
  lock;  // (?)
  brainstorm;
  ..
***

well, my first contribution to a brainstorming of features to be tested is -

* DETERMINE SYSTEM STATUS ..: the test program should determine and evaluate the status of installed compilers / ides on the given system, without write operations e. g. to the mass storage media. things such as missing, misplaced, misspelled, .., or ambiguos configuration, e. g. in the file fpc.cfg, should be mentioned on the screen. upon user intervention - and also timeout is a user intervention - the status should be first saved and then be overloaded with a new one that seems appropriate to both user and tester. but that's not really important at the moment. the important thing is that the saved stati - those that didn't seem appropriate at the moment - are the most valuable thing of free pascal from a certain point of view. this is the output of the tester program, the bug list, and will help answer any question that may come in the future. i'm talking about, well, excuse my poor english here, fehler (d) = errrors (e) (?), because in every such "thing" is one bit of truth that will surely be reconsidered as free pascal development continues. no bug must be lost, or so .. uh.

anton tichawa.

----------

"Adas Methode war, wie sich zeigen wird, Tagträume in offenbar korrekte Berechnungen einzuweben."

Doris Langley Moore: Ada, Countess of Lovelace (London 1977).

----------

Anton Tichawa
Volkertstrasse 19 / 20
A-1020 Wien
mobil: +43 664 52 07 907
email:

----------

Jonas Maebe
to Anton Tichawa: ok. i long to be a member of the free pascal development team. comments are welcome. are…
Anton Tichawa wrote
i long to be a member of the free pascal development team. comments are welcome. are there any rites involved, such as programming a 4d-visualization of the fourier transform or creating an aboriginal version of the VCL?

The only "requirement" is that you supply several patches to fix bugs in the compiler and/or rtl/packages/fcl/... When we become bored committing all your patches, you get cvs write access so you can commit them yourself and you're "part of the team" :)

Jonas

Lee, John

ok, so for the appropriate o/s we

repeat
1 just scan the local disks for eg the ppc386.exes, fp.exes, ppc.cfgs, base*,zips, ide*.zips or whatever are appropriate for the o/s & o/p to screen what versions etc the user has on the system 2 then look in ppc.cfg & check whether the references there eg to paths & files are valid
3 generate n programs & compile them, o/p any compile errors 4 run tests (eg those in the cvs ??? or the ones in the program we are discussing? or both) & o/p results/errors
5 if tests are in loop stop the pograms & o/p error message until (timeout or ctrl/c or ???);

Sounds as if 3 & 4 are the difficult bits...

Regards John

Earlier message 64 lines
-----Original Message----- From: Anton Tichawa Sent: Wednesday, February 12, 2003 04:18 To: Subject: Re: [fpc-pascal]Classes/Objects/Pointers / Pointer Help Hello, John! > can also contribute eg a (non OO) FP test unit? if you like. Any ideas > about how to define the 'features' to be tested? Regards John *** procedure define; begin lock; // (?) brainstorm; .. *** well, my first contribution to a brainstorming of features to be tested is - * DETERMINE SYSTEM STATUS ..: the test program should determine and evaluate the status of installed compilers / ides on the given system, without write operations e. g. to the mass storage media. things such as missing, misplaced, misspelled, .., or ambiguos configuration, e. g. in the file fpc.cfg, should be mentioned on the screen. upon user intervention - and also timeout is a user intervention - the status should be first saved and then be overloaded with a new one that seems appropriate to both user and tester. but that's not really important at the moment. the important thing is that the saved stati - those that didn't seem appropriate at the moment - are the most valuable thing of free pascal from a certain point of view. this is the output of the tester program, the bug list, and will help answer any question that may come in the future. i'm talking about, well, excuse my poor english here, fehler (d) = errrors (e) (?), because in every such "thing" is one bit of truth that will surely be reconsidered as free pascal development continues. no bug must be lost, or so .. uh. anton tichawa. ---------- "Adas Methode war, wie sich zeigen wird, Tagträume in offenbar korrekte Berechnungen einzuweben." Doris Langley Moore: Ada, Countess of Lovelace (London 1977). ---------- Anton Tichawa Volkertstrasse 19 / 20 A-1020 Wien mobil: +43 664 52 07 907 email: ----------
Anton Tichawa
to Lee, John

Hello!

3 generate n programs & compile them, o/p any compile errors 4 run tests (eg those in the cvs ??? or the ones in the program we are Sounds as if 3 & 4 are the difficult bits...

But I actually do step 3 on my PC, under linux. I tried the same before under a popular operating system, but though working several hours, I did not manage to start one application from within another one. There was a function that worked, but it was called "deprecated" or so.

Step 3 would be to generate pascal sources. This generation has it's root in the definition of the Pascal Language and would check every feature to a certain degree, using "equivalence classes".

Step 3 includes checking if the compiler produces errors where it should produce an error, and if it compiles where it should compile. The actual output would be a bug list.

Only those cases where Step 3 is bug-free, would then be executed ..

Anton.

"Adas Methode war, wie sich zeigen wird, Tagträume in offenbar korrekte Berechnungen einzuweben."

Doris Langley Moore: Ada, Countess of Lovelace (London 1977).

----------

Anton Tichawa
Volkertstrasse 19 / 20
A-1020 Wien
mobil: +43 664 52 07 907
email:

----------