Re: [fpc-pascal] Class helper properties

2019-02-25 Thread Mattias Gaertner via fpc-pascal
On Sun, 24 Feb 2019 11:03:17 -0500 Ryan Joseph wrote: > http://wiki.freepascal.org/Helper_types#Usage says class helpers can > use properties. Why am I getting this error? > > program test; > > type > TMyObject = class > m_num: integer; > property num1: integer

Re: [fpc-pascal] FPC fixes3.2 gives error on "NWord div 2 * 2"

2019-02-17 Thread Mattias Gaertner via fpc-pascal
FPC gives an error on the NWord Maybe the compiler tries to be politically correct. šŸ˜‚ Sorry, couldn't resist. Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] Lazarus Release 2.0.0

2019-02-05 Thread Mattias Gaertner via fpc-pascal
The Lazarus team is glad to announce the release of Lazarus 2.0.0. This release was built with FPC 3.0.4. The previous release Lazarus 1.8.4 was built with FPC 3.0.4 as well. Here is the list of changes for Lazarus and Free Pascal: http://wiki.lazarus.freepascal.org/Lazarus_2.0.0_release_notes h

Re: [fpc-pascal] type helper default property

2019-01-17 Thread Mattias Gaertner via fpc-pascal
On Thu, 17 Jan 2019 22:42:39 +0100 Sven Barth via fpc-pascal wrote: >[...] > > Is this an oversight, or has FPC some use for the default > > directive? > For now I'd say that it's an oversight. Delphi allows it for class > and record helpers, but not for helpers for primitive types. In > theory

[fpc-pascal] type helper default property

2019-01-17 Thread Mattias Gaertner via fpc-pascal
Hi, For example: type THelper = type helper for string function GetItems(Index: word): word; property Items[Index: word]: word read GetItems; default; end; Delphi forbids this with "'default' directive not allowed in record helper type". FPC ignores it. Aka aString[1] has still the no

[fpc-pascal] type helper constructor

2019-01-17 Thread Mattias Gaertner via fpc-pascal
Hi, A type helper for a string can add a constructor. But how it can be used differs between FPC and Delphi. For example: {$modeswitch typehelpers} type THelper = type helper for string constructor Creator(i: integer); end; var s: string; begin string.creator(3); // allowed in d

Re: [fpc-pascal] type helpers

2019-01-11 Thread Mattias Gaertner via fpc-pascal
On Fri, 11 Jan 2019 14:27:13 +0100 Sven Barth via fpc-pascal wrote: >[...] > This is by design. In this case DoIt is called on a temp variable > that gets its value from b.w, the value of b.FW does not change Ehm, in this case b.FW *does* changes. Maybe you mean the case property W: word read

[fpc-pascal] type helpers

2019-01-11 Thread Mattias Gaertner via fpc-pascal
Hi, A type helper can change Self. I wondered how FPC 3.3.1 handles properties and got some unexpected results. Is this by design, a bug, or not-yet-implemented? {$mode objfpc}{$modeswitch typehelpers} type TIntHlp = type helper for word procedure DoIt; end; TBig = class strict priva

Re: [fpc-pascal] Multi-scope helpers draft

2019-01-10 Thread Mattias Gaertner via fpc-pascal
On Sat, 24 Nov 2018 11:20:05 +0700 Ryan Joseph wrote: > Iā€™d like to propose this mode switch ($modeswitch multiscopehelpers) > to allow multiple helpers per scope. Can you explain the order/precedence of multiple helpers? Btw, why is the modeswitch called multiscopehelpers instead of multihelpe

Re: [fpc-pascal] Constants in generics

2019-01-03 Thread Mattias Gaertner via fpc-pascal
On Thu, 3 Jan 2019 14:58:00 +0300 Alexander Shishkin via fpc-pascal wrote: >[...] > This is OK (both T and U are integer): > generic TMyRecord1 = record end; That is inconsistent to normal Pascal arguments. Name[, Name ...][:type] Isn't it? Mattias ___

Re: [fpc-pascal] Generic (TFPGObjectList) EInvalidCast

2018-12-11 Thread Mattias Gaertner via fpc-pascal
On Tue, 11 Dec 2018 22:19:11 +0100 Vojtěch ČihĆ”k wrote: > Hi, > Ā  > why this code givesĀ EInvalidCast at runtime (but compiles well):w > Ā  > program Project1; > {$mode objfpc}{$H+} > Ā  > uses > Ā  {$IFDEF UNIX}{$IFDEF UseCThreads} > Ā  cthreads, > Ā  {$ENDIF}{$ENDIF} > Ā  Classes, fgl > Ā  { you can ad

Re: [fpc-pascal] precedence "is" and "and"

2018-12-08 Thread Mattias Gaertner via fpc-pascal
On Sat, 8 Dec 2018 22:03:11 +0100 (CET) Michael Van Canneyt wrote: >[...] > In delphi, AS is second level, and 'is' is fourth level. > > http://docwiki.embarcadero.com/RADStudio/Tokyo/en/Expressions_(Delphi) > > If FPC does this differently, then I think this is an incompatibility. What has "a

Re: [fpc-pascal] precedence "is" and "and"

2018-12-08 Thread Mattias Gaertner via fpc-pascal
On Sat, 8 Dec 2018 21:23:57 +0100 Marco van de Voort wrote: > Op 2018-12-08 om 20:38 schreef Mattias Gaertner via fpc-pascal: > > According to the docs, the "is" operator is fourth level, the "and" > > is second level, so the "and" must be computed

Re: [fpc-pascal] precedence "is" and "and"

2018-12-08 Thread Mattias Gaertner via fpc-pascal
On Sat, 8 Dec 2018 20:38:23 +0100 Mattias Gaertner via fpc-pascal wrote: > Hi, > > According to the docs, the "is" operator is fourth level, the "and" is > second level, so the "and" must be computed before the "is". Link: https://ww

Re: [fpc-pascal] precedence "is" and "and"

2018-12-08 Thread Mattias Gaertner via fpc-pascal
On Sat, 8 Dec 2018 20:38:23 +0100 Mattias Gaertner via fpc-pascal wrote: >[...] > According to the docs, the "is" operator is fourth level, the "and" is > second level, so the "and" must be computed before the "is". But it > seems fpc treats &

[fpc-pascal] precedence "is" and "and"

2018-12-08 Thread Mattias Gaertner via fpc-pascal
Hi, According to the docs, the "is" operator is fourth level, the "and" is second level, so the "and" must be computed before the "is". But it seems fpc treats "is" and "and" as same level: {$mode objfpc} uses Classes; var b: boolean; o: TObject; begin // this compiles, but should fail: i

Re: [fpc-pascal] Constants in generics

2018-11-27 Thread Mattias Gaertner via fpc-pascal
On Tue, 27 Nov 2018 11:35:22 +0100 Sven Barth via fpc-pascal wrote: >[...] > > const > > kSomeDays:TDays = [Mon, Wed]; >[...] > The difference between typed and untyped constants are available > everywhere else in the language as well, so I have no qualms (at > least for now?) to error ou

Re: [fpc-pascal] INSTALL_PREFIX, INSTALL_LIBDIR

2018-11-11 Thread Mattias Gaertner via fpc-pascal
On Fri, 19 Oct 2018 16:40:19 +0200 christo wrote: > On 2018/10/18 09:26, Mattias Gaertner via fpc-pascal wrote: > > How to control where 'make install' puts the libraries (e.g. > > libpas2js.so)? > > > > I tried "INSTALL_LIBDIR=~/tmp/lib64", but

[fpc-pascal] INSTALL_PREFIX, INSTALL_LIBDIR

2018-10-18 Thread Mattias Gaertner via fpc-pascal
Hi, How to control where 'make install' puts the libraries (e.g. libpas2js.so)? I tried "INSTALL_LIBDIR=~/tmp/lib64", but that moves everything *except* libraries to "~/tmp/lib64". See bug https://bugs.freepascal.org/view.php?id=34346 Mattias ___ fpc

Re: [fpc-pascal] Concatenating CP Strings

2018-09-14 Thread Mattias Gaertner via fpc-pascal
On Sat, 15 Sep 2018 01:38:33 +0200 Martok wrote: > Hi all, > > concatenating codepage strings is documented to be a bit weird: > > > Knowing this, how does one achieve the following? > > - have a string in any dynamic codep

Re: [fpc-pascal] access violation?

2018-07-27 Thread Mattias Gaertner
On Fri, 27 Jul 2018 11:41:51 -0600 Ryan Joseph wrote: >[...] > How do I disable this? I just ran this test program with -CR and I still > calls the method statically. You are right. I just tested myself. Either I'm confusing the flag or it has been changed. Once upon a time Lazarus used the sam

Re: [fpc-pascal] access violation?

2018-07-27 Thread Mattias Gaertner
On Fri, 27 Jul 2018 11:06:11 -0600 Ryan Joseph wrote: >[...] > Iā€™m totally confused now. Since when was it ok to call methods on nil > objects? You can't if you compile with -CR. The RTL is not compiled with objectchecks, so it works there. > According to this test not only can you call metho

Re: [fpc-pascal] FPC_PCHAR_LENGTH dog slow

2018-07-03 Thread Mattias Gaertner
On Tue, 3 Jul 2018 09:15:16 -0600 Ryan Joseph wrote: > I was just parsing something and found that a call to length on a pchar was > taking 90+% of the time in FPC_PCHAR_LENGTH. > > Why is that so crazy slow? Does it need to iterate the entire length of the > string to know itā€™s length? Yes.

Re: [fpc-pascal] List of chars for case

2018-07-02 Thread Mattias Gaertner
On Sun, 1 Jul 2018 16:51:08 -0600 Ryan Joseph wrote: > Is there a way to make a constant for a list of chars which I can use in a > case statement? Iā€™ve got a bunch of code duplication happening Iā€™d like to > clean up. > > const > TChars = ('[', ']', '(', ')', '{', '}', '=', ā€˜:ā€™); > > > ca

Re: [fpc-pascal] macos make 3.1.1 fails

2018-06-26 Thread Mattias Gaertner
On Tue, 26 Jun 2018 09:07:00 +0100 C Western wrote: >[...] > Carbon is i386 only, so i386 is still needed. I haven't figured out all > the options, but the command line that works for me is: > > FPC=/usr/local/lib/fpc/3.0.4/ppc386 make distclean install PREFIX=~/usr > CPU_SOURCE=i386 > > (All

[fpc-pascal] macos make 3.1.1 fails

2018-06-25 Thread Mattias Gaertner
Hi, Trying to compile fpc 3.1.1 i386 on Mac High Sierra 10.13.5: make CPU_TARGET=i386 PP=/usr/local/lib/fpc/3.0.4/ppc386 all The CPU_TARGET seems to be ignored: /Applications/Xcode.app/Contents/Developer/usr/bin/make compiler_cycle RELEASE=1 /Applications/Xcode.app/Contents/Developer/usr/bin/ma

[fpc-pascal] how to get rid of hints

2018-06-25 Thread Mattias Gaertner
Hi, How to get rid of hint 6068? With fpc 3.1.1 using some units like fgl the compiler emits: .../fpc/rtl/objpas/fgl.pp(899,1) Hint: "inherited" not yet supported inside inline procedure/function .../fpc/rtl/objpas/fgl.pp(899,1) Hint: Inlining disabled There is no clue, what of my code triggers

Re: [fpc-pascal] Feature announcement: Dynamic array extensions

2018-06-21 Thread Mattias Gaertner
On Thu, 21 Jun 2018 15:17:39 +0700 Ryan Joseph wrote: >[...] > Finally got to try this. Itā€™s really satisfying being able to do: >[...] > for i in arr do Note: This was supported for a long time. Mattias ___ fpc-pascal maillist - fpc-pascal@

Re: [fpc-pascal] Feature announcement: Dynamic array extensions

2018-06-21 Thread Mattias Gaertner
On Wed, 20 Jun 2018 21:56:56 +0200 Sven Barth via fpc-pascal wrote: >[...] > The modeswitch is enabled by default in Delphi modes as this feature was > added for Delphi compatibility. I would like to use that for objfpc. Is there a command line flag to enable a modeswitch? Mattias

Re: [fpc-pascal] Proper preprocessor?

2018-06-20 Thread Mattias Gaertner
On Wed, 20 Jun 2018 16:25:39 +0700 Ryan Joseph wrote: > > On Jun 20, 2018, at 3:50 PM, Michael Van Canneyt > > wrote: > > > > Because it is simply a bad idea ? > > Yeah thatā€™s what the programming gurus in ivory towers and professors keep > saying but what about the person actually trying

Re: [fpc-pascal] Better usage of "with"

2018-06-14 Thread Mattias Gaertner
On Thu, 14 Jun 2018 16:44:40 +0700 Ryan Joseph wrote: >[...] > The idea of ā€œwithā€ inside records is so interesting because it basically > mimics inheritance without going full class. If you only want that, why not use objects? Mattias ___ fpc-pascal

Re: [fpc-pascal] round(2.5)=2

2018-06-12 Thread Mattias Gaertner
On Mon, 11 Jun 2018 10:01:13 +0200 Michael Schnell wrote: > There has been a long winding discussion on the German Forum. > > IMHO this is not really relevant, as relying on the exact value of a > real number is erroneous, anyway. So a real number never can be > considered to *exactly* *be* 1.

Re: [fpc-pascal] Migrate Delphi XE5 to FPC/Lazarus, any advice?

2018-06-08 Thread Mattias Gaertner
On Fri, 08 Jun 2018 09:04:57 +0200 Bo Berglund wrote: > On Fri, 08 Jun 2018 07:25:21 +0200, Bo Berglund > wrote: > > >I think I will change foot here and look at the 1D first since this is > >a pure Delphi native application. Uses Delphi's own graphics. > > Forgot to ask if Lazarus is able t

Re: [fpc-pascal] Anchors on a child form

2018-06-04 Thread Mattias Gaertner
On Sun, 3 Jun 2018 13:06:59 +0100 Martin Wynne wrote: > If I create a child form by setting Parent:=other_form; in FormCreate, > it cannot be dragged to a new position by the user. Correct. Setting aForm.Parent makes the form a "normal" control like a frame or panel. If you want dragging, you n

Re: [fpc-pascal] Feature announcement: Dynamic array extensions

2018-06-03 Thread Mattias Gaertner
On Sun, 3 Jun 2018 14:59:46 +0200 Florian KlƤmpfl wrote: >[...] > > Yes, that's one of the reasons I vote for keeping the new feature > > and allow to overload the operator. > > There is still concat which provides exactly the same functionality. True. Same as in Delphi. Is there a problem h

Re: [fpc-pascal] Feature announcement: Dynamic array extensions

2018-06-03 Thread Mattias Gaertner
On Sun, 3 Jun 2018 11:34:33 + Mark Morgan Lloyd wrote: > On 02/06/18 13:00, Mattias Gaertner wrote: > >> Sven Barth via fpc-pascal hat am 2. Juni > >> 2018 um 09:42 geschrieben: > > denisgolovan < denisgolo...@yandex.ru> > >> schrieb am Sa.,

Re: [fpc-pascal] Feature announcement: Dynamic array extensions

2018-06-02 Thread Mattias Gaertner
> Sven Barth via fpc-pascal hat am 2. Juni > 2018 um 09:42 geschrieben: > > denisgolovan < denisgolo...@yandex.ru> schrieb am Sa., 2. Juni 2018, 09:18: > > @Sven > > Please reconsider "+" operator for arrays if your changes really forbid to > > overload operators for arrays now. > > Ā  > I

[fpc-pascal] Lazarus Release 1.8.4

2018-05-22 Thread Mattias Gaertner
The Lazarus team is glad to announce the release of Lazarus 1.8.4. This is a bugfix release. The release was built with FPC 3.0.4. Here is the list of changes for Lazarus and Free Pascal: http://wiki.lazarus.freepascal.org/Lazarus_1.8.0_release_notes http://wiki.lazarus.freepascal.org/User_Change

Re: [fpc-pascal] Feature announcement: Dynamic array extensions

2018-05-20 Thread Mattias Gaertner
On Sun, 20 May 2018 14:23:25 +0200 Sven Barth via fpc-pascal wrote: > Hello together! > > I'm pleased to announce that after nearly a year various extensions for > dynamic arrays have been finished. This includes the following features: > > - support for array constructors using "[...]" syntax

Re: [fpc-pascal] pas2js Webgl unit committed

2018-05-09 Thread Mattias Gaertner
On Wed, 9 May 2018 15:42:41 +0700 Ryan Joseph wrote: >[...] > On May 9, 2018, at 1:46 PM, Ryan Joseph >wrote: > > > > Ok got it working now finally. Now I need to learn how to do anything at > > all besides writeln. :) > > Finally got a context open and working. Next things: These questio

Re: [fpc-pascal] pas2js Webgl unit committed

2018-05-08 Thread Mattias Gaertner
On Wed, 9 May 2018 09:03:29 +0700 Ryan Joseph wrote: > > On May 9, 2018, at 8:41 AM, Ryan Joseph wrote: > > > > Ok it finally worked. > > Making progress but the wiki is incomplete I think. I figured out how to add > the rtl with -Fu but Iā€™m getting an error. Whatā€™s wrong with that name? Ca

Re: [fpc-pascal] Feature announcement: default namespaces

2018-05-07 Thread Mattias Gaertner
On Mon, 7 May 2018 21:49:26 +0200 Sven Barth via fpc-pascal wrote: > Am 07.05.2018 um 10:35 schrieb Mattias Gaertner: > >> [...] > >> The compiler is told about a default namespace using the new -FN > >> parameter, > > Lazarus now checks for the -FN

Re: [fpc-pascal] Feature announcement: default namespaces

2018-05-07 Thread Mattias Gaertner
On Sat, 5 May 2018 19:23:04 +0200 Sven Barth via fpc-pascal wrote: >[...] > I'm pleased to announce the implementation of a new feature: default > namespaces. Nice! Dotted unit names without that felt so stupid. >[...] Nevertheless the prefix of such a unit (in my example "MyUnits") is >cal

Re: [fpc-pascal] Feature announcement: default namespaces

2018-05-05 Thread Mattias Gaertner
On Sun, 6 May 2018 09:11:23 +0700 Ryan Joseph wrote: > > On May 6, 2018, at 12:23 AM, Sven Barth via fpc-pascal > > wrote: > > > > For some users it might be cumbersome however to write the complete names > > (even though their IDE of choice might support them here) or maybe they > > have di

Re: [fpc-pascal] pas2js Webgl unit committed

2018-05-02 Thread Mattias Gaertner
On Wed, 2 May 2018 16:28:10 +0700 Ryan Joseph wrote: > > On May 2, 2018, at 2:08 PM, Michael Van Canneyt > > wrote: > > > > Yes. the fpmkunit needs to be the latest version, for the AddLibrary call. > > I will see if I can work around it. > > So I need to build the entire compiler and I ge

Re: [fpc-pascal] pas2js Webgl unit committed

2018-05-01 Thread Mattias Gaertner
On Tue, 1 May 2018 15:28:45 +0200 (CEST) Michael Van Canneyt wrote: >[...] > The "new web project" wizard will make the HTML file for you, if you > installed the pas2js_dsgn.lpk package in Lazarus. I think it is available > with the distributed latest lazarus, No. It was added in 1.9. Mattias _

Re: [fpc-pascal] Next language feature for pas2js...

2018-05-01 Thread Mattias Gaertner
On Tue, 1 May 2018 10:52:32 +0200 (CEST) Michael Van Canneyt wrote: >[...] > > Note that the 'var' is a workaround till eventually pas2js supports > > external 'const' without expression. > > Well, I specially did not mention this, because I consider it a dirty hack. > a var doesn't protect yo

Re: [fpc-pascal] Next language feature for pas2js...

2018-05-01 Thread Mattias Gaertner
On Tue, 1 May 2018 15:23:25 +0700 Ryan Joseph wrote: >[...] > what do we do for records then? We often need to pass arrays of specific > types for functions such as glBufferData. > > type > TVec2f = record > x, y: GLfloat; > end; > > type > TVec2b = record > x, y: GLubyte; > en

Re: [fpc-pascal] Next language feature for pas2js...

2018-05-01 Thread Mattias Gaertner
On Tue, 1 May 2018 15:36:59 +0700 Ryan Joseph wrote: >[...] > > Constants without expression can only exist in an external class. > > Just curious but why canā€™t you declare a const anywhere for any reasons? You can. > >> Also I mistyped, GLfloat is a type so how do this map to JS, or do I e

Re: [fpc-pascal] Next language feature for pas2js...

2018-05-01 Thread Mattias Gaertner
On Tue, 1 May 2018 14:20:12 +0700 Ryan Joseph wrote: > > On May 1, 2018, at 2:03 PM, Michael Van Canneyt > > wrote: > > > > Of sorts. > > MyClass = Class external name 'my' > > const > >MyConst : integer > > end; > > > > Will emit MyClass.MyConst. The compiler needs to know the type.

Re: [fpc-pascal] Next language feature for pas2js...

2018-05-01 Thread Mattias Gaertner
On Tue, 1 May 2018 15:03:30 +0700 Ryan Joseph wrote: > > On May 1, 2018, at 2:55 PM, Mattias Gaertner > > wrote: > > > > GLFloat is a type, not a const. > > > > type GLFloat = double; > > Yeah I mistyped. We shouldnā€™t be redefining GLfloat th

Re: [fpc-pascal] Next language feature for pas2js...

2018-05-01 Thread Mattias Gaertner
On Tue, 1 May 2018 12:11:37 +0700 Ryan Joseph wrote: >[...] > const > GLfloat = MAP_TO_SOMETHING; // do we have external consts? GLFloat is a type, not a const. type GLFloat = double; Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.

Re: [fpc-pascal] Next language feature for pas2js...

2018-04-26 Thread Mattias Gaertner
On Thu, 26 Apr 2018 13:13:25 +0200 (CEST) Michael Van Canneyt wrote: > On Thu, 26 Apr 2018, Benito van der Zander wrote: > > > > > Hi, > > > > I would like to vote for pointer support... > > "Pointers to records" are supported. Basically pointers are implemented as JS references. For example

Re: [fpc-pascal] Multiple active class helpers at same time

2018-04-23 Thread Mattias Gaertner
On Mon, 23 Apr 2018 12:13:01 + Sven Barth via fpc-pascal wrote: > LacaK schrieb am Mo., 23. Apr. 2018, 13:34: > > > Hi , > > > > I am sure that this was already discussed, but I can not find any > > conclusion. > > > > Is planned support for multiple class(objet, record) helpers in a way, >

Re: [fpc-pascal] Read comments via fcl-passrc

2018-04-23 Thread Mattias Gaertner
On Mon, 23 Apr 2018 12:24:26 +0200 Michael Fuchs wrote: > Hi, > > while working with fcl-passrc I search for a possibility to get the > comments of a source file in the parsed tree. > > I found TPasTreeContainer.NeedComments but it does nothing. Set that to true. Then create the parser. Read P

Re: [fpc-pascal] pointerful

2018-04-22 Thread Mattias Gaertner
On Sun, 22 Apr 2018 17:00:35 +0200 Mattias Gaertner wrote: > Hi, > > Is this a bug or a feature: > > type > Pint = ^int; > int = PInt; > > ? Note that Delphi gives error "Type 'PInt' is not yet completely defined". Mattias ___

[fpc-pascal] pointerful

2018-04-22 Thread Mattias Gaertner
Hi, Is this a bug or a feature: type Pint = ^int; int = PInt; ? Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Inline scoped enums

2018-04-08 Thread Mattias Gaertner
On Sun, 8 Apr 2018 09:22:51 +0200 Mattias Gaertner wrote: > On Sat, 7 Apr 2018 08:52:43 +0200 > Mattias Gaertner wrote: > > > On Fri, 6 Apr 2018 21:38:59 +0300 > > Š Š¾Š¼Š°Š½ via fpc-pascal wrote: > > > > > How can this code > > > {$scopedenums

Re: [fpc-pascal] Inline scoped enums

2018-04-08 Thread Mattias Gaertner
On Sat, 7 Apr 2018 08:52:43 +0200 Mattias Gaertner wrote: > On Fri, 6 Apr 2018 21:38:59 +0300 > Š Š¾Š¼Š°Š½ via fpc-pascal wrote: > > > How can this code > > {$scopedenums on} > > type > > Bar = set of (A, B, C); > > refer to A, B, C? > > Bar.A

Re: [fpc-pascal] Inline scoped enums

2018-04-06 Thread Mattias Gaertner
On Fri, 6 Apr 2018 21:38:59 +0300 Š Š¾Š¼Š°Š½ via fpc-pascal wrote: > How can this code > {$scopedenums on} > type > Bar = set of (A, B, C); > refer to A, B, C? Bar.A Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.fre

[fpc-pascal] Lazarus Release 1.8.2

2018-03-02 Thread Mattias Gaertner
The Lazarus team is glad to announce the release of Lazarus 1.8.2. This is a bugfix release. The release was built with FPC 3.0.4. Here is the list of changes for Lazarus and Free Pascal: http://wiki.lazarus.freepascal.org/Lazarus_1.8.0_release_notes http://wiki.lazarus.freepascal.org/User_Change

Re: [fpc-pascal] uses in 'filename'

2018-02-22 Thread Mattias Gaertner
On Thu, 22 Feb 2018 12:48:21 +0100 (CET) Michael Van Canneyt wrote: >[...] > home:~/source/testsub> fpc a.pp > unit1.pas(1,9) Error: Illegal unit name: foo (expecting FOO) > unit1.pas(7,1) Fatal: There were 1 errors compiling module, stopping > Fatal: Compilation aborted > > Where > > a.pp: >

Re: [fpc-pascal] uses in 'filename'

2018-02-22 Thread Mattias Gaertner
On Thu, 22 Feb 2018 17:04:25 +0100 Mattias Gaertner wrote: > On Thu, 22 Feb 2018 10:41:29 -0500 > wkitt...@windstream.net wrote: > > > On 02/22/2018 09:49 AM, Michael Van Canneyt wrote: > > > On Thu, 22 Feb 2018, Mattias Gaertner wrote: > > >> On

Re: [fpc-pascal] uses in 'filename'

2018-02-22 Thread Mattias Gaertner
On Thu, 22 Feb 2018 10:41:29 -0500 wkitt...@windstream.net wrote: > On 02/22/2018 09:49 AM, Michael Van Canneyt wrote: > > On Thu, 22 Feb 2018, Mattias Gaertner wrote: > >> On Thu, 22 Feb 2018 12:48:21 +0100 (CET) > >> Michael Van Canneyt wrote: > >>&g

Re: [fpc-pascal] uses in 'filename'

2018-02-22 Thread Mattias Gaertner
On Thu, 22 Feb 2018 12:48:21 +0100 (CET) Michael Van Canneyt wrote: >[...] > First of all, normally it won't work either way, because you must use "unit > foo;" and "unit bar;" in the files. No, I can use normal units. This works here: ---test1.pas--- uses foo in 'unit1.pas', unit1, bar in 's

[fpc-pascal] uses in 'filename'

2018-02-22 Thread Mattias Gaertner
Hi, FPC allows to use two different units with the same name: uses foo in 'unit1.pas', bar in 'sub/unit1.pas'; Which might fail with linking errors. Is this a feature or a bug? Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http:

Re: [fpc-pascal] fpreport rangeerrors with TFPReportColor

2018-02-21 Thread Mattias Gaertner
On Wed, 21 Feb 2018 19:54:55 + Graeme Geldenhuys wrote: >[...] > > Because UInt32 is not a JSON dataformat. > > Well, then I'll say that FPC's JSON needs to be extended to support > UInt32, as it is a perfectly valid Object Pascal data type. How should FPC's JSON support something, that

Re: [fpc-pascal] Scoped enums and inferred types

2018-02-21 Thread Mattias Gaertner
On Wed, 21 Feb 2018 16:14:13 +0700 Ryan Joseph wrote: >[...] > {$scopedenums on} > type > TTileSortingFlag = (Static, > Ramp, > Ignore, > Particle, > Floor, >

Re: [fpc-pascal] Scoped enums and inferred types

2018-02-21 Thread Mattias Gaertner
On Wed, 21 Feb 2018 15:58:12 +0700 Ryan Joseph wrote: >[...] > type > TTileSortingFlag = (kTileSortingStatic, > kTileSortingRamp, > kTileSortingIgnore, > kTileSortingParticle, >

Re: [fpc-pascal] Scoped enums and inferred types

2018-02-21 Thread Mattias Gaertner
On Wed, 21 Feb 2018 09:38:17 +0700 Ryan Joseph wrote: >[...]Doesnā€™t the compiler know the type and can infer ā€œAā€ is relative to the >scoped enum? I understand thereā€™s a possibility for name conflicts but you >could just use the full name in that case. I think this would be confusing: {$scoped

[fpc-pascal] directive for -CR

2018-01-18 Thread Mattias Gaertner
Hi, Is there a compiler directive to enable/disable method call and typecast checks (option -CR). Similar to $R+- for range checks? Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/

Re: [fpc-pascal] Strange issue with TXMLConfig

2018-01-18 Thread Mattias Gaertner
On Thu, 18 Jan 2018 20:31:20 +0100 Darius Blaszyk wrote: > > Hi, I can only say that TDOMNode from Laz2_DOM in trunk has function > > CompareName. > > I'm using FPC 3.0.4 indeed. No dependency to the LCL. Laz2_DOM is in LazUtils, not in the LCL. Mattias _

[fpc-pascal] pas2js mailing list

2018-01-15 Thread Mattias Gaertner
Hi, There is now a public mailing list for pas2js. You can subscribe here: http://lists.freepascal.org/mailman/listinfo/pas2js/ Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fp

Re: [fpc-pascal] can inherited simply replace inherited method(param1, param2, param3)?

2018-01-11 Thread Mattias Gaertner
On Fri, 12 Jan 2018 00:35:30 +0800 Dennis wrote: > are the 2 below equivalent? > > procedure Method(param1, param2 : integer); > begin >inherited; > end; > > > > procedure Method(param1, param2 : integer); > begin >inherited Method(param1, param2); > end; Yes. Mattias

Re: [fpc-pascal] PAS2JS: operations with array of record

2018-01-11 Thread Mattias Gaertner
On Wed, 10 Jan 2018 11:40:48 -0700 (MST) warleyalex via fpc-pascal wrote: >[...] > Ā· Add(item [,...]) / Push(item [,...]) : increases Length by one and adds one > or more item at the end of the array, can also add arrays (concatenation). > > Ā· Clear() : empties the array (equivalent to SetLen

Re: [fpc-pascal] PAS2JS: operations with array of record

2018-01-11 Thread Mattias Gaertner
On Wed, 10 Jan 2018 11:40:48 -0700 (MST) warleyalex via fpc-pascal wrote: > Since it's missing the Pas2JS specific forum, I don't know if here is correct > place to post things about "Pas2JS".Ā  Hopefully there will be one soon. > I'm using it a lot and it's very promising. I came across with

Re: [fpc-pascal] PAS2JS: operations with array of record

2018-01-11 Thread Mattias Gaertner
On Thu, 11 Jan 2018 11:44:30 +0100 Sven Barth via fpc-pascal wrote: > Am 11.01.2018 08:16 schrieb "warleyalex via fpc-pascal" < > fpc-pascal@lists.freepascal.org>: > > Anyway, what I couldn't find is the built-in kind of *pseudo-methods for > the record data type*, set of operations, for inserti

Re: [fpc-pascal] Comp type

2018-01-10 Thread Mattias Gaertner
On Wed, 10 Jan 2018 09:04:12 +0100 Jonas Maebe wrote: > Mattias Gaertner wrote: > > Comp is Int64 div 1. > > No, that is currency. Comp is a plain 64 bit integer. It originally > comes from Turbo Pascal, which did not have a regular 64 bit integer > type. The x

Re: [fpc-pascal] Comp type

2018-01-09 Thread Mattias Gaertner
On Tue, 09 Jan 2018 22:58:01 +0100 Darius Blaszyk wrote: > By accident I noticed the comp type for the first time. It's an Int64 > but is considered to be a real type. Just out of curiosity, what is the > use case of such a type, or is this just implemented for compatibility > reasons? Comp is I

Re: [fpc-pascal] Generics vs templates

2018-01-08 Thread Mattias Gaertner
On Mon, 8 Jan 2018 14:19:42 +0700 Ryan Joseph wrote: > I was talking with a c++ developer who explained how templates are > implemented in c++ and how use some recursive method which causes them to > totally murder compile times. > Having just started to use generics in FPC myself I was curious

Re: [fpc-pascal] Modern Compiler Construction using Pascal

2018-01-02 Thread Mattias Gaertner
On Mon, 1 Jan 2018 13:17:47 -0500 Yves Cloutier wrote: > Hi there, > > I'd be interested to know if any modern compilers have been written in > Pascal (other than the Pascal Compiler). pas2js is written in FPC. Mattias ___ fpc-pascal maillist - fpc

Re: [fpc-pascal] First pas2js public release

2017-12-20 Thread Mattias Gaertner
p://wiki.freepascal.org/pas2js > > > > * Sources ? > > > > The pas2js compiler sources and RTL sources have been checked in in FPC's > > subversion repository. The page describes where to find it in SVN. > > > > * Binaries ? > > > > A snaps

Re: [fpc-pascal] linker failed with fpc rpm on CentOS 7

2017-12-13 Thread Mattias Gaertner
On Wed, 13 Dec 2017 14:05:34 +0100 Pierre Muller wrote: >[...] > On the failing RPM install, > could you test this file: > ftp://ftp.freepascal.org/pub/fpc/dist/3.0.4/x86_64-linux/x86_64-linux-prt0-pre2.26-binutils.tar.gz > > Simply extract it at the base 3.0.4 installation directory, > it co

Re: [fpc-pascal] linker failed with fpc rpm on CentOS 7

2017-12-12 Thread Mattias Gaertner
On Tue, 12 Dec 2017 23:16:03 +0100 Pierre Muller wrote: >[...] > Normally the .tar file should have been generated on a system that uses > an earlier GNU binutils version, avoiding the problem if > a Free Pascal program is linked using a less recent GNU linker version. > > Apparently, we did

[fpc-pascal] linker failed with fpc rpm on CentOS 7

2017-12-12 Thread Mattias Gaertner
Hi, I installed fpc-3.0.4-1.x86_64.rpm from sourceforge on CentOS 7 and compiling even the simplest of programs gives: /bin/ld: /usr/lib64/fpc/3.0.4/units/x86_64-linux/rtl/cprt0.o: unrecognized relocation (0x2a) in section `.text' /bin/ld: final link failed: Bad value Is this known? Mattias ___

[fpc-pascal] Lazarus Release 1.8

2017-12-07 Thread Mattias Gaertner
The Lazarus team is glad to announce the release of Lazarus 1.8.The release was built with FPC 3.0.4.The previous release Lazarus 1.6.4 was built with FPC 3.0.2. Here is the list of changes for Lazarus and Free Pascal:http://wiki.lazarus.freepascal.org/Lazarus_1.8.0_release_noteshttp://wiki.lazaru

Re: [fpc-pascal] fpc2js

2017-12-06 Thread Mattias Gaertner
> Victor Campillo hat am 6. Dezember 2017 um 12:48 > geschrieben: >[...] > o It does not include the command to call pas2js compiler. Correct. pas2js does not support ppu files (yet), so it compiles all units everytime. For the same reason the package is set to build manually. > o Adding t

Re: [fpc-pascal] Using Pascal N-IDE (Android)

2017-12-05 Thread Mattias Gaertner
On Tue, 5 Dec 2017 10:48:01 -0500 Paul Breneman wrote: > On 12/05/2017 10:12 AM, Paul Breneman wrote: > > On 12/05/2017 09:52 AM, Paul Breneman wrote: > >> On 12/05/2017 09:30 AM, Paul Breneman wrote: It seems you are talking to yourself. Mattias

Re: [fpc-pascal] FPC 3.0.4 released!

2017-12-02 Thread Mattias Gaertner
On Sat, 2 Dec 2017 21:20:17 +0100 (CET) mar...@stack.nl (Marco van de Voort) wrote: > In our previous episode, Mattias Gaertner said: > > The doc-chm.zip has only 7.6mb, while the doc-html.zip has 17.9mb. > > > > Reason is that many html files are empty. For example

Re: [fpc-pascal] FPC 3.0.4 released!

2017-12-02 Thread Mattias Gaertner
Hi, The doc-chm.zip has only 7.6mb, while the doc-html.zip has 17.9mb. Reason is that many html files are empty. For example: rtl.chm classes/tthread.html Should I report a bug? Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http:

Re: [fpc-pascal] FPC 3.0.4 released!

2017-11-30 Thread Mattias Gaertner
On Thu, 30 Nov 2017 11:04:31 +0100 (CET) mar...@stack.nl (Marco van de Voort) wrote: >[...] > and sourceforge > > https://sourceforge.net/projects/freepascal/files/ This https://sourceforge.net/projects/freepascal/files/Mac%20OS%20X/3.0.4/ contains a fpc 3.0.5 as well. Is this on purpose? Mat

Re: [fpc-pascal] FPC 3.0.4 released!

2017-11-30 Thread Mattias Gaertner
On Thu, 30 Nov 2017 11:04:31 +0100 (CET) mar...@stack.nl (Marco van de Voort) wrote: > Hello, > > Finally, the Free Pascal 3.0.4 release is available from our FTP servers. > > Changes that may break backwards compatibility will be documented at: > http://wiki.freepascal.org/User_Changes_3_0_4 T

Re: [fpc-pascal] FPC 3.0.4 released!

2017-11-30 Thread Mattias Gaertner
On Thu, 30 Nov 2017 11:04:31 +0100 (CET) mar...@stack.nl (Marco van de Voort) wrote: > Hello, > > Finally, the Free Pascal 3.0.4 release is available from our FTP servers. > > Changes that may break backwards compatibility will be documented at: > http://wiki.freepascal.org/User_Changes_3_0_4 >

Re: [fpc-pascal] FPC attributes / annotations support

2017-11-29 Thread Mattias Gaertner
On Wed, 29 Nov 2017 09:07:31 -0200 "Marcos Douglas B. Santos" wrote: > On Wed, Nov 29, 2017 at 4:50 AM, Graeme Geldenhuys > wrote: > > > > [dreaming] > > Now only if Lazarus could support the Delphi dcc32 compiler. ;-) Boy oh > > boy... I've been using Delphi XE3 for a month now (new job) - it i

Re: [fpc-pascal] FPC attributes / annotations support

2017-11-28 Thread Mattias Gaertner
On Wed, 11 Oct 2017 17:13:31 +0200 Sven Barth via fpc-pascal wrote: > Am 11.10.2017 14:45 schrieb "Graeme Geldenhuys" < > mailingli...@geldenhuys.co.uk>: > > > > Bringing a discussion from the Lazarus mailing list to here. > > > > > > On 2017-09-24 09:13, Michael Van Canneyt via Lazarus wrote:

Re: [fpc-pascal] fpc procedure modifier []

2017-11-16 Thread Mattias Gaertner
On Thu, 16 Nov 2017 15:25:55 +0100 Maciej Izak wrote: > 2017-11-16 15:21 GMT+01:00 Michael Van Canneyt : > > > I think that prefixedattributes should simply disable the use of proc > > modifier []. The probability of having code that needs both is almost zero, > > the [] syntax is very old and a

Re: [fpc-pascal] fpc procedure modifier []

2017-11-16 Thread Mattias Gaertner
On Thu, 16 Nov 2017 14:12:18 +0100 Sven Barth via fpc-pascal wrote: >[...] > So, how will FPC distinguish the two []? > > > The only idea I have is to check whether the first identifier is a > attribute and if not handle it as a modifier (or if a comma is following > the first identifier). ppa

Re: [fpc-pascal] fpc procedure modifier []

2017-11-16 Thread Mattias Gaertner
On Thu, 16 Nov 2017 11:49:59 +0100 Maciej Izak wrote: > 2017-11-16 11:39 GMT+01:00 Mattias Gaertner : > > > What $modes support this? > > The reason I ask is I'm trying to distinguish them from Delphi > > Attributes in pparser. > > > > for Delphi lik

[fpc-pascal] fpc procedure modifier []

2017-11-16 Thread Mattias Gaertner
Hi, Where can I find some information about the [] procedure modifier of FPC? For example: procedure fpc_check_object(_vmt : pointer); [public,alias:'FPC_CHECK_OBJECT']; compilerproc; What $modes support this? The reason I ask is I'm trying to distinguish them from Delphi Attributes in pparser.

Re: [fpc-pascal] installing cross fpc in parallel to systems fpc

2017-11-10 Thread Mattias Gaertner
On Fri, 10 Nov 2017 18:57:19 +0100 Marc Santhoff wrote: >[...] > > You can either use fpc and switch the target OS and /or processor. > > That solution isnt't doable, that would require a compiler for X86_64 > and ARM. fpc -Parm calls ppcarm, fpc -Px86_64 calls ppcx64. Mattias __

<    1   2   3   4   5   6   7   8   9   10   >