Re: [fpc-pascal] specify variable name with string variable

2019-07-07 Thread Ryan Joseph
ctually curious about this recently also, does FPC have local variable RTTI? That would be useful to have actually. I know it exists for classes but not sure about locals. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freep

Re: [fpc-pascal] fcl-passrc errors

2019-10-15 Thread Ryan Joseph
d; > That is a clever solution but it’s basically a sneaky trick around the compilers excessively strict typing. The programmer knows the correct type but there’s no way to tell that to the for loop. Regards, Ryan Joseph ___ fpc-pascal mailli

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

2019-10-15 Thread Ryan Joseph
contain the same list of functions. So, how do I find the functions in a program module? Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

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

2019-10-15 Thread Ryan Joseph
I can possible extend it to accommodate? Regards, Ryan Joseph ___ 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 Ryan Joseph
ss and changing the declarations. In fact this means using TFPList is not really a good idea at all anymore unless you don’t plan to use for..in loops. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepas

[fpc-pascal] Dynamic loading to static?

2019-10-25 Thread Ryan Joseph
to manually change them all by hand to be things like: function PyImport_ImportModule(module: pchar): PPyObject; cdecl; Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi

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

2019-10-25 Thread Ryan Joseph
a work to add the extra types in because the original code was Delphi. var Py_Initialize: procedure; cdecl; begin Py_Initialize := GetProcAddress(handle, 'Py_Initialize'); Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@li

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

2019-10-26 Thread Ryan Joseph
fact didn’t we just have a big talk about for loop iterators and how they can’t be type cast? I thought that was because casting the left side value was illegal. Very confused now. ;) Regards, Ryan Joseph ___ fpc-pascal maillist -

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

2019-10-26 Thread Ryan Joseph
oop so casting just made sense to me from an efficiency standpoint. Regards, Ryan Joseph ___ 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 Ryan Joseph
number as the generic parameters. What should be the rule here? > > >> How does Delphi implicitly specialize this? > > DoThis(1,1,nil); // T and U become shortint > DoThis('aa','aa',nil); // T and U become string So Delphi seems to match by index so param 1 = generic param 1. With repeating patterns this breaks downs but maybe it’s a special case if the function parameter count matches the generic parameter count? Regards, Ryan Joseph ___ 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 Ryan Joseph
s(msg: integer; param1: TObject; > param2: TObject) >// so we expect an incompatible type error >DoThis(1, 1, TObject.Create); > end. That doesn’t make sense to me either so I need to study it. Both should fail actually as I designed it (for now). How does Delphi im

Re: [fpc-pascal] generic proc inference

2019-10-06 Thread Ryan Joseph
timpfuncspez15; generic procedure DoThis(param1: T; param2: integer = 100); begin writeln(param1, ' = ', param2); end; begin DoThis('hello'); end. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://list

Re: [fpc-pascal] generic proc inference

2019-10-06 Thread Ryan Joseph
> 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, Delphi does not. Nice. >> I see no tests for this though, so maybe this was not on

Re: [fpc-pascal] generic proc inference

2019-10-07 Thread Ryan Joseph
And the following compiles, but fails on run, as T becomes an array > instead of the element type: > generic procedure Run(a: array of T); overload; > Good catch, that’s a bug. var a: array of integer; begin Run(a); Regards, Ryan Joseph ___

Re: [fpc-pascal] generic proc inference

2019-10-07 Thread Ryan Joseph
(a: T): T; overload; > begin end; > > generic function DoThis(a: T): U; overload; > begin end; > > function DoThis(aInt : Integer) : Integer; > > begin > end; Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pasca

Re: [fpc-pascal] generic proc inference

2019-10-07 Thread Ryan Joseph
arameter not in function parameter list. Not sure yet but something like “DoThis can not infer specialization from parameter list”. generic function DoThis(a: integer): T; If there’s more let me know. Regards, Ryan Joseph ___ fpc-pascal

Re: [fpc-pascal] generic proc inference

2019-10-07 Thread Ryan Joseph
egin end; // fails because the non-generic Run() will always be picked and the parameter count will be wrong. Run(1,1,1); Regards, Ryan Joseph ___ 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 Ryan Joseph
wins right? procedure Run(a:T; b: word); procedure Run(a: word; b: T); procedure Run(a: word; b: word); Regards, Ryan Joseph ___ 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-10 Thread Ryan Joseph
uld need to be made more resilient. > As a general matter could you explain the reasoning behind resolve_generic_dummysym()? Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/c

Re: [fpc-pascal] generic proc inference

2019-10-08 Thread Ryan Joseph
out this more later. Btw, the overloading stuff is in try_implicit_specialization but maybe that Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] Catalina upgrade changes

2019-10-08 Thread Ryan Joseph
11.1 and command line tools didn’t have any side effects at least. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Catalina upgrade changes

2019-10-08 Thread Ryan Joseph
My apologies, I sent this to the wrong list (it’s macOS related). Please disregard. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] Building complier fails in itolitlsreader.pas

2019-10-09 Thread Ryan Joseph
next block. -1 if this is the last listing block. end; Regards, Ryan Joseph ___ 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 Ryan Joseph
ates. > 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. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists

Re: [fpc-pascal] Building complier fails in itolitlsreader.pas

2019-10-09 Thread Ryan Joseph
cgi-bin/viewvc.cgi/trunk/packages/chm/src/itolitlsreader.pas?view=markup#l385. > I have also updated via svn (r43158) and that came through good. It is > busy building but no problems so far. > Thanks. I’ll download the sources again. R

Re: [fpc-pascal] generic proc inference

2019-10-06 Thread Ryan Joseph
ng thread some months ago but I gave up). Look at the changes page on Github and search for m_implicit_function_specialization. https://github.com/graemeg/freepascal/compare/master...genericptr:generic_implicit Regards, Ryan Joseph ___ fpc-pasc

Re: [fpc-pascal] generic proc inference

2019-10-04 Thread Ryan Joseph
> 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 > time to review it. > I’m eager to use this also but it’s been sitting there f

[fpc-pascal] fcl-passrc errors

2019-10-12 Thread Ryan Joseph
olumn 14 for pointer(entity) in entities do begin entity.Update; entity.Draw(renderer); renderer.PushBox(entity.GetHitBox, TRGBA.RedColor); end; 3) {$i settings} will not find the file “settings.inc”. This is valid in FPC but the parser seems to have other rules.

Re: [fpc-pascal] fcl-passrc errors

2019-10-12 Thread Ryan Joseph
On Oct 12, 2019, at 6:43 PM, Michael Van Canneyt wrote:1) class operators for recordsEParserError: Expected "procedure" at token "operator" in file /Users/ryanjoseph/Developer/Projects/FPC/GLCanvas/GLCanvas.pas at line 115 column 7class operator TVertex3.= (constref a, b: TVertex3):

Re: [fpc-pascal] fcl-passrc errors

2019-10-13 Thread Ryan Joseph
sting outside of the loop. var arr: specialize TFPGObjectList; obj: TMyClass; begin arr := specialize TFPGObjectList.Create; arr.Add(TObject.Create); // Incompatible types: got "TObject" expected "TMyClass" for obj in arr do begin end; Regards,

Re: [fpc-pascal] fcl-passrc errors

2019-10-13 Thread Ryan Joseph
; type TMyRecordA = record class operator = (constref a, b: TMyRecordA): boolean; end; class operator TMyRecordA.= (constref a, b: TMyRecordA): boolean; begin result := (@a = @b); end; procedure DoThis; type TMyRecordB = record private x, y, z: integer; end;

Re: [fpc-pascal] fcl-passrc errors

2019-10-13 Thread Ryan Joseph
o I don't forget. > > I'll try to fix them ASAP. I’m out of time today but I’m make some examples later. Where do you want me to post them? Sorry I don’t get "sed s/bug/bugreport/“. heres’ the list: 1) allow omission of extension for $include macro 2) record class operators 3) record se

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

2019-10-13 Thread Ryan Joseph
not sure exactly. It’s probably possible that it’s not always possible to know because there are unresolved types so: a := clss.DoThis; maybe be a function call or accessing a proeprty/member variable. Regards, Ryan Joseph ___ fpc-pascal

Re: [fpc-pascal] fcl-passrc errors

2019-10-13 Thread Ryan Joseph
n(TPasElement(element).Name, ‘’, TPasElement(element).DoSomething); end; Regards, Ryan Joseph ___ 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-14 Thread Ryan Joseph
o keep the for-in loops as easy to use as before. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] Generic type conflicts

2019-11-02 Thread Ryan Joseph via fpc-pascal
ended" expected "LongInt" fac:=Sqrt(Sqr(x) + Sqr(y)); if fac<>0.0 then begin // Incompatible types: got "Single" expected "LongInt" fac:=1.0/fac; result.x:=x*fac; result.y:=y*fac; end else begin result.x:=0; result.y:=0; end;

[fpc-pascal] Generic operator overload problem

2019-11-02 Thread Ryan Joseph via fpc-pascal
2; 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 ___

Re: [fpc-pascal] Generic type conflicts

2019-11-02 Thread Ryan Joseph via fpc-pascal
> On Nov 2, 2019, at 11:06 AM, Cyrax via fpc-pascal > wrote: > > You need to do a explicit typecasting. > > ... > fac:=Sqrt(Sqr(TScalar(x)) + Sqr(TScalar(y))); > ... > fac:=1.0/TScalar(fac); Doesn't work. Try running the example. R

[fpc-pascal] Generics in Objective-C mode bug?

2019-11-11 Thread Ryan Joseph via fpc-pascal
"TCocoaObject$1.T" is not supported for interaction with the Objective-C and the blocks runtime. m_obj: T; function obj: T; message 'obj'; end; function TCocoaObject.obj: T; begin result := m_obj; end; begin end. Regards, Ryan Joseph _

Re: [fpc-pascal] Generic operator overload problem

2019-11-09 Thread Ryan Joseph via fpc-pascal
at, thanks. https://bugs.freepascal.org/view.php?id=36285 Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Generic type conflicts

2019-11-09 Thread Ryan Joseph via fpc-pascal
} This is what I hinted in my post. Has anything like this been considered before? It seems necessary to me but it looks like Sven had some fancy work around using pointers. Either way the compile time directive would be faster and avoid the conditional statements

[fpc-pascal] Add API to official documentation search

2019-11-17 Thread Ryan Joseph via fpc-pascal
with 3rd party IDE's. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Add API to official documentation search

2019-11-18 Thread Ryan Joseph via fpc-pascal
results but all I have to go on is the "context" which doesn't really tell me what the result is how to filter it. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Generics in Objective-C mode bug?

2019-11-11 Thread Ryan Joseph via fpc-pascal
ut of the ordinary so why does it matter if it's generic or not? Maybe Jonas has a reason I don't know about. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Add API to official documentation search

2019-11-18 Thread Ryan Joseph via fpc-pascal
ge arrays or collections of strings" and also at the top-right: Reference for unit "classes". There is even a "Description" section which is pretty good to know. Can you not get those back from the search results? Sorry if it's obvious but I don'

[fpc-pascal] cvar external symbol name

2019-11-21 Thread Ryan Joseph via fpc-pascal
Do cvars not allow external symbol names like functions do? With function I can declare a name but for cvar I'm getting an error. PyBaseString_Type:PPyTypeObject; cvar; external name 'somename'; Regards, Ryan Joseph ___ fpc-pascal maillist

Re: [fpc-pascal] get_caller_frame

2019-11-21 Thread Ryan Joseph via fpc-pascal
exception handling to have the > exception appear to be raised somewhere else. So what's missing then to be able make saving a stack frame to the heap and then restoring it? Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists

Re: [fpc-pascal] cvar external symbol name

2019-11-21 Thread Ryan Joseph via fpc-pascal
> rejected. Thanks I see now. Btw just because I have your attention I made a bug report (https://bugs.freepascal.org/view.php?id=36333) that's ObjC related in case you didn't see it. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pasca

[fpc-pascal] Static linking to C library on Linux

2019-11-27 Thread Ryan Joseph via fpc-pascal
functions like "memcpy" would be present also. I used to same make command I did on Mac to build the library but maybe I did something wrong on Linux. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal

Re: [fpc-pascal] Static linking to C library on Linux

2019-11-27 Thread Ryan Joseph via fpc-pascal
o this for static libraries on Linux? I'm getting defined references for math functions like pow, cos etc.. and some pthread ones also. There's probably more but how can I know? Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal

Re: [fpc-pascal] Two possible generics bugs

2019-11-29 Thread Ryan Joseph via fpc-pascal
gt; b := CopyList(a) as TNodeObjectList; > end. > > Can't tell right now from looking at it. Will need to test that later on. > Anyone else have any idea? Doesn't make any sense to me. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Static linking to C library on Linux

2019-11-27 Thread Ryan Joseph via fpc-pascal
only 5MB so I presume there were duplicate symbols that were ignored. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] Static linking to C library on Windows

2019-11-27 Thread Ryan Joseph via fpc-pascal
Error: Invalid DLL XXX/python37.lib, Dos header invalid". I see the compiler found the library but I may not have made the library correctly. How can I know if this .lib is what I think it is? Regards, Ryan Joseph ___ fpc-pascal maillist -

Re: [fpc-pascal] Two possible generics bugs

2019-12-01 Thread Ryan Joseph via fpc-pascal
quot;) which must be enabled by default in > all modes except the Delphi ones. So to get Delphi mode style generics in ObjFPC mode you need to disable the modeswitch? That's kind of backwards from what mode switches usually do but it makes sense. How do you even disable a mode switch?

Re: [fpc-pascal] Two possible generics bugs

2019-12-01 Thread Ryan Joseph via fpc-pascal
that's low hanging fruit. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Two possible generics bugs

2019-12-01 Thread Ryan Joseph via fpc-pascal
> end. > > === code end === Found yet another internal compiler error trying your code: https://bugs.freepascal.org/view.php?id=36388 The previous day was another internal compiler error with inline functions in case you missed it. ;) https://bugs.freepascal.org/view.php?id=36381 Regard

[fpc-pascal] Confusing crash in System.WaitFree

2019-12-02 Thread Ryan Joseph via fpc-pascal
S$PMEMCHUNK_VAR$$QWORD + 42 frame #2: 0x000100020fdd Syndicate`SYSTEM_$$_SYSFREEMEM$POINTER$$QWORD + 109 frame #3: 0x00010001fe6f Syndicate`SYSTEM_$$_FREEMEM$POINTER$$QWORD + 15 Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-

[fpc-pascal] Pre-allocated TFPGList or similar

2019-11-23 Thread Ryan Joseph via fpc-pascal
g any list type in the RTL? Actually I'd rather just disable all the out of bounds errors because I need some performant which isn't making more checks than need be. I want to use a heap-based list because the it may need to grow later. Thanks guys. Regards, R

Re: [fpc-pascal] How to translate C macros which use stringification?

2019-11-23 Thread Ryan Joseph via fpc-pascal
uld be wrong. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Two possible generics bugs

2019-11-28 Thread Ryan Joseph via fpc-pascal
rfacedObjectList; function CopyList (source: TFPSList): TFPSList; begin result := TFPSList(source.ClassType.Create); result.Assign(source); end; var a, b: TNodeObjectList; begin a := TNodeObjectList.Create; // EListError: Incompatible item size in source list

[fpc-pascal] get_caller_frame

2019-11-19 Thread Ryan Joseph via fpc-pascal
behaviors to pascal and so I was wondering if we could copy/restore the current stack pointer so that SetJmp and LongJmp would not blow things up. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https

Re: [fpc-pascal] get_caller_frame

2019-11-20 Thread Ryan Joseph via fpc-pascal
opy the stack with the pointer and restore it later. Is that not how it works? Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Add API to official documentation search

2019-11-20 Thread Ryan Joseph via fpc-pascal
messing things up. For example: https://docs.getlazarus.org/?method=codesearch=xml=List notice all the tags that are breaking up the titles. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.o

[fpc-pascal] Two possible generics bugs

2019-11-28 Thread Ryan Joseph via fpc-pascal
r expected // Internal error 2019112401 generic function CopyList(source: specialize FGL.TFPGObjectList): specialize FGL.TFPGObjectList; begin end; begin end. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal

Re: [fpc-pascal] Pre-allocated TFPGList or similar

2019-11-24 Thread Ryan Joseph via fpc-pascal
code begin === > > list := TList.Create; > list.Count := 10; > list[5] := someItem; I was trying that but with capacity and not count. Thanks. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepas

[fpc-pascal] Variant part in objects?

2019-11-24 Thread Ryan Joseph via fpc-pascal
ors" to objects but I was curious about the variant records because it appears to be the only other thing from records that aren't in objects. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.fr

Re: [fpc-pascal] Interface delegates and the implements property specifier

2019-12-21 Thread Ryan Joseph via fpc-pascal
out but this makes no sense whatsoever to me. If the compiler team agrees I will personally make a mode switch or whatever is permitted to accomplish this. :) Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://

Re: [fpc-pascal] Interface delegates and the implements property specifier

2019-12-22 Thread Ryan Joseph via fpc-pascal
ke sense? Maybe what I mean to say is that there's a need for a delegation syntax that functions like multiple inheritance and avoids the traps of deeply nested single inheritance hierarchies. Does anyone else agree? Regards, Ryan Joseph ___

[fpc-pascal] Property write access on records

2020-03-01 Thread Ryan Joseph via fpc-pascal
: TVec2i; function GetTableSize: TVec2i; property TableSize: TVec2i read GetTableSize; end; var sheet: TSheet; begin // why isn't this an error? sheet.x := 1; end; Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal

[fpc-pascal] Passing static arrays to open arrays

2020-03-04 Thread Ryan Joseph via fpc-pascal
edure Test(input: array of pointer); begin end; var list: array[0..10] of NSArray; p: pointer; begin // no problem! p := list[0]; // Incompatible type for arg no. 1: Got "Array[0..10] Of NSArray", expected "{Open} Array Of Pointer" Test(list); end.

Re: [fpc-pascal] Property write access on records

2020-03-04 Thread Ryan Joseph via fpc-pascal
e property is read only? It's basically a no-op like it is now and defeats the purpose of read-only properties. It also creates a nasty bug because the programmer thinks they've written to something but they actually didn't. Can we consider changing this behavior? Regards, R

[fpc-pascal] Objective-C mode switch overrides open arrays?

2020-03-04 Thread Ryan Joseph via fpc-pascal
// Incompatible types: got "{Open} Array Of NSObject" expected "NSFastEnumerationProtocol" for obj in input do ; end; begin end. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.fr

[fpc-pascal] Cannot find system type "__m64"

2020-03-05 Thread Ryan Joseph via fpc-pascal
something? Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Property write access on records

2020-03-05 Thread Ryan Joseph via fpc-pascal
> On Mar 5, 2020, at 2:24 PM, Ryan Joseph wrote: > > Can we consider changing this behavior? from https://lists.freepascal.org/pipermail/fpc-pascal/2020-March/057434.html On 05/03/2020 08:24, Ryan Joseph via fpc-pascal wrote: > Yes, it's a temporary variable but doesn't i

Re: [fpc-pascal] Cannot find system type "__m64"

2020-03-06 Thread Ryan Joseph via fpc-pascal
o or so but I guess it's still using RTL units from the trunk (the trunk, 3.3.1 is from SVN). I'll try to clean and rebuild the actual trunk and see if that helps. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http

[fpc-pascal] Interface type error

2020-02-01 Thread Ryan Joseph via fpc-pascal
; type TClassName = class(IClassName2) end; procedure Pass(int: IClassName1); begin end; var c: TClassName; begin // Incompatible type for arg no. 1: Got "TClassName", expected "IClassName1" Pass(c); end. Regards,

Re: [fpc-pascal] Interface type error

2020-02-02 Thread Ryan Joseph via fpc-pascal
you want this you need to first > cast the class to IClassName2, then the "interface inheritance" mechanism can > take over. > Hmm, isn't that inconsistent given how classes work? if TClassName implements IClassName2 then doesn't it also implement IClassName1 by defi

Re: [fpc-pascal] Delphi generics bug?

2020-01-14 Thread Ryan Joseph via fpc-pascal
> On Jan 14, 2020, at 11:44 PM, Sven Barth via fpc-pascal > wrote: > > Indeed. And yes, please file a bug. > https://bugs.freepascal.org/view.php?id=36584 Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists

[fpc-pascal] Delphi generics bug?

2020-01-14 Thread Ryan Joseph via fpc-pascal
Is this a bug or intended behavior? I would think there should a type mismatch. {$mode delphi} program test; type TFooA = class end; type TFooB = class end; type TList = class procedure Foo; end; procedure TList.Foo; begin end; begin end. Regards, Ryan Joseph

Re: [fpc-pascal] Delphi generics bug?

2020-01-14 Thread Ryan Joseph via fpc-pascal
fix will probably encompass both of them. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] Calling function pointer to main program

2020-01-02 Thread Ryan Joseph via fpc-pascal
I need to override the main program function and then call back the main program later. I know I can use -XM to set another function name besides "main" but then how do I call back the original function "main" later? Regards,

Re: [fpc-pascal] Calling function pointer to main program

2020-01-02 Thread Ryan Joseph via fpc-pascal
barely understand the problem myself. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Calling function pointer to main program

2020-01-03 Thread Ryan Joseph via fpc-pascal
begin writeln('called user main'); end. The linker error I can't get past: Undefined symbols for architecture x86_64: "_main", referenced from: start in crt1.10.5.o (maybe you meant: _user_main) Regards, Ryan Joseph ___

Re: [fpc-pascal] Calling function pointer to main program

2020-01-03 Thread Ryan Joseph via fpc-pascal
> On Jan 2, 2020, at 2:57 PM, Ryan Joseph wrote: > > extern C_LINKAGE int SDL_main(int argc, char *argv[]); > > which they call from within the iOS event loop and that calls the programs > main functions which was defined using -XMSDL_main I still can't figure out how -XM

Re: [fpc-pascal] Calling function pointer to main program

2020-01-03 Thread Ryan Joseph via fpc-pascal
> On Jan 3, 2020, at 12:29 PM, Jonas Maebe wrote: > > So add 'cdecl; public;" to its declaration and definition. Nice the demo program compiles now. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepa

Re: [fpc-pascal] Interface delegates and the implements property specifier

2019-12-23 Thread Ryan Joseph via fpc-pascal
> On Dec 23, 2019, at 7:57 PM, Ryan Joseph wrote: > > I never heard of "mixin" before but I'll study the wiki. > > I assume that the compiler team has decided multiple inheritance is a bad > idea correct? Personally I don't have enough experience to know

Re: [fpc-pascal] Interface delegates and the implements property specifier

2019-12-23 Thread Ryan Joseph via fpc-pascal
common namespace. I'm happy with any way to achieve that. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Interface delegates and the implements property specifier

2019-12-26 Thread Ryan Joseph via fpc-pascal
ride; end; // TBase.TBrain_DoStuff is synthesized from TBrain.DoStuff // and renamed to prevent name collisions procedure TBase.TBrain_DoStuff; begin writeln('do something'); end; procedure TBase.DoStuff; begin // inherited calls TBase.TBrain_DoStuff inherited; writeln('do more stuff'); end;

Re: [fpc-pascal] Interface delegates and the implements property specifier

2019-12-27 Thread Ryan Joseph via fpc-pascal
e implemented the same as inheritance and this would basically just make them a different syntax for multiple inheritance. I don't think that's what Sven had it mind and if he did why not just do proper multiple inheritance using the existing syntax that interfaces uses? Regards, Ryan Jo

Re: [fpc-pascal] Interface delegates and the implements property specifier

2019-12-27 Thread Ryan Joseph via fpc-pascal
procedure Fight; end; type TPhysics = record x, y, z: float; procedure Apply; end; type TPerson = class physics: TPhysics; brain: TBrain; end; var p: TPerson; begin p.brain.DoThis; p.physics.x += 1; end. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] Error format changes between compilers

2019-12-30 Thread Ryan Joseph via fpc-pascal
hExamples/test.pas:4: error: 2: Syntax error, "BEGIN" expected but "identifier F" found error: Compilation aborted Ryans-MacBook-Pro-2:output ryanjoseph$ Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepas

[fpc-pascal] -WP compiler macro?

2020-01-06 Thread Ryan Joseph via fpc-pascal
Is there a compiler macro which is set to the value of -WP? It would be useful to know which SDK I'm targeted while compiling so I can omit certain code at compile time. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal

Re: [fpc-pascal] Interface delegates and the implements property specifier

2019-12-27 Thread Ryan Joseph via fpc-pascal
interfaces! end; type TPerson = class(IBrain, IPhysics) end; begin // calls TPhysicsHelper.Apply via the IPhysics interface in TPerson person.Apply; end. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.

Re: [fpc-pascal] Interface delegates and the implements property specifier

2019-12-27 Thread Ryan Joseph via fpc-pascal
> On Dec 27, 2019, at 10:29 AM, Ryan Joseph wrote: > > It's really just about the namespace and avoiding deeply nested this.that.do > kind of syntax. We could accomplish this using just plain records, no need to > even get involved with the complicated interface sy

Re: [fpc-pascal] modeswitch multihelpers precedence problem

2020-03-10 Thread Ryan Joseph via fpc-pascal
Str(int: integer): string; implementation function TStringHelper.EndsWith(str: string): boolean; begin writeln('EndsWith - umultiplehelpers_precedence1'); end; function IntToStr(int: integer): string; begin writeln('IntToStr - umultiplehelpers_precedence1'); end; end. Reg

Re: [fpc-pascal] modeswitch multihelpers precedence problem

2020-03-10 Thread Ryan Joseph via fpc-pascal
d expect EndsWith to be used from the last unit, that is SysUtils. If you remake the example without SysUtils and define the type helpers in 2 units that both enable multihelpers does it work correctly? Regards, Ryan Joseph ___ fpc-pascal ma

Re: [fpc-pascal] Property write access on records

2020-03-06 Thread Ryan Joseph via fpc-pascal
tPoint: TPoint; property point: TPoint read GetPoint; end; function TThing.GetPoint: TPoint; begin result := m_point; end; var t: TThing; begin // no error! t.point.width := 0; end. Regards, Ryan Joseph ___ fpc-pascal maillis

Re: [fpc-pascal] Property write access on records

2020-03-07 Thread Ryan Joseph via fpc-pascal
> On Mar 7, 2020, at 3:39 PM, Sven Barth wrote: > > Helpers indeed don't help there (pun intended :P). Please report, yes. And > add a reference to the two bug reports I mentioned. > https://bugs.freepascal.org/view.php?id=36768 Regards,

[fpc-pascal] Error format in trunk changed (again)

2020-03-14 Thread Ryan Joseph via fpc-pascal
up myself? GLPT_IPhone.inc:97: error: 20: Identifier idents no member "touchID" Main.pas:88:1: error: Identifier not found "f" Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://list

Re: [fpc-pascal] Error format question

2020-04-11 Thread Ryan Joseph via fpc-pascal
it went away. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

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