[fpc-pascal] Initial support for Custom Attributes

2019-07-12 Thread Sven Barth via fpc-pascal
gin === procedure Test; [cdecl]; begin end; === code end === Just in case: this feature won't be part of 3.2. The wiki pages New Features Trunk and User Changes Trunk will be updated soon with the new information. Regards, Sven ___ fpc-pascal mai

Re: [fpc-pascal] Warning: Symbol "faHidden" is not portable

2019-07-19 Thread Sven Barth via fpc-pascal
t; Correct. Regards, Sven > _______________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] TParamFlags and fpc 3.2.0.

2019-07-23 Thread Sven Barth via fpc-pascal
4 ? > > How to use TParamFlags to have the same result as using fpc 3.0.2 / fpc > 3.0.4 ? > Check for pfHidden. Regards, Sven > ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] TParamFlags and fpc 3.2.0.

2019-07-24 Thread Sven Barth via fpc-pascal
ng if "pfHidden in flags", but you nevertheless need to advance your pointer to the next parameter. Regards, Sven ___________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] TParamFlags and fpc 3.2.0.

2019-07-25 Thread Sven Barth via fpc-pascal
fredvs schrieb am Do., 25. Juli 2019, 15:08: > Re-re hello. > > Maybe with video it will be more easy to explain the problem. > It would help more if you'd point me exactly at the code in question. Regards, Sven ___________ fpc-pascal mailli

Re: [fpc-pascal] TParamFlags and fpc 3.2.0.

2019-07-26 Thread Sven Barth via fpc-pascal
end; >end; > end; > end; > // adjust array now that we know the real count SetLength(params, count); > if isfunction then begin > params[high(params)].typename:= getshortstring(po1); > end; > end; >end; >

Re: [fpc-pascal] TParamFlags and fpc 3.2.0.

2019-07-26 Thread Sven Barth via fpc-pascal
ly {$ifdef mse_fpc_3_2}   // skip hidden parameters ($self, $high, etc.)   if not (pfHidden in flags) then   {$endif}   Inc(count);      end; === code end === This should hopefully solve the issue. Regards, Sven ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] TParamFlags and fpc 3.2.0.

2019-07-27 Thread Sven Barth via fpc-pascal
Ah, right, of course. You need the part I added *inside* the with block of params[count]. My fault (I'm doing this here on the fly, not testing it). Regards, Sven ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] TParamFlags and fpc 3.2.0.

2019-07-27 Thread Sven Barth via fpc-pascal
=== code end === And will print the following: === code begin === procedure TMyMethod1 ( const aSender: TObject ) function TMyMethod2 ( var aArg: LongInt ; aArr: array of LongInt ): AnsiString === code end === So it definitely works, now you only need to figure out the problem in your code. Regards, Sven ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] TParamFlags and fpc 3.2.0.

2019-07-28 Thread Sven Barth via fpc-pascal
__ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] TParamFlags and fpc 3.2.0.

2019-07-28 Thread Sven Barth via fpc-pascal
C trunk on targets that have strict alignment requirements (e.g. ARM). I think it /should/ work however if you add a "{$if FPC_FULLVERSION >= 030300}po1 := AlignTParamFlags(po1);{$endif}" directly before the assignment to "flags". Regards, Sven _________

Re: [fpc-pascal] TParamFlags and fpc 3.2.0.

2019-07-28 Thread Sven Barth via fpc-pascal
che, may I ask what number of FPC_FULLVERSION will be used for that wonderful new feature? What do you mean? If you mean the AlignTParamFlags then I already showed that? Regards, Sven _______ fpc-pascal maillist - fpc-pascal@lists.freepascal

Re: [fpc-pascal] TParamFlags and fpc 3.2.0.

2019-07-29 Thread Sven Barth via fpc-pascal
if FPC_FULLVERSION >= 030200 (not sure of the number) > >then use pfHidden flag. > > Is 030200 the right number? > You should also use 030100 here as that was added at the same time as the switch to Word size. Regards, Sven > _______

Re: [fpc-pascal] TParamFlags and fpc 3.2.0.

2019-07-29 Thread Sven Barth via fpc-pascal
is also always > 0300xx. ;) Regards, Sven > _______________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] TParamFlags and fpc 3.2.0.

2019-08-01 Thread Sven Barth via fpc-pascal
ed a few days ago. Regards, Sven _______________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] TParamFlags and fpc 3.2.0.

2019-08-02 Thread Sven Barth via fpc-pascal
This works with any identifier that is in scope (e.g. in this case the TypInfo unit must be used, but that is the case here anyway). Regards, Sven > ___________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] TParamFlags and fpc 3.2.0.

2019-08-02 Thread Sven Barth via fpc-pascal
agement needs to be handled by itself cause the type information is read only. And if someone is not able to check for a simple flag then they shouldn't work with the RTTI. Regards, Sven > _______ fpc-pascal maillist - fpc-pascal@lists.freepasc

Re: [fpc-pascal] TParamFlags and fpc 3.2.0.

2019-08-02 Thread Sven Barth via fpc-pascal
. > > Huh, like in your code-fix? > > ;-) > > Ok, all is ok, many thanks Sven and have a perfect summer. > The check for the flag worked. It's the remainder of the code that's broken. Regards, Sven > ___________ fpc-pascal maillist - fp

Re: [fpc-pascal] PPCJVM Android JVM target and building to dex

2019-08-03 Thread Sven Barth via fpc-pascal
compiler is not the problem. But maybe the build chain needs to be adjusted. Regards, Sven > _______ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] Lazarus Release 2.0.4

2019-08-06 Thread Mattias Gaertner via fpc-pascal
at (after some time for synchronization) http://mirrors.iwi.me/lazarus/ Mattias _______ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] += property bug?

2019-08-11 Thread Sven Barth via fpc-pascal
x := newValue; end; var d: TData; begin d.get += 10; // ERROR: Variable identifier expected end. This is forbidden by design. Regards, Sven ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin

Re: [fpc-pascal] += property bug?

2019-08-12 Thread Sven Barth via fpc-pascal
but > instead > have special, duplicated handling. Because of course they do. > The code you linked converts "a += b" to "tmp := @a; tmp^ := tmp^ + b", so except for using a temp to avoid duplicate calculation of "a" in how far is this not the lon

Re: [fpc-pascal] += property bug?

2019-08-13 Thread Sven Barth via fpc-pascal
Martok schrieb am Di., 13. Aug. 2019, 14:44: > Am 12.08.2019 um 11:31 schrieb Sven Barth via fpc-pascal: > > The code you linked converts "a += b" to "tmp := @a; tmp^ := tmp^ + b", > so > > except for using a temp to avoid duplicate calculation of "a&

Re: [fpc-pascal] += property bug?

2019-08-14 Thread Sven Barth via fpc-pascal
directive: {$COperators On/Off}. Probably from a time before modeswitches were introduced. It's even per default off. The default fpc.cfg however enables them... And "out" is behind a modeswitch because modes like TP and ISO don't know that concept. Regards, Sven >

Re: [fpc-pascal] += property bug?

2019-08-14 Thread Sven Barth via fpc-pascal
ar_fields) and further extended to records in 2.6.0 (see https://wiki.freepascal.org/User_Changes_2.6.0#Taking_the_address_of_fields_of_record_properties ). The idea is to have properties backed by a field and backed by methods behave identically. Regards, Sven > __________

Re: [fpc-pascal] += property bug?

2019-08-15 Thread Sven Barth via fpc-pascal
if CALL_LVL is a property and the returned type is a record is the returned value will be a temporary variable, thus you'd increase the value of the temp, but not of the one stored in the class. Regards, Sven _______________ fpc-pascal maillist - fpc-pas

Re: [fpc-pascal] ppc64le ABI problem

2019-08-26 Thread Sven Barth via fpc-pascal
to change the 48 in fpc/compiler/powerpc64/cpupara.pas line to 32 as a > temporary test. > Line 302 in case anyone is wondering (thankfully that's the only "48" in that fike (plus its preceeding comment) ^^') Regards, Sven > ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] ppc64le ABI problem

2019-08-26 Thread Sven Barth via fpc-pascal
quot;-T N" - j N Whereby you need to adjust BINUTILSPREFIX to whatever prefix your binutils have and N to e.g. your number of cores. Regards, Sven > ___________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] ppc64le ABI problem

2019-08-26 Thread Sven Barth via fpc-pascal
nly it wouldn't still be so damn expensive... I'm still a bit miffed that I didn't purchase one of the refurbished Tyan servers with a POWER8 for 250€ a few months ago... Regards, Sven > _______________ fpc-pascal maillist - fpc-

Re: [fpc-pascal] Compatibility problems with fpc > 3.3.1 rev 42375

2019-08-31 Thread Sven Barth via fpc-pascal
s provided by the TypInfo unit. This is bound to break here and then when the RTTI is extended. Regards, Sven ___________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Compatibility problems with fpc > 3.3.1 rev 42375

2019-08-31 Thread Sven Barth via fpc-pascal
from one PPropInfo you need to take that into account or use the appropriate functions of the TypInfo unit. Regards, Sven _______ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Compatibility problems with fpc > 3.3.1 rev 42375

2019-08-31 Thread Sven Barth via fpc-pascal
- you'll need it. ;) Regards, Sven > _______________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Illegal counter variable?

2019-09-09 Thread Mattias Gaertner via fpc-pascal
is about the difference between an initialized global var and a non initialized global var. My guess is that it has to do with the different exe/linker sections where these vars are put. Hopefully some compiler guru can explain. Mattias _______ fpc-pascal mail

Re: [fpc-pascal] Illegal counter variable?

2019-09-09 Thread Mattias Gaertner via fpc-pascal
elphi should check if this > sysnatx is allowed. Same in 10.3. Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Illegal counter variable?

2019-09-11 Thread Sven Barth via fpc-pascal
d increment in various languages: > https://www.rosettacode.org/wiki/Loops/For_with_a_specified_step). Modula-2 > or Oberon-2 code snippets could perhaps be mistaken for Pascal through the > mists of time. > Well, we do have a patch for "for ... (down)to ... by" support: h

Re: [fpc-pascal] Illegal counter variable?

2019-09-11 Thread Sven Barth via fpc-pascal
Sven > ___________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Calculating Pixels to represent 3D coordinates

2019-09-17 Thread Sven Barth via fpc-pascal
get a feeling for what's required. In the end you might be better served to use a graphics package or at least OpenGL. Regards, Sven > _______ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Talkback and detecting touch events

2019-09-17 Thread Thomas Young via fpc-pascal
one or two. Thank you very much for yours tips how to > detect this specific touch events when Talkback is running. > ___________ > fpc-pascal maillist - fpc-pascal@lists.freepascal.org > https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-

Re: [fpc-pascal] Calculating Pixels to represent 3D coordinates

2019-09-17 Thread Thomas Young via fpc-pascal
>> representation of the XYZ points and lines connecting 2 pair of XYZ >> coordinates on the screen. The purpose of this is to show a 3D >> representation of a CNC tool path including the Z movements. >> >> James >> ___ >&g

Re: [fpc-pascal] Overloading Inc and Dec procedures?

2019-09-18 Thread Sven Barth via fpc-pascal
no, it can't be fixed. Regards, Sven ___________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Calculating Pixels to represent 3D coordinates

2019-09-19 Thread Thomas Young via fpc-pascal
on the screen, I don't know if some adjustment would > be nessecary for use on direct screen coordinates... things might end up > upside down, or the rotations might need to be reversed by switching the + > and - between CoSine and Sine because of this.. > > > Thank you

Re: [fpc-pascal] [Lazarus] It's alive !

2019-09-21 Thread Sven Barth via fpc-pascal
ch as is possible within the constraints of the WebAssembly environment) will probably be quite some effort as well. ;) Regards, Sven _______________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] It's alive !

2019-09-21 Thread Mattias Gaertner via fpc-pascal
> - pas2js for the necessary Javascript front end and GUI code. Amazing! I hope to see it soon in trunk. Mattias _______________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] FPC docs about FindFirst

2019-09-22 Thread Sven Barth via fpc-pascal
dNext/FindClose while the page you mentioned is about Dos.FindFirst/FindNext/FindClose. Same names, but different units with slightly different behavior. Regards, Sven > ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] for-in loop cast

2019-09-26 Thread Sven Barth via fpc-pascal
r TObject enumerator to TObjectList. Regards, Sven > ___________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] [Pas2js] It's alive !

2019-09-29 Thread Mattias Gaertner via fpc-pascal
st to rename it to "ppwasm". Why not "ppcwasm"? Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] threads, memory barriers and RTLeventSetEvent / RTLeventWaitFor

2019-10-01 Thread Sven Barth via fpc-pascal
ry >FAsyncMethod(); > finally >RTLeventSetEvent(FDebugLoopStoppedEvent); > end; > end; > until Terminated; > end; > The functions themselves AFAIK don't have any memory barriers, so it would depend solely

Re: [fpc-pascal] fcl-passrc with Objective-c

2019-10-02 Thread Sven Barth via fpc-pascal
t; this is a type alias, which explains the error message. > I suppose that the documentation is still rather up to date regarding that: https://www.freepascal.org/docs-html/current/ref/refch11.html#x128-1511 Regards, Sven > ___ fpc-pascal mai

[fpc-pascal] generic proc inference

2019-10-03 Thread Mattias Gaertner via fpc-pascal
Hi, What is the state of FPC support for calling generic procedures using inference like Delphi? For example: {$mode objfpc} generic procedure Run(a: T); begin end; begin Run(2); end. Mattias ___ fpc-pascal maillist - fpc-pascal

Re: [fpc-pascal] generic proc inference

2019-10-03 Thread Sven Barth via fpc-pascal
Mattias Gaertner via fpc-pascal schrieb am Do., 3. Okt. 2019, 21:35: > Hi, > > What is the state of FPC support for calling generic procedures using > inference like Delphi? > > For example: > > {$mode objfpc} > generic procedure Run(a: T); > begin > end; > &

Re: [fpc-pascal] generic proc inference

2019-10-04 Thread Sven Barth via fpc-pascal
Ryan Joseph schrieb am Fr., 4. Okt. 2019, 17:10: > > > > On Oct 3, 2019, at 6:07 PM, Sven Barth via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > > > > A patch for it by Ryan Joseph exists ( > https://bugs.freepascal.org/view.php?id=35261 ), but I&#

Re: [fpc-pascal] generic proc inference

2019-10-06 Thread Mattias Gaertner via fpc-pascal
On Fri, 4 Oct 2019 11:10:22 -0400 Ryan Joseph wrote: > > On Oct 3, 2019, at 6:07 PM, Sven Barth via fpc-pascal > > wrote: > > > > A patch for it by Ryan Joseph exists > > ( https://bugs.freepascal.org/view.php?id=35261 ), but I've not yet > > found the

Re: [fpc-pascal] generic proc inference

2019-10-06 Thread Mattias Gaertner via fpc-pascal
On Sun, 6 Oct 2019 12:23:57 -0400 Ryan Joseph wrote: > > On Oct 6, 2019, at 12:18 PM, Mattias Gaertner via fpc-pascal > > wrote: > > > > Ryan, is patch_3_25.diff the latest patch? > > > > I get a lot of merge conflicts. > > What fpc revision is nee

Re: [fpc-pascal] generic proc inference

2019-10-06 Thread Mattias Gaertner via fpc-pascal
nd. > > That doesn’t make sense to me either so I need to study it. Both > should fail actually as I designed it (for now). Why? > How does Delphi implicitly specialize this? DoThis(1,1,nil); // T and U become shortint DoThis('aa','aa',nil); // T and U become string Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] generic proc inference

2019-10-06 Thread Mattias Gaertner via fpc-pascal
On Sun, 6 Oct 2019 17:10:54 -0400 Ryan Joseph wrote: > > On Oct 6, 2019, at 5:03 PM, Ryan Joseph > > wrote: > >> On Oct 6, 2019, at 2:06 PM, Mattias Gaertner via fpc-pascal > >> wrote: > >> > >> 1. > >> FPC allows default params, Delph

Re: [fpc-pascal] generic proc inference

2019-10-06 Thread Sven Barth via fpc-pascal
ere. If a generic parameter is not used in the parameter list (cause it's used in the result type (either directly or to specialize something else), only the body of the routine or even not at all), then that routine must not be used for implicit specialization. Regards, Sven > ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] generic proc inference

2019-10-07 Thread Mattias Gaertner via fpc-pascal
On Sun, 6 Oct 2019 18:19:37 -0400 Ryan Joseph wrote: >[...] > That works then. Added a test: > [...] Thanks. Mattias _______ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] generic proc inference

2019-10-07 Thread Mattias Gaertner via fpc-pascal
On Sun, 6 Oct 2019 18:16:16 -0400 Ryan Joseph wrote: > > On Oct 6, 2019, at 5:40 PM, Mattias Gaertner via fpc-pascal > > wrote: > >> Which test? Please post a sample. > > > > generic procedure DoThis(a:T; b:T); > > begin end; > > > > be

Re: [fpc-pascal] generic proc inference

2019-10-07 Thread Mattias Gaertner via fpc-pascal
// both fits, should give an error > > end; I gave a bad example. Here is a better one: generic procedure DoThis(a: T; b:T); overload; begin end; generic procedure DoThis(a: T; b:U); overload; begin end; begin DoThis(1,2); end; fpc selects second, but IMO should give an error

Re: [fpc-pascal] generic proc inference

2019-10-07 Thread Mattias Gaertner via fpc-pascal
mple this works as expected (I shortened the example): generic procedure Run(a: array of T); overload; var p: PTypeInfo; begin p:=TypeInfo(T); writeln(p^.Name); end; var a: array of boolean; begin Run(a); // writes "boolean" end; Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] generic proc inference

2019-10-07 Thread Mattias Gaertner via fpc-pascal
On Mon, 7 Oct 2019 07:54:51 +0200 Sven Barth via fpc-pascal wrote: > Ryan Joseph schrieb am Mo., 7. Okt. 2019, > 00:16: >[...] > > >>> 3. > > >>> timpfuncspez2.pp > > >>> DoThis > > >>> DoThis > > >>> Delphi

Re: [fpc-pascal] generic proc inference

2019-10-07 Thread Sven Barth via fpc-pascal
Mattias Gaertner schrieb am Mo., 7. Okt. 2019, 11:59: > On Mon, 7 Oct 2019 07:54:51 +0200 > Sven Barth via fpc-pascal wrote: > > > Ryan Joseph schrieb am Mo., 7. Okt. 2019, > > 00:16: > >[...] > > > >>> 3. > > > >>> timpfuncspez2

Re: [fpc-pascal] generic proc inference

2019-10-07 Thread Mattias Gaertner via fpc-pascal
On Mon, 7 Oct 2019 14:12:32 +0200 Sven Barth via fpc-pascal wrote: >[...] > > > > > generic function DoThis(a: T): T; overload; > > > > > begin end; > > > > > generic function DoThis(a: T): U; overload; > > > > > begin end; >

Re: [fpc-pascal] generic proc inference

2019-10-07 Thread Mattias Gaertner via fpc-pascal
On Mon, 7 Oct 2019 14:37:16 +0200 (CEST) Michael Van Canneyt wrote: > On Mon, 7 Oct 2019, Mattias Gaertner via fpc-pascal wrote: > >[...] > I think sven means if you have e.g. 3 functions: > > generic function DoThis(a: T): T; overload; > begin end; > > gener

Re: [fpc-pascal] generic proc inference

2019-10-07 Thread Mattias Gaertner via fpc-pascal
? :-) Yes. Maybe it's just me, every day learning more ugly details of Delphi inference rules. Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] generic proc inference

2019-10-07 Thread Mattias Gaertner via fpc-pascal
procedure Run(a: word; b: T); Run(1,word(2)); // calls first Run(word(1),2); // calls second Run(1,2); // Error: ambiguous Run(word(1),word(2)); // Error: ambiguous Mattias _______________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freep

Re: [fpc-pascal] generic proc inference

2019-10-07 Thread Mattias Gaertner via fpc-pascal
y to find a shared type. 3. Check if all templates have types >[...] Mattias _______________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] generic proc inference

2019-10-07 Thread Sven Barth via fpc-pascal
Ryan Joseph schrieb am Mo., 7. Okt. 2019, 15:51: > That bug aside the rule is that non-generic overloads always win over > generics. I remember this was discussed at length if we can find the old > thread. > Here: https://lists.freepascal.org/pipermail/fpc-pascal/2018-December

Re: [fpc-pascal] generic proc inference

2019-10-07 Thread Mattias Gaertner via fpc-pascal
On Mon, 7 Oct 2019 12:38:51 -0400 Ryan Joseph wrote: > > On Oct 7, 2019, at 10:19 AM, Mattias Gaertner via fpc-pascal > > wrote: > > > > Note that in Delphi the "non-generic-wins" rule is per parameter: > > > > procedure Run(a:T; b: word); > &

Re: [fpc-pascal] generic proc inference

2019-10-07 Thread Sven Barth via fpc-pascal
Mattias Gaertner via fpc-pascal schrieb am Mo., 7. Okt. 2019, 18:42: > On Mon, 7 Oct 2019 12:38:51 -0400 > Ryan Joseph wrote: > > > > On Oct 7, 2019, at 10:19 AM, Mattias Gaertner via fpc-pascal > > > wrote: > > > > > > Note that in Delphi

Re: [fpc-pascal] generic proc inference

2019-10-07 Thread Mattias Gaertner via fpc-pascal
On Mon, 7 Oct 2019 19:47:58 +0200 Sven Barth via fpc-pascal wrote: > Mattias Gaertner via fpc-pascal > schrieb am Mo., 7. Okt. 2019, 18:42: > > > On Mon, 7 Oct 2019 12:38:51 -0400 > > Ryan Joseph wrote: > > > > > > On Oct 7, 2019, at 10:19 AM, Mattias

Re: [fpc-pascal] generic proc inference

2019-10-07 Thread Mattias Gaertner via fpc-pascal
d; procedure Fly(Bird: TBird); begin end; var obj: TAnt; begin obj.Run(@Fly); // when fpc supports anonymous functions: obj.Run(procedure Fly(Bird: TBird) begin end); end. Mattias _______________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://

Re: [fpc-pascal] generic proc inference

2019-10-08 Thread Sven Barth via fpc-pascal
Ryan Joseph schrieb am Fr., 4. Okt. 2019, 17:10: > > > > On Oct 3, 2019, at 6:07 PM, Sven Barth via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > > > > A patch for it by Ryan Joseph exists ( > https://bugs.freepascal.org/view.php?id=35261 ), but I&#

Re: [fpc-pascal] generic proc inference

2019-10-08 Thread Sven Barth via fpc-pascal
Ryan Joseph schrieb am Di., 8. Okt. 2019, 23:00: > > > > On Oct 8, 2019, at 11:32 AM, Sven Barth via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > > > > I checked again. The thing is that in the compiler overload handling is > done inside htypechk

Re: [fpc-pascal] Compatibility problems with fpc > 3.3.1 rev 42375

2019-10-09 Thread Sven Barth via fpc-pascal
ize increase is not ARM related, but related to a new feature. The alignment fixes you mention are in fact necessary for all non-x86 targets. Regards, Sven > ___________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Compatibility problems with fpc > 3.3.1 rev 42375

2019-10-09 Thread Sven Barth via fpc-pascal
except for the ifdefs and a few extensions for events and UTF-8 strings, so the problem must be somewhere else. Regards, Sven _______________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] generic proc inference

2019-10-09 Thread Sven Barth via fpc-pascal
Ryan Joseph schrieb am Mi., 9. Okt. 2019, 22:53: > > > > On Oct 9, 2019, at 1:51 AM, Sven Barth via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > > > > Yes, exactly that. It could also be that the parser picks up a non > generic overload from anothe

Re: [fpc-pascal] generic proc inference

2019-10-10 Thread Sven Barth via fpc-pascal
Am 10.10.2019 um 22:41 schrieb Ryan Joseph: On Oct 9, 2019, at 6:21 PM, Sven Barth via fpc-pascal wrote: Hmmm, I thought letting that dummy sym pass through would have lots of adverse affects in various places. I’ll have to study this later in the debugger. In that case the necessary

Re: [fpc-pascal] fcl-passrc errors

2019-10-13 Thread Sven Barth via fpc-pascal
he documentation generator uses fcl-passrc, and the > RTL/FCL is full of include files. > > Probably your invocation of the parser is simply wrong or missing some > arguments. > Could the missing ".inc" be the problem? I have not checked, but it could be that FPC always adds ".inc" if no extension is present. Regards, Sven ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] fcl-passrc errors

2019-10-13 Thread Sven Barth via fpc-pascal
Am 13.10.2019 um 11:26 schrieb Michael Van Canneyt: On Sun, 13 Oct 2019, Sven Barth via fpc-pascal wrote: Just type casting because the array is an array of pointers. I get these errors otherwise "Incompatible types: got "Pointer" expected “TEntity"”. I could use a prop

Re: [fpc-pascal] fcl-passrc errors

2019-10-13 Thread Sven Barth via fpc-pascal
Ryan Joseph schrieb am So., 13. Okt. 2019, 16:22: > > > > On Oct 13, 2019, at 5:58 AM, Sven Barth via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > > > >> Delphi does not allow it: > >> > >> [dcc32 Error] Project1.dpr(18):

Re: [fpc-pascal] fcl-passrc errors

2019-10-13 Thread Sven Barth via fpc-pascal
Am 13.10.2019 um 23:19 schrieb Ryan Joseph: On Oct 13, 2019, at 11:11 AM, Sven Barth via fpc-pascal wrote: Then specialize the list with the correct type. This issue *will* be fixed and is not up to discussion. Here’s some code from the parser today. TFPList is being used because it’s a

Re: [fpc-pascal] fcl-passrc errors

2019-10-14 Thread Mattias Gaertner via fpc-pascal
On Mon, 14 Oct 2019 07:37:38 +0200 Sven Barth via fpc-pascal wrote: >[...] > Because the iterator returns a Pointer and not whatever you think it > might return. If you know it's something else, you cast that inside > the loop. I agree with Sven. What about the other way ro

Re: [fpc-pascal] fcl-passrc method/function invocations

2019-10-14 Thread Mattias Gaertner via fpc-pascal
t; Separate from the resolver, there is also the pasuseanalyser, > which analyses if elements are used. Yes. Directly or indirectly. Module or whole program. > I don't think it keeps a count, though. It does not. Mattias ______________

Re: [fpc-pascal] FPC_CURRENCY_IS_INT64

2019-10-14 Thread Sven Barth via fpc-pascal
hat on Win32 there is Currency internaly represented > using another data type? > Correct. On all non-Win64 x86 systems the Currency type is a FPU based type. On non-x86 systems the Currency type is represented internally by a Int64 as well. Regards, Sven > ________

Re: [fpc-pascal] fcl-passrc errors

2019-10-14 Thread Sven Barth via fpc-pascal
Mattias Gaertner via fpc-pascal schrieb am Mo., 14. Okt. 2019, 10:39: > On Mon, 14 Oct 2019 07:37:38 +0200 > Sven Barth via fpc-pascal wrote: > > >[...] > > Because the iterator returns a Pointer and not whatever you think it > > might return. If you know it'

Re: [fpc-pascal] fcl-passrc errors

2019-10-14 Thread Mattias Gaertner via fpc-pascal
On Mon, 14 Oct 2019 14:02:44 +0200 Sven Barth via fpc-pascal wrote: > Mattias Gaertner via fpc-pascal > schrieb am Mo., 14. Okt. 2019, 10:39: >[...] > First you agree with me and then you provide in essence the same > examples as Ryan? So what is it now? Ryan gave several exa

Re: [fpc-pascal] DirectoryExists on FreeBSD , problem

2019-10-14 Thread Mattias Gaertner via fpc-pascal
pdate CudaText cannot see that folder (in subdir of home dir, access > rights ok) exists. After removing this check in app, app now cannot > see that another dir (also in home dir) exists. > > I removed VM with freebsd so cannot check in small demo. Mattias __________

Re: [fpc-pascal] fcl-passrc method/function invocations

2019-10-15 Thread Mattias Gaertner via fpc-pascal
a ProgramSection. Mattias ___________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] fcl-passrc errors

2019-10-15 Thread Sven Barth via fpc-pascal
personally use "absolute" very often when I want neither typecasts nor another temporary variable to clutter my code. Regards, Sven ___________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] FPC Mantis has 2 fields "fixed in revision" in issues

2019-10-21 Thread Sven Barth via fpc-pascal
differently!). The revision at the top is the revision where the reporter encountered the problem, the one at the bottom is where the developer fixed the problem. Regards, Sven ___________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.f

Re: [fpc-pascal] Dynamic loading to static?

2019-10-26 Thread Sven Barth via fpc-pascal
Pointer is not simply a procedure variable. For your case you can solve it like this: === code begin === CodePointer(Py_Initialize) := GetProcAddress(handle, 'Py_Initialize'); === code end === Regards, Sven ___________ fpc-pascal maillist - fpc-pa

Re: [fpc-pascal] DirectoryExists on FreeBSD , problem

2019-10-26 Thread Mattias Gaertner via fpc-pascal
ts, then fpgui suffer from the same bug. We need someone with FreeBSD x86 12.0 knowledge. > [...] Mattias _______ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Dynamic loading to static?

2019-10-26 Thread Sven Barth via fpc-pascal
Am 26.10.2019 um 14:56 schrieb Ryan Joseph: On Oct 26, 2019, at 4:26 AM, Sven Barth via fpc-pascal wrote: CodePointer(Py_Initialize) := GetProcAddress(handle, 'Py_Initialize'); Thanks that works. I don’t think I’ve ever cast a left side value before in Pascal and honestly I di

Re: [fpc-pascal] Dynamic loading to static?

2019-10-26 Thread Sven Barth via fpc-pascal
Ryan Joseph schrieb am Sa., 26. Okt. 2019, 22:46: > > > > On Oct 26, 2019, at 12:55 PM, Sven Barth via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > > > > tmpenum := y.GetEnumerator; > > while tmpenum.MoveNext do begin > > x := tmp

Re: [fpc-pascal] fpbind ipv6 version

2019-10-27 Thread Sven Barth via fpc-pascal
7;t work... the IPv6 format is max 8 four character > hex > numbers and 128 bits... > > https://en.wikipedia.org/wiki/IPv6_address#Representation 4 * 32-bit = 128-bit? Also 8 four *character* hexnumbers are 4 eight character hexnumbers aka four 32-bit integers. Regards, Sven

Re: [fpc-pascal] fpbind ipv6 version

2019-10-27 Thread Sven Barth via fpc-pascal
Am 28.10.2019 um 00:24 schrieb wkitt...@windstream.net: On 10/27/19 6:23 PM, Sven Barth via fpc-pascal wrote: schrieb am So., 27. Okt. 2019, 19:32:     On 10/27/19 11:56 AM, Alexander Grotewohl wrote: > const >      IN6ADDR_ANY: array[0..3] of longint = (0, 0, 0, 0);     well

[fpc-pascal] Lazarus Release 2.0.6

2019-11-01 Thread Mattias Gaertner via fpc-pascal
after some time for synchronization) http://mirrors.iwi.me/lazarus/ Mattias _______ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] Generic operator overload problem

2019-11-02 Thread Ryan Joseph via fpc-pascal
ec2): TVec2; begin result.x := left.x - right.x; result.y := left.y - right.y; end; class operator TVec2.- (left: TVec2; right: TScalar): TVec2; begin result.x := left.x - right; result.y := left.y - right; end; begin end. Regards, Ryan Joseph __________

[fpc-pascal] Generic type conflicts

2019-11-02 Thread Ryan Joseph via fpc-pascal
result.y:=0; end; end; begin end. Regards, Ryan Joseph _______ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

<    9   10   11   12   13   14   15   16   17   18   >