Re: [fpc-pascal] Compile for WinCE 7, target ARM, CPU Cortex-A9

2019-04-05 Thread Sven Barth via fpc-pascal
LacaK schrieb am Fr., 5. Apr. 2019, 14:56: > > >> >> Note that you probably don't need two different cross compilers if your >> cpu-OS target is the same >> >> Target CPU family is same: "arm", but Target processor is not the same: >> "ARMv4" versus "ARMv7" ... >> >> So I do not know if this

Re: [fpc-pascal] Compile for WinCE 7, target ARM, CPU Cortex-A9

2019-04-05 Thread Sven Barth via fpc-pascal
LacaK schrieb am Fr., 5. Apr. 2019, 13:18: > > > Note that you probably don't need two different cross compilers if your > cpu-OS target is the same > > Target CPU family is same: "arm", but Target processor is not the same: > "ARMv4" versus "ARMv7" ... > > So I do not know if this requires two

Re: [fpc-pascal] fpdoc: what does the --marco parameter do?

2019-03-23 Thread Sven Barth via fpc-pascal
Graeme Geldenhuys schrieb am Sa., 23. März 2019, 17:40: > On 23/03/2019 16:34, Graeme Geldenhuys wrote: > > I'm trying to debug fpdoc, but for the life of me, I can't get Lazarus > > to step into the code other than the program unit's main code block. > > Got this part sorted - MSEide to the

Re: [fpc-pascal] Registers used by calling conventions

2019-03-09 Thread Sven Barth via fpc-pascal
Anthony Walter schrieb am Fr., 8. März 2019, 22:34: > What registers are used by default calling convention and where can I find > more information about Free Pascal asm details? > > When writing code using the asm block on Delphi in Windows, the default > calling convention (fastcall) would

Re: [fpc-pascal] Multi helpers

2019-02-28 Thread Sven Barth via fpc-pascal
Ryan Joseph schrieb am Do., 28. Feb. 2019, 15:37: > > > > On Feb 28, 2019, at 1:51 AM, Sven Barth via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > > > > Yes, though the first step should probably be to rework your commits. > It's a bit of work, but

Re: [fpc-pascal] Multi helpers

2019-02-27 Thread Sven Barth via fpc-pascal
Ryan Joseph schrieb am Do., 28. Feb. 2019, 03:50: > posts getting blocked again, just sending this to see if it gets through. > > > On Feb 26, 2019, at 9:10 AM, Ryan Joseph > wrote: > > > > > > > >> On Feb 26, 2019, at 7:05 AM, Graeme Geldenhuys < > mailingli...@geldenhuys.co.uk> wrote: > >> >

Re: [fpc-pascal] CGI with datamodule does not work

2019-02-26 Thread Sven Barth via fpc-pascal
Am 27.02.2019 um 01:42 schrieb AB: Hi Guys, I have tried to update my old web project that is in maintenance mode since a few years now, using the latest stable Lazarus/FPC, and fcl-web just does not want to work (Tried Lazarus 1.8.4/FPC 3.0.4, Lazarus 2.0.0/FPC 3.0.4 with Apache 2.4, on

Re: [fpc-pascal] Multi helpers

2019-02-25 Thread Sven Barth via fpc-pascal
Am 25.02.2019 um 19:44 schrieb Sven Barth: Mattias Gaertner via fpc-pascal <mailto:fpc-pascal@lists.freepascal.org>> schrieb am Mo., 25. Feb. 2019, 19:09: On Mon, 25 Feb 2019 12:49:16 -0500 Ryan Joseph mailto:r...@thealchemistguild.com>> wrote: > > On Feb

Re: [fpc-pascal] Multi helpers

2019-02-25 Thread Sven Barth via fpc-pascal
Mattias Gaertner via fpc-pascal schrieb am Mo., 25. Feb. 2019, 19:09: > On Mon, 25 Feb 2019 12:49:16 -0500 > Ryan Joseph wrote: > > > > On Feb 25, 2019, at 12:41 PM, Mattias Gaertner via fpc-pascal > > > wrote: > > > > > > At least FPC helpers are more consistent than Delphi. > > > inherited

Re: [fpc-pascal] Multi helpers

2019-02-25 Thread Sven Barth via fpc-pascal
Ryan Joseph schrieb am Mo., 25. Feb. 2019, 19:00: > Question, is this mode switch allowed in Delphi mode? I disabled it > because I had a comment that said it was ObjFPC mode only but that doesn’t > make sense it couldn’t be enabled manually even in Delphi mode. > Mattias already answered, but

Re: [fpc-pascal] FGL.TFPSList Find method needed (binary search)

2019-02-16 Thread Sven Barth via fpc-pascal
Am Sa., 16. Feb. 2019, 21:30 hat AlexeyT geschrieben: > Hello. Can you pls, add Sorted property to TFPSList / TFPGList (Add() > method must sort newly added item), and also Find method (which must use > binary search in Sorted case, and use plain loop if not sorted) > You could also check

Re: [fpc-pascal] Constants in generics tests

2019-02-16 Thread Sven Barth via fpc-pascal
Am Sa., 16. Feb. 2019, 15:34 hat Ryan Joseph geschrieben: > > > > On Feb 16, 2019, at 3:33 AM, Sven Barth via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > > > > While you're at it, you should probably also ensure that internal error > 2014050904

Re: [fpc-pascal] Constants in generics tests

2019-02-16 Thread Sven Barth via fpc-pascal
Am 15.02.2019 um 23:00 schrieb Ryan Joseph: On Feb 15, 2019, at 4:19 PM, Sven Barth via fpc-pascal wrote: It could be that the method body is not generated. Look for generate_specialization_procs in pgenutil as that is what generates the bodies at the end of a unit (simplified). Really

Re: [fpc-pascal] Constants in generics tests

2019-02-15 Thread Sven Barth via fpc-pascal
Am Fr., 15. Feb. 2019, 21:54 hat Ryan Joseph geschrieben: > > > > On Feb 15, 2019, at 2:11 PM, Ryan Joseph > wrote: > > > > Something with class functions in particular. Very strange it can’t find > the declaration. So never mind about submitting, I need to fix this now. :) > > I just looked

Re: [fpc-pascal] Constants in generics tests

2019-02-15 Thread Sven Barth via fpc-pascal
Am Fr., 15. Feb. 2019, 20:58 hat Ryan Joseph geschrieben: > > > > On Feb 15, 2019, at 2:11 PM, Ryan Joseph > wrote: > > > > Also I just noticed that I’m getting warnings from the “U” constant > which is declared in the “strict private” section (Private const > "TTest$1.U" never used). That

Re: [fpc-pascal] StrUtils unit needs Widestring funcs

2019-02-15 Thread Sven Barth via fpc-pascal
Am Fr., 15. Feb. 2019, 18:54 hat Michael Van Canneyt geschrieben: > > I intend to copy it to ustrutils, which will be compiled with widestrings. > Copying all routines to handle ansi/wide string is no solution. > I hope you mean UnicodeString? The only platform where this is important is

Re: [fpc-pascal] Question: Is there a global callback, when a thread gets terminated?

2019-02-12 Thread Sven Barth via fpc-pascal
Am Di., 12. Feb. 2019, 16:56 hat Marc Santhoff geschrieben: > On Mon, 2019-02-11 at 10:21 +, Michael Schnell wrote: > > > Yes, but how do I get notified, when the thread is gone, and I can free > > > the > > > memory (of the object that was created)? > > > > Ah, now I finally see the problem

Re: [fpc-pascal] trying to use C code in .pas on WIN32

2019-01-31 Thread Sven Barth via fpc-pascal
Am Do., 31. Jan. 2019, 22:03 hat Marc Santhoff geschrieben: > On Thu, 2019-01-31 at 11:00 -0700, conlin664 via fpc-pascal wrote: > > sven, > > > > so I just tried, what I think you said: > > > > procedure HelloC; cdecl; external name 'HelloC'; > > > > pcode.pas(19,1) Error: Undefined symbol:

Re: [fpc-pascal] h2pas fails on c++ header file

2019-01-31 Thread Sven Barth via fpc-pascal
Am Do., 31. Jan. 2019, 17:38 hat Giuliano Colla < giuliano.co...@fastwebnet.it> geschrieben: > Il 30/01/2019 13:17, Marco van de Voort ha scritto: > > > > > Op 1/30/2019 om 11:57 AM schreef Giuliano Colla: > >> > >> What I'm doing wrong? > >> > > Using a C header converter or a C++ header file.

Re: [fpc-pascal] trying to use C code in .pas on WIN32

2019-01-31 Thread Sven Barth via fpc-pascal
Am Do., 31. Jan. 2019, 15:26 hat Bart geschrieben: > On Thu, Jan 31, 2019 at 7:35 AM Sven Barth via fpc-pascal > wrote: > > > > This is on an evil windows machine > > Windows is one of FPC's main targets, we can do without such > "expletives". > > M

Re: [fpc-pascal] trying to use C code in .pas on WIN32

2019-01-30 Thread Sven Barth via fpc-pascal
Am 30.01.2019 um 23:14 schrieb conlin664 via fpc-pascal: ok. I backed up to a simple version. how I declare the C routine must be the problem, with nothing, procedure HelloC; cdecl; external; I think it's trying to static link it, and gets an pcode.pas(19,1) Error: Undefined symbol:

Re: [fpc-pascal] trying to use C code in .pas on WIN32

2019-01-24 Thread Sven Barth via fpc-pascal
Am Fr., 25. Jan. 2019, 01:01 hat Marc Santhoff geschrieben: > On Wed, 2019-01-23 at 14:30 -0700, conlin664 via fpc-pascal wrote: > > I've done research, but am just missing something. > > my .pas code links just fine, but doesn't RUN. > > ( first writeln never appears ) > > If I remove the

Re: [fpc-pascal] type helper default property

2019-01-17 Thread Sven Barth via fpc-pascal
Am 17.01.2019 um 13:17 schrieb 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

Re: [fpc-pascal] type helper constructor

2019-01-17 Thread Sven Barth via fpc-pascal
Am Do., 17. Jan. 2019, 13:10 hat Mattias Gaertner via fpc-pascal < fpc-pascal@lists.freepascal.org> geschrieben: > 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 =

Re: [fpc-pascal] inlining functions

2019-01-12 Thread Sven Barth via fpc-pascal
Am Sa., 12. Jan. 2019, 13:05 hat denisgolovan geschrieben: > > However, what you actually can do, is manually recompile all units of > your program > > multiple times. While this won't help with inline functions called > > before they are parsed in those same units, it will allow inlining of > >

Re: [fpc-pascal] type helpers

2019-01-11 Thread Sven Barth via fpc-pascal
Am Fr., 11. Jan. 2019, 14:52 hat Mattias Gaertner via fpc-pascal < fpc-pascal@lists.freepascal.org> geschrieben: > 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 &

Re: [fpc-pascal] type helpers

2019-01-11 Thread Sven Barth via fpc-pascal
Am Fr., 11. Jan. 2019, 11:24 hat Mattias Gaertner via fpc-pascal < fpc-pascal@lists.freepascal.org> geschrieben: > 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

Re: [fpc-pascal] Constants in generics

2019-01-09 Thread Sven Barth via fpc-pascal
Am Mi., 9. Jan. 2019, 17:03 hat Ryan Joseph geschrieben: > > > > On Jan 8, 2019, at 3:49 PM, Benito van der Zander > wrote: > > > > that reminds me of https://bugs.freepascal.org/view.php?id=34232 > > In this case maybe generics should just not give range errors unless > they’re specialized?

Re: [fpc-pascal] Constants in generics

2019-01-08 Thread Sven Barth via fpc-pascal
Am Di., 8. Jan. 2019, 23:49 hat Benito van der Zander geschrieben: > Hi, > > that reminds me of https://bugs.freepascal.org/view.php?id=34232 > Yes, that falls into the same category... Regards, Sven ___ fpc-pascal maillist -

Re: [fpc-pascal] Constants in generics

2019-01-08 Thread Sven Barth via fpc-pascal
Am Di., 8. Jan. 2019, 21:01 hat Ryan Joseph geschrieben: > I’ve made constants respect their proper definition now so we can do range > checking but this broke some other things. For example there’s a range > check error with static arrays now because “U” has a value of 0 so 0-1 = -1: > > type >

Re: [fpc-pascal] Constants in generics

2019-01-07 Thread Sven Barth via fpc-pascal
Am 07.01.2019 um 02:05 schrieb Ryan Joseph: I updated the github with the requested changes. Is that everything? I’ll submit a patch if so. https://github.com/genericptr/freepascal/tree/generic_constants Looks better. The following points remain: - make sure that you don't have any unrelated

Re: [fpc-pascal] Small typo in User_Changes_Trunk ?

2019-01-07 Thread Sven Barth via fpc-pascal
Am Mo., 7. Jan. 2019, 08:33 hat LacaK geschrieben: > Hi, > > reading > > http://wiki.freepascal.org/User_Changes_Trunk#Modeswitch_TypeHelpers_in_Delphi_modes_enables_type_helper-syntax > there is: > > Remedy: The only problems arise if one disabled the modeswitch on > purpose which now longer

Re: [fpc-pascal] Constants in generics

2019-01-06 Thread Sven Barth via fpc-pascal
Am So., 6. Jan. 2019, 22:38 hat Ryan Joseph geschrieben: > Since we introduced “const” keywords to generic params does it make sense > to use an optional “type” keyword also? That just occurred to me as > something worth discussing. No opinion either way except there’s a > inconsistency now

Re: [fpc-pascal] Constants in generics

2019-01-06 Thread Sven Barth via fpc-pascal
Am So., 6. Jan. 2019, 19:07 hat Ryan Joseph geschrieben: > Last question I have I think. > > Is this the best way to get "pretty name" string for a set? Having to loop > through the entire range of the set is not so great but I don’t see another > way. I feel like there should be some utility

Re: [fpc-pascal] Interface bug or some new feature

2019-01-06 Thread Sven Barth via fpc-pascal
Am 06.01.2019 um 12:56 schrieb Jonas Maebe: On 06/01/19 11:42, denisgolovan wrote: Specifically 3.1.1 compiler compiles it and correctly prints "Double". 3.3.1 compiler refuses to compile it at all. Please comment if it's a bug or a new breaking feature.

Re: [fpc-pascal] Interface bug or some new feature

2019-01-06 Thread Sven Barth via fpc-pascal
Am 06.01.2019 um 13:30 schrieb denisgolovan: 06.01.2019, 15:00, "Sven Barth via fpc-pascal" : The default visibility for classes without $M+ is private. Thus TClass1.P is private. An interface implementation does not have access to private methods of a parent class. So you need to

Re: [fpc-pascal] Interface bug or some new feature

2019-01-06 Thread Sven Barth via fpc-pascal
Am So., 6. Jan. 2019, 11:42 hat denisgolovan geschrieben: > Hi all > > I've been using 3.1.1 compiler for a long time and now I am trying to > upgrade to 3.3.1 from trunk. > However, I am stuck with some new behavior when using classes + interfaces. > I've managed to reproduce it in a small

Re: [fpc-pascal] Get "disk" ID

2019-01-06 Thread Sven Barth via fpc-pascal
Am Sa., 5. Jan. 2019, 17:05 hat Bart geschrieben: > Hi, > > I need some function to get a unique ID for a disk. > I need this to identify if my program has accessed this disk previously. > > On Windows I can retreive the VolumeSerialNr, but how do I do > something like that in Linux? > Mind you:

Re: [fpc-pascal] Constants in generics

2019-01-06 Thread Sven Barth via fpc-pascal
Am Sa., 5. Jan. 2019, 22:57 hat Ryan Joseph geschrieben: > Here’s the new syntax requirements for const params which require types > and consts be separated by semicolons. > > Does TStuff2 need a ; between the two const params? Sven said consts must > follow ; or < but they’re both consts so I

Re: [fpc-pascal] Constants in generics

2019-01-05 Thread Sven Barth via fpc-pascal
Am Sa., 5. Jan. 2019, 17:28 hat Ryan Joseph geschrieben: > > > > On Jan 5, 2019, at 1:18 AM, Sven Barth via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > > > > I didn't design the original implementation, but the improvements for > the

Re: [fpc-pascal] Constants in generics

2019-01-05 Thread Sven Barth via fpc-pascal
Am Fr., 4. Jan. 2019, 21:11 hat geschrieben: > On 1/4/19 1:47 PM, Ryan Joseph wrote: > > > >> On Jan 3, 2019, at 11:11 PM, Sven Barth via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > >> > >> Fair enough. In that case support for constant

Re: [fpc-pascal] Constants in generics

2019-01-03 Thread Sven Barth via fpc-pascal
Am 03.01.2019 um 23:14 schrieb Ryan Joseph: On Jan 3, 2019, at 11:33 AM, Sven Barth via fpc-pascal wrote: The approach should be like this: - const is allowed at the start of the parameters or after a ";" - a parameter name is either followed by a ",", ";", &q

Re: [fpc-pascal] Constants in generics

2019-01-03 Thread Sven Barth via fpc-pascal
Am Do., 3. Jan. 2019, 17:50 hat Ryan Joseph geschrieben: > > > > On Jan 3, 2019, at 6:20 AM, Sven Barth via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > > > > Correct. ";" separates different parameter types, "," separates

Re: [fpc-pascal] Constants in generics

2019-01-03 Thread Sven Barth via fpc-pascal
Am Do., 3. Jan. 2019, 14:24 hat Alexander Shishkin via fpc-pascal < fpc-pascal@lists.freepascal.org> geschrieben: > 03.01.2019 15:45, Mattias Gaertner via fpc-pascal пишет: > > On Thu, 3 Jan 2019 14:58:00 +0300 > > Alexander Shishkin via fpc-pascal > > wrote: > > > >> [...] > >> This is OK (both

Re: [fpc-pascal] Constants in generics

2019-01-03 Thread Sven Barth via fpc-pascal
Am Do., 3. Jan. 2019, 12:58 hat Alexander Shishkin via fpc-pascal < fpc-pascal@lists.freepascal.org> geschrieben: > 03.01.2019 6:32, Ryan Joseph пишет: > > > > > >> On Jan 2, 2019, at 8:25 PM, Alexander Shishkin via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > >> > >> This is not

Re: [fpc-pascal] Constants in generics

2019-01-02 Thread Sven Barth via fpc-pascal
Am Mi., 2. Jan. 2019, 23:41 hat Alexander Shishkin via fpc-pascal < fpc-pascal@lists.freepascal.org> geschrieben: > 06.11.2018 10:13, Ryan Joseph пишет: > > > > program generic_constants; > > > > type > > generic TList = record > > list: array[0..U-1] of T; > >

Re: [fpc-pascal] SetLength warnings - request

2019-01-02 Thread Sven Barth via fpc-pascal
Am Mi., 2. Jan. 2019, 17:05 hat Benito van der Zander geschrieben: > The non-initialization of 'Result' has bitten me more than once in Delphi. > > > Me, too. Usually the solution was to add a call to SetLength. > > That makes the bullshit hints especially bad. > Even in Delphi situations can

Re: [fpc-pascal] Constants in generics

2019-01-02 Thread Sven Barth via fpc-pascal
Am Mi., 2. Jan. 2019, 11:20 hat denisgolovan geschrieben: > Hi, all > > Could someone confirm this functionality is merged into trunk? I mean > constants in generics. > I can confirm that it is not integrated in trunk. Regards, Sven ___ fpc-pascal

Re: [fpc-pascal] inlining functions depending on implementation only functions

2018-12-29 Thread Sven Barth via fpc-pascal
Am Sa., 29. Dez. 2018, 15:23 hat Benito van der Zander geschrieben: > Hi, > > after updating from fpc 3.1 to fpc 3.3, I am getting a lot of "function > was not inlined" warnings, e.g. when an inline function depends on a > function not declared in the interface part like: > > unit inlinetest; >

Re: [fpc-pascal] Candidate for crowd-funding

2018-12-19 Thread Sven Barth via fpc-pascal
Am Mi., 19. Dez. 2018, 11:38 hat Martok geschrieben: > > The main problem here is to model what registers an instruction uses and > > modifies so that the register allocator of the surrounding function can > take > > that into account accordingly... Maybe as a first step we could allow in >

Re: [fpc-pascal] Candidate for crowd-funding

2018-12-19 Thread Sven Barth via fpc-pascal
Am Mi., 19. Dez. 2018, 13:18 hat Ryan Joseph geschrieben: > > > > On Dec 19, 2018, at 6:35 PM, Ryan Joseph > wrote: > > > > How does that work? I’ve been interested in coroutines for a while now > but I don’t understand how they function in the language. They would need > to manage stack states

Re: [fpc-pascal] Candidate for crowd-funding

2018-12-19 Thread Sven Barth via fpc-pascal
Am Mi., 19. Dez. 2018, 09:03 hat denisgolovan geschrieben: > My personal wish-list is: > - support for array calculations / automatic loop parallelization via SSE, > AVX, etc. > Both static and dynamic arrays should supported. > Once implemented vector operations on arrays (ala APL) might be

Re: [fpc-pascal] TThread.FreeOnTerminate

2018-12-14 Thread Sven Barth via fpc-pascal
Am Fr., 14. Dez. 2018, 11:26 hat Luca Olivetti geschrieben: > El 13/12/18 a les 20:36, Martin Frb ha escrit: > > > The thread may makes calls (several, one after the other) into a > > library, and each of those calls may not return for some time (to long > > for the main thread to wait, without

Re: [fpc-pascal] TThread.FreeOnTerminate

2018-12-14 Thread Sven Barth via fpc-pascal
Am Fr., 14. Dez. 2018, 11:23 hat Michael Van Canneyt geschrieben: > > > On Fri, 14 Dec 2018, Sven Barth via fpc-pascal wrote: > > > Am Fr., 14. Dez. 2018, 10:31 hat Michael Van Canneyt < > mich...@freepascal.org> > > geschrieben: > > > >

Re: [fpc-pascal] TThread.FreeOnTerminate

2018-12-14 Thread Sven Barth via fpc-pascal
Am Fr., 14. Dez. 2018, 10:31 hat Michael Van Canneyt geschrieben: > > > On Fri, 14 Dec 2018, el es wrote: > > > On 13/12/2018 22:23, Michael Van Canneyt wrote: > >> > >> > >> On Thu, 13 Dec 2018, Martin Frb wrote: > >> > >>> > >>> Besides, the documentation does not say that FreeOnTerminate

Re: [fpc-pascal] Implicit generic specializations

2018-12-05 Thread Sven Barth via fpc-pascal
Am 03.12.2018 um 14:01 schrieb Ryan Joseph: On Dec 3, 2018, at 2:45 PM, Ryan Joseph wrote: I just looked it over and I was wrong about the dummy, it’s just a flag. If the generic doesn’t cover existing functions then that messes up some assumptions I made so I need re-think the design now.

Re: [fpc-pascal] Object questions

2018-12-04 Thread Sven Barth via fpc-pascal
Am Di., 4. Dez. 2018, 08:00 hat Ryan Joseph geschrieben: > > > > On Dec 4, 2018, at 1:52 PM, Sven Barth via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > > > > The type of "Self" inside a object is always the same no matter i

Re: [fpc-pascal] Object questions

2018-12-03 Thread Sven Barth via fpc-pascal
Am Di., 4. Dez. 2018, 04:06 hat Ryan Joseph geschrieben: > Some questions about old-style objects. > > 1) How can you check if self is assigned? self refers to the struct itself > but if the object was allocated on the stack then how do we know self is a > pointer or not? > > procedure

Re: [fpc-pascal] Generics question

2018-12-03 Thread Sven Barth via fpc-pascal
Am Mo., 3. Dez. 2018, 10:53 hat Martok geschrieben: > Am 03.12.2018 um 08:00 schrieb Sven Barth via fpc-pascal: > > Because Delphi does not allow that either. We relaxed that however in > 3.1.1 and > > it should be part of 3.2.0. You can test the corresponding br

Re: [fpc-pascal] Generics question

2018-12-02 Thread Sven Barth via fpc-pascal
Am So., 2. Dez. 2018, 23:29 hat Bart geschrieben: > Hi, > > { TFoo } > > generic TFoo = class > procedure Bar; > end; > > { TFoo } > > procedure TFoo.Bar; > procedure localproc; > begin end; > begin > end; > > This will not compile (fpc 3.0.4): > gentest.lpr(35,4) Error: Generic

Re: [fpc-pascal] Implicit generic specializations

2018-12-02 Thread Sven Barth via fpc-pascal
Am Mo., 3. Dez. 2018, 03:45 hat Ryan Joseph geschrieben: > > > > On Dec 2, 2018, at 10:53 PM, Sven Barth via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > > > > Specialization is expensive. If specialization can be avoided, it should > be. Not to me

Re: [fpc-pascal] Implicit generic specializations

2018-12-02 Thread Sven Barth via fpc-pascal
Am So., 2. Dez. 2018, 15:28 hat Ryan Joseph geschrieben: > > > > On Dec 2, 2018, at 8:11 PM, Sven Barth via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > > > > Also the idea should be that a non-generic routine takes precedence. > > > > I

Re: [fpc-pascal] Implicit generic specializations

2018-12-02 Thread Sven Barth via fpc-pascal
Am So., 2. Dez. 2018, 10:55 hat denisgolovan geschrieben: > Hi Ryan > > That's definitely a nice feature. > Could you clarify and/or discuss with compiler devs the rules for function > overloads? > Currently FPC seems a bit messy even without inferencing like that. > Where is it messy? O.o

Re: [fpc-pascal] How to get ANSI code command return value?

2018-12-02 Thread Sven Barth via fpc-pascal
Am So., 2. Dez. 2018, 08:29 hat Mr Bee via fpc-pascal < fpc-pascal@lists.freepascal.org> geschrieben: > – I want to avoid CRT unit as much as possible. I prefer raw pascal > solution. > Um... The CRT unit is a raw Pascal solution?! Anyway, you can use that unit to see how the CRT unit did it. –

Re: [fpc-pascal] Constants in generics

2018-11-28 Thread Sven Barth via fpc-pascal
Am 27.11.2018 um 11:35 schrieb Sven Barth: Am Di., 27. Nov. 2018, 08:18 hat Ryan Joseph mailto:r...@thealchemistguild.com>> geschrieben: > On Nov 27, 2018, at 4:59 AM, Sven Barth via fpc-pascal mailto:fpc-pascal@lists.freepascal.org>> wrote: > > Best ch

Re: [fpc-pascal] Default record const values

2018-11-28 Thread Sven Barth via fpc-pascal
Am 28.11.2018 um 20:27 schrieb Benjamin Rosseaux: program Test123; {$ifdef fpc}   {$mode delphi} {$endif} type   TTest = record   public     a: LongInt;     b: LongInt;   end;   TTestHelper = record helper for TTest   public     const Default: TTest = (a: 1; b: 2);   end; var   Test: TTest;

Re: [fpc-pascal] Constants in generics

2018-11-28 Thread Sven Barth via fpc-pascal
Am Mi., 28. Nov. 2018, 15:27 hat Ryan Joseph geschrieben: > > > > On Nov 28, 2018, at 7:26 PM, Sven Barth via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > > > > Because that is not supposed to work. Generic routines are *routines*, > not types. Y

Re: [fpc-pascal] Constants in generics

2018-11-28 Thread Sven Barth via fpc-pascal
Am Mi., 28. Nov. 2018, 09:41 hat Ryan Joseph geschrieben: > I just noticed I sent this to the wrong person and the list never saw it > so I’m sending it again. I feel like I should try to fix it while I’ve got > my eyes on the generics code before I forget. > > Is there a reason it’s not

Re: [fpc-pascal] Constants in generics

2018-11-27 Thread Sven Barth via fpc-pascal
Am Di., 27. Nov. 2018, 15:08 hat Ryan Joseph geschrieben: > > You did read the part about the generic and the specialization being > located in two different units?  > > Oops. This still works so I guess it’s ok. > > program gc_ppu; > uses > gc_types_unit; > > var > a:

Re: [fpc-pascal] Constants in generics

2018-11-27 Thread Sven Barth via fpc-pascal
Am Di., 27. Nov. 2018, 14:00 hat Ryan Joseph geschrieben: > > > > On Nov 27, 2018, at 5:35 PM, Sven Barth via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > > > > 1) kSomeDays is a typed const so I get a load node instead of > tsetconstnode, w

Re: [fpc-pascal] Constants in generics

2018-11-27 Thread Sven Barth via fpc-pascal
Am Di., 27. Nov. 2018, 12:03 hat Mattias Gaertner via fpc-pascal < fpc-pascal@lists.freepascal.org> geschrieben: > On Tue, 27 Nov 2018 11:35:22 +0100 > Sven Barth via fpc-pascal wrote: > > >[...] > > > const > > > kSomeDays:TDays = [Mon, Wed]; &g

Re: [fpc-pascal] Constants in generics

2018-11-27 Thread Sven Barth via fpc-pascal
Am Di., 27. Nov. 2018, 08:18 hat Ryan Joseph geschrieben: > > > > On Nov 27, 2018, at 4:59 AM, Sven Barth via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > > > > Best check again once you've done the switch to tconstsym for constants. > :) &g

Re: [fpc-pascal] Constants in generics

2018-11-26 Thread Sven Barth via fpc-pascal
Am Mo., 26. Nov. 2018, 15:47 hat Ryan Joseph geschrieben: > > > > On Nov 26, 2018, at 8:18 PM, Sven Barth via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > > > > You don't need to manually check for U. The parser will find U in the >

Re: [fpc-pascal] Constants in generics

2018-11-26 Thread Sven Barth via fpc-pascal
Am Mo., 26. Nov. 2018, 12:14 hat Ryan Joseph geschrieben: > > > > On Nov 26, 2018, at 5:16 PM, Sven Barth via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > > > > Am Mo., 26. Nov. 2018, 10:46 hat Ryan Joseph > geschrieben: > > > > > &

Re: [fpc-pascal] Constants in generics

2018-11-26 Thread Sven Barth via fpc-pascal
Am Mo., 26. Nov. 2018, 10:46 hat Ryan Joseph geschrieben: > > > > On Nov 26, 2018, at 12:09 AM, Sven Barth via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > > > > - your pretty name is wrong; the pretty name for a specialization with &g

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

2018-11-25 Thread Sven Barth via fpc-pascal
Am Mo., 26. Nov. 2018, 03:12 hat Ryan Joseph geschrieben: > > > > On Nov 25, 2018, at 11:03 PM, Sven Barth via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > > > > It's a good thing that you saw the errors in your first design and > rectified those

Re: [fpc-pascal] Constants in generics

2018-11-25 Thread Sven Barth via fpc-pascal
Am 14.11.2018 um 03:25 schrieb Ryan Joseph: I think I have this done except for cleanup. Here’s the status: - Integer,string,real,set and nil constant for parameters. - Consts can have type restrictions which correspond to the above types. - Const can be assigned to from generic const params. -

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

2018-11-25 Thread Sven Barth via fpc-pascal
Am 24.11.2018 um 05:20 schrieb Ryan Joseph: I’d like to propose this mode switch ($modeswitch multiscopehelpers) to allow multiple helpers per scope. I have no idea why Delphi thinks only one helper should be allowed in any scope but it cripples the feature severely. Sharing helpers is mostly

Re: [fpc-pascal] Building trunk

2018-11-24 Thread Sven Barth via fpc-pascal
Am Sa., 24. Nov. 2018, 10:09 hat C Western geschrieben: > On 23/11/2018 09:50, Sven Barth via fpc-pascal wrote: > > Am Fr., 23. Nov. 2018, 10:26 hat C Western > <mailto:l...@c-m-w.me.uk>> geschrieben: > > > > I haven't been able to build tru

Re: [fpc-pascal] Building trunk

2018-11-23 Thread Sven Barth via fpc-pascal
Am Fr., 23. Nov. 2018, 10:26 hat C Western geschrieben: > I haven't been able to build trunk i386 fpc for a couple of weeks. Is > this supposed to be working, or have I misconfigured something? (I don't > think I have changed anything.) The output is below. I don't think it is > significant, but

Re: [fpc-pascal] C-blocks

2018-11-16 Thread Sven Barth via fpc-pascal
Am Fr., 16. Nov. 2018, 12:57 hat Ryan Joseph geschrieben: > > > > On Nov 16, 2018, at 5:33 PM, Sven Barth via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > > > > When a function contains at least one anonymous function then a capture > obje

Re: [fpc-pascal] C-blocks

2018-11-16 Thread Sven Barth via fpc-pascal
Am Fr., 16. Nov. 2018, 03:25 hat Ryan Joseph geschrieben: > > > > On Nov 15, 2018, at 11:30 PM, Sven Barth via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > > > > No, too many ways to do the same thing don't make things easier, not to > mention th

Re: [fpc-pascal] C-blocks

2018-11-15 Thread Sven Barth via fpc-pascal
Am Do., 15. Nov. 2018, 15:01 hat Ryan Joseph geschrieben: > Given that, having a light-weight “anonymous nested function” (not a > “reference to” closure) is actually a nice compliment and in fact 2 > different things. As FPC’s current c-blocks support demonstrates, it has > closure properties

Re: [fpc-pascal] Passing nested procs out?

2018-11-15 Thread Sven Barth via fpc-pascal
Am Do., 15. Nov. 2018, 12:40 hat Ryan Joseph geschrieben: > > > > On Nov 15, 2018, at 5:14 PM, Sven Barth via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > > > > See the notes mentioned here: > http://wiki.freepascal.org/FPC_New_Features_2.6.0#Su

Re: [fpc-pascal] Passing nested procs out?

2018-11-15 Thread Sven Barth via fpc-pascal
Am Do., 15. Nov. 2018, 12:26 hat Marcos Douglas B. Santos geschrieben: > On Thu, Nov 15, 2018 at 8:15 AM Sven Barth via fpc-pascal > wrote: > > > > Am Do., 15. Nov. 2018, 10:17 hat Ryan Joseph > geschrieben: > >> > >> Is passing nested procs outside of t

Re: [fpc-pascal] Passing nested procs out?

2018-11-15 Thread Sven Barth via fpc-pascal
Am Do., 15. Nov. 2018, 10:17 hat Ryan Joseph geschrieben: > Is passing nested procs outside of the calling scope relying on undefined > behavior? It doesn’t seem like this should be allowed. > See the notes mentioned here:

Re: [fpc-pascal] C-blocks

2018-11-15 Thread Sven Barth via fpc-pascal
Am Do., 15. Nov. 2018, 08:39 hat Ryan Joseph geschrieben: > > > > On Nov 15, 2018, at 1:27 PM, Sven Barth via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > > > > They are only useful when interacting with the external runtime. On > other

Re: [fpc-pascal] C-blocks

2018-11-14 Thread Sven Barth via fpc-pascal
Am 15.11.2018 um 03:59 schrieb Ryan Joseph: Can c-blocks support Jonas added for Cocoa support be extended to other platforms or is this stuck with OS X? It uses a runtime library by Apple but is it possible to replace this with a custom Pascal implementation? Somes notes:

Re: [fpc-pascal] Default record const values

2018-11-13 Thread Sven Barth via fpc-pascal
Am 14.11.2018 um 02:05 schrieb John Doe: On Mon, Nov 12, 2018 at 1:51 AM Sven Barth via fpc-pascal <mailto:fpc-pascal@lists.freepascal.org>> wrote: The compiler now correctly rejects such declarations with a "Type is not completely defined error". Making this not w

Re: [fpc-pascal] Uniform initialization?

2018-11-12 Thread Sven Barth via fpc-pascal
Am Di., 13. Nov. 2018, 07:04 hat Ryan Joseph geschrieben: > > > > On Nov 12, 2018, at 5:45 AM, Vojtěch Čihák > wrote: > > > > We've already decided internally that we are *not* going to support this. > > Why does FPC have Delphi mode anyways? It’s not actually compatible with > Delphi so what

Re: [fpc-pascal] Uniform initialization?

2018-11-11 Thread Sven Barth via fpc-pascal
Am Mo., 12. Nov. 2018, 03:12 hat Ryan Joseph geschrieben: > > > > On Nov 12, 2018, at 12:25 AM, Sven Barth via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > > > > I'm not convinced that this feature is really needed, because one can > simply crea

Re: [fpc-pascal] Default record const values

2018-11-11 Thread Sven Barth via fpc-pascal
Am Mo., 12. Nov. 2018, 02:56 hat Ryan Joseph geschrieben: > > > > On Nov 12, 2018, at 8:08 AM, Ryan Joseph > wrote: > > > > But this syntax worked if you assigned it within blocks. Why does it > need to be removed? Since I discovered it I was planning on using it > instead of class functions

Re: [fpc-pascal] Default record const values

2018-11-11 Thread Sven Barth via fpc-pascal
Am 10.11.2018 um 09:35 schrieb Ryan Joseph: Should’t this work? This would be a good way to set default record values but it doesn’t seem to be supported. type TMyRecord = record public a: integer; b: string;

Re: [fpc-pascal] Uniform initialization?

2018-11-11 Thread Sven Barth via fpc-pascal
Am 11.11.2018 um 19:29 schrieb leledumbo via fpc-pascal: But *if* I had to decide I would pick #1, cause then there wouldn't be the chance to break existing code if a user decides to add a constructor to their record and some other code relies on there not being a constructor. Also due to the

Re: [fpc-pascal] Uniform initialization?

2018-11-11 Thread Sven Barth via fpc-pascal
Am 11.11.2018 um 12:59 schrieb Ryan Joseph: Since I’ve got a little more free time I wanted to see if there was a simple solution to issue in Pascal that causes quite a bit of friction for me, i.e. constructor boiler plate. In c++ there is “uniform initialization” for structs which uses the

Re: [fpc-pascal] Uniform initialization?

2018-11-11 Thread Sven Barth via fpc-pascal
Am 11.11.2018 um 16:03 schrieb tobiasgie...@gmail.com: Hello, Delphi 10.3 is going to support inline variable declarations like this: begin var i : Integer := 22; WriteLn(i); end; I would assume it can also be used with records. For details, please see

Re: [fpc-pascal] Constants in generics

2018-11-10 Thread Sven Barth via fpc-pascal
Am Sa., 10. Nov. 2018, 14:47 hat Ryan Joseph geschrieben: > > > > On Nov 10, 2018, at 7:22 PM, Florian Klämpfl > wrote: > > > > If you "export" a generic taking a const from a unit, this info has to > be stored in the ppu. > > Can you show a test case I could use to see where this is triggered

Re: [fpc-pascal] Default record const values

2018-11-10 Thread Sven Barth via fpc-pascal
Am Sa., 10. Nov. 2018, 12:44 hat Ryan Joseph geschrieben: > Not quite understanding how that’s not entirely parsed by the time you > assign outside of the record. Even so I would expect it to copy what the > const was able to capture, fully parsed or not. > It's not entirely parsed by the time

Re: [fpc-pascal] Default record const values

2018-11-10 Thread Sven Barth via fpc-pascal
Am Sa., 10. Nov. 2018, 10:06 hat Ryan Joseph geschrieben: > Should’t this work? This would be a good way to set default record values > but it doesn’t seem to be supported. > TMyRecord is not yet completely parsed. There could be another field located behind the "default" constant. Thus using

Re: [fpc-pascal] Constants in generics

2018-11-08 Thread Sven Barth via fpc-pascal
Am Fr., 9. Nov. 2018, 03:44 hat Ryan Joseph geschrieben: > > > > On Nov 9, 2018, at 4:28 AM, Florian Klämpfl > wrote: > > > > I like the idea of const in generics, but it needs serious cleanup when > it's working: > > - commit messages like "first commit" are useless > > Those are for github so

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