Re: [fpc-devel] Pure function Wiki page

2018-07-08 Thread Ryan Joseph
What are the performance benefits? It sounds like this is a proposal for a compiler optimization which we can explicitly opt in to, but what exactly is the optimization? If nothing else I like the idea as a way to enforce a function is not accessing global state. Kind of like const for functio

Re: [fpc-devel] Pure function Wiki page

2018-07-08 Thread Ryan Joseph
sure I could have used that at some point over the years. Regards, Ryan Joseph ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

[fpc-devel] Default record fields

2018-07-08 Thread Ryan Joseph
anyone interested in helping me do this or answering basic questions on the compiler architecture? Regards, Ryan Joseph ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Re: [fpc-devel] Pure function Wiki page

2018-07-09 Thread Ryan Joseph
> On Jul 9, 2018, at 3:25 AM, Sven Barth via fpc-devel > wrote: > > It would allow you to declare constants that use those functions with the > compiler evaluating them at compile time. That’s a double win then. Very good idea this is. Regards,

Re: [fpc-devel] Progress of pure function research

2018-07-17 Thread Ryan Joseph
intend to builda similar system to handle pure > functions. I’ve looked at the FPC sources recently but I still don’t understand the basics. I see lots of TDef,TSym,TSymTable classes. What are those used for? You mentioned nodes and I wonder if that’s w

[fpc-devel] FreeInstance

2018-07-31 Thread Ryan Joseph
Looking at the FPC source now and it appears FreeInstance is a hidden method which is not called from the TObject destructor. Where/how is this method called in the source? I’ve been in the debugger for over an hour and I still can’t find it. Regards, Ryan Joseph

Re: [fpc-devel] FreeInstance

2018-07-31 Thread Ryan Joseph
oes it get invoked then? there must be some node added somewhere but I can’t find it. Regards, Ryan Joseph ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Re: [fpc-devel] FreeInstance

2018-07-31 Thread Ryan Joseph
> On Jul 31, 2018, at 9:56 AM, Ryan Joseph wrote: > > then how does it get invoked then? there must be some node added somewhere > but I can’t find it. I’m still trying to find this with no luck. I suspect there’s a call node added when the compiler detects a destructor was call

Re: [fpc-devel] FreeInstance

2018-08-01 Thread Ryan Joseph
cdef.proctypeoption=potype_destructor) then begin if is_class(current_structdef) then begin srsym:=search_struct_member(current_structdef,'FREEINSTANCE'); Regards, Ryan Joseph ___ fpc-d

Re: [fpc-devel] FreeInstance

2018-08-01 Thread Ryan Joseph
destructor. Thanks guys. Regards, Ryan Joseph ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

[fpc-devel] Adding procedures using nodes

2018-08-02 Thread Ryan Joseph
); begin end; so I could call the procedure with a parameter and have a block node (I think begin/end is a block node) so I could add some statements inside that. I’m having fun learning how the compiler works but it’s pretty complicated without any guidance. Thanks. Regards, Ryan

Re: [fpc-devel] Adding procedures using nodes

2018-08-03 Thread Ryan Joseph
> On Aug 2, 2018, at 2:41 PM, Ryan Joseph wrote: > > So the way FreeInstance is called by adding it within a destructor isn’t > exactly what I needed because it requires a destructor actually be present in > the class. > > The next thing I’d like to try is adding a

[fpc-devel] Default properties

2018-09-07 Thread Ryan Joseph
parameter list and return a found or not found answer? I could start pulling stuff out of do_typecheckpass() but I suspect there’s already a way to do this. Regards, Ryan Joseph ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http

Re: [fpc-devel] Default properties

2018-09-10 Thread Ryan Joseph
e preferred method? p1:=csubscriptnode.create(default_property,p1); { p1 being the load node for “wrapper” } Regards, Ryan Joseph ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Re: [fpc-devel] Default properties

2018-09-10 Thread Ryan Joseph
_EQ: p1:=caddnode.create(equaln,p1,p2); _GT : p1:=caddnode.create(gtn,p1,p2); Regards, Ryan Joseph ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/cgi-bin/ma

Re: [fpc-devel] Default properties

2018-09-18 Thread Ryan Joseph
> On Sep 10, 2018, at 4:23 PM, Ryan Joseph wrote: > > I think I can use tcallcandidates.create_operator to test this but what do I > pass for the call param node? I didn’t get an answer on this but I was able to figure it out for myself, albeit only for arithmetic operators,

Re: [fpc-devel] Type range in generic

2018-12-02 Thread Ryan Joseph
> On Dec 2, 2018, at 4:00 PM, Sven Barth via fpc-devel > wrote: > > Please report as a bug. I don’t get a bug on this in the trunk version I’m using. Maybe it was fixed? Regards, Ryan Joseph ___ fpc-devel maillist

Re: [fpc-devel] Type range in generic

2018-12-02 Thread Ryan Joseph
eric specialize or <> is in the > > class generic x: TObject; > > Can it be shared across all generics of a kind? > > The code density in the cache would be good for all common generics. I don’t get what this is trying to accomplish o

Re: [fpc-devel] LLVM code generator

2018-12-02 Thread Ryan Joseph
e testsuite can be > finished as well. There are still some extra failures that do not happen with > the built-in code generator, but most tests work fine. What does this mean for end users? Do we get better debugging support in LLDB? Regards, Ryan Joseph __

Re: [fpc-devel] x86_64 Optimizer Overhaul

2018-12-06 Thread Ryan Joseph
pecial switches to show compiles times more accurate? Regards, Ryan Joseph ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Re: [fpc-devel] x86_64 Optimizer Overhaul

2018-12-08 Thread Ryan Joseph
ail? > On Dec 9, 2018, at 8:36 AM, Ryan Joseph wrote: > > Couldn’t figure out the patching. I tried a dry run but it doesn’t seem to > find the file. Regards, Ryan Joseph ___ fpc-devel maillist - fpc-devel@lists.free

Re: [fpc-devel] x86_64 Optimizer Overhaul

2018-12-08 Thread Ryan Joseph
ing copy) -- File to patch: > On Dec 9, 2018, at 7:11 AM, J. Gareth Moreton > wrote: > > Had any luck with this? Regards, Ryan Joseph ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal

Re: [fpc-devel] x86_64 Optimizer Overhaul

2018-12-08 Thread Ryan Joseph
Got everything building finally but the time difference is so small I'll need to make a script to compile multiple times and average all the runs. Is it even worth the time doing that? Regards, Ryan Joseph ___ fpc-devel maillist -

Re: [fpc-devel] x86_64 Optimizer Overhaul

2018-12-08 Thread Ryan Joseph
a. Kit The reason is that PPU versions changed so I can’t use the units at the default system locations. Not sure how the compiler decides but it was looking for units at the 3.1.1 install location which is an older PPU version. There should be a single command to specify a top-level direct

Re: [fpc-devel] x86_64 Optimizer Overhaul

2018-12-08 Thread Ryan Joseph
? Regards, Ryan Joseph ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Re: [fpc-devel] x86_64 Optimizer Overhaul

2018-12-08 Thread Ryan Joseph
ng -vs when it got to the linking phase. Regards, Ryan Joseph ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Re: [fpc-devel] x86_64 Optimizer Overhaul

2018-12-11 Thread Ryan Joseph
AM, J. Gareth Moreton > wrote: > > The overhaul primarily increases the speed of compilation, but it makes some > minor improvements to conditional branches here and there. Nevertheless, I'm > always happy to find a saving here and there in the compiled assembly > langua

Re: [fpc-devel] x86_64 Optimizer Overhaul

2018-12-12 Thread Ryan Joseph
rtup and return to the pool instead of freeing. It would make the compiler utilize more memory but that’s a good trade off for me personally. This is especially a good idea because the compiler is a one pass program so leaks over the long term aren’t a problem. Regards,

Re: [fpc-devel] x86_64 Optimizer Overhaul

2018-12-12 Thread Ryan Joseph
hed, at least on a per-block level. That’s a particularly wasteful detail I noticed and there’s probably many more like this. Regards, Ryan Joseph ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/cgi-bin/ma

Re: [fpc-devel] x86_64 Optimizer Overhaul

2018-12-12 Thread Ryan Joseph
> On Dec 12, 2018, at 7:59 PM, Ryan Joseph wrote: > > For example every time you it parses “1 + 1” a large code block is entered Correction, 1+1 doesn’t enter a large code block unless there’s an overload present. Once you add overloads however that’s when a caching solution wou

Re: [fpc-devel] x86_64 Optimizer Overhaul

2018-12-16 Thread Ryan Joseph
C so shouldn’t this be turned off? I may not understand what you mean by exception frame though. Regards, Ryan Joseph ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Re: [fpc-devel] "Blank slate" next version of FPC

2019-02-17 Thread Ryan Joseph
t for him. I’ve been hearing about it almost being done for a few years now and like Ben this is the probably the most needed feature to make our lives easier. As an intermediate measure I was able to make nested functions anonymous but Sven wanted to wait for the real th

Re: [fpc-devel] "Blank slate" next version of FPC

2019-02-24 Thread Ryan Joseph
eNext and GetCurrent! > Here’s this implicit try/finally block on heap allocation thing again. Can someone please explain this? Some months ago someone complained FPC was doing this on all TObject.Create calls. Is that true? Regards, Ryan Joseph ___

Re: [fpc-devel] "Blank slate" next version of FPC

2019-02-24 Thread Ryan Joseph
ure bloat like in other languages). I would suggest we make this a compilers switch that is on by default but can be disabled. Regards, Ryan Joseph ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Re: [fpc-devel] "Blank slate" next version of FPC

2019-02-24 Thread Ryan Joseph
o recompile the system unit with > that switch, since the code for TObject's c How can I test to verify if this works or not? Martin makes it sound like there’s some other considerations for subclasses. Regards, Ryan Joseph ___ fpc-devel

Re: [fpc-devel] "Blank slate" next version of FPC

2019-02-24 Thread Ryan Joseph
ram actually uses exceptions or not. Regards, Ryan Joseph ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Re: [fpc-devel] Getting built-in string type

2019-02-27 Thread Ryan Joseph
Sending this again to see if it gets through (posts getting blocked again). > On Feb 26, 2019, at 2:43 PM, Ryan Joseph wrote: > > In my implicit generic specialization code I have one place where I get a > string const node (stringconstn) which the resultdef is arraydef (not >

Re: [fpc-devel] Getting built-in string type

2019-02-28 Thread Ryan Joseph
); Regards, Ryan Joseph ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Re: [fpc-devel] Getting built-in string type

2019-02-28 Thread Ryan Joseph
rocsym(context.sym).procdeflist.count=0 then internalerror(2015061203); result:=tstoreddef(tprocsym(context.sym).procdefList[0]); end; end; Regards, Ryan Joseph ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Re: [fpc-devel] Getting built-in string type

2019-03-02 Thread Ryan Joseph
question) but that is specific to string constants. For normal function calls this isn’t a problem because the type is always specified but for implicit specializations the type may need to be declared in order for the specialization to be possible. Regards, Ryan Joseph

Re: [fpc-devel] Getting built-in string type

2019-03-10 Thread Ryan Joseph
thinking about this too much. :) So anyways look it over and see if this is acceptable. It does at least work though which is pretty great because it’s a crucial addition for generics imo. https://github.com/genericptr/freepascal/tree/generic_implicit Regards, Ryan Joseph

Re: [fpc-devel] Successful implementation of inline support for pure assembler routines on x86

2019-03-16 Thread Ryan Joseph
ed the patch for constants in generics and uploaded again (https://bugs.freepascal.org/view.php?id=35140). Not sure if they added it yet or they were waiting for my to fix things. Let me know if that patch is in the correct format so I can fix the other one for multi-helpers. Re

Re: [fpc-devel] Successful implementation of inline support forpure assembler routines on x86

2019-03-16 Thread Ryan Joseph
omething along these lines is absolutely sorely lacking in FPC currently, > don't let anyone tell you otherwise. Sounds exciting progress for FPC. Btw what happened to the development of “pure” function modifier that would make it possible to use functions in compile time expressions? I

Re: [fpc-devel] Successful implementation of inline support forpureassembler routines on x86

2019-03-17 Thread Ryan Joseph
g and the "pure" feature are blocked > until the XML debug node dump feature is approved. > That’s too bad. Knowing if a function is “pure” or not seems deceptively simple but what were the big challenges btw? Regards, Ryan Joseph

[fpc-devel] Typed constants

2019-03-17 Thread Ryan Joseph
, Ryan Joseph ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

[fpc-devel] All constant operators

2019-03-18 Thread Ryan Joseph
DoThis(param: integer = I); end; Regards, Ryan Joseph ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Re: [fpc-devel] All constant operators

2019-03-18 Thread Ryan Joseph
> On Mar 18, 2019, at 11:23 AM, Ryan Joseph wrote: > > type > generic TUnaryOp = record >const > d0 = -I; > d1 = +I; > d2 = not I; > end; > > type > generic TBinaryOp = record >const > d0 = I + I; > d1 =

Re: [fpc-devel] Successful implementation of inline support for pure assembler routines on x86

2019-03-20 Thread Ryan Joseph
support for pure functions so that one’s a go for sure. Regards, Ryan Joseph ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

[fpc-devel] Closures repo

2019-03-21 Thread Ryan Joseph
been just sitting there for 3+ years. Hope we can get this resolved sooner than later. https://github.com/maciej-izak/freepascal/tree/closures Regards, Ryan Joseph ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http

Re: [fpc-devel] Closures repo

2019-03-21 Thread Ryan Joseph
rom what I saw in that repo the captures are stored in an interfaced object which has reference counting right? Maybe expand on the lifetime management issues more. Regards, Ryan Joseph ___ fpc-devel maillist - fpc-devel@lists.freepascal.org

Re: [fpc-devel] Closures repo

2019-03-21 Thread Ryan Joseph
> On Mar 21, 2019, at 5:01 PM, Blaise Thorn wrote: > > Thursday, March 21, 2019 11:48 PM +03:00 from Ryan Joseph > : >> Then maybe he’ll hear this and respond. > > I just did. Oh, you’re the author! I recognize the email now. Yes, please tell me what the status is a

[fpc-devel] implicit generic specialization modeswitch name

2019-03-24 Thread Ryan Joseph
types from the parameters. I have no preference either way but I wanted to ask the list if they had any better ideas to contribute. If there’s nothing better I’ll just defer to what Florian wants. Regards, Ryan Joseph ___ fpc-devel maillist

[fpc-devel] Running test suite linker error (mac)

2019-03-24 Thread Ryan Joseph
kunit/units_bs/x86_64-darwin -Fu../rtl/units/x86_64-darwin -Fd -n ld: file not found: /usr/lib/crt1.10.5.o Regards, Ryan Joseph ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Re: [fpc-devel] implicit generic specialization modeswitch name

2019-03-24 Thread Ryan Joseph
es ("+") } Regards, Ryan Joseph ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

[fpc-devel] Aligned dynamic arrays

2019-03-27 Thread Ryan Joseph
array elements start (which is aligned). It would complicit the code to some extent however because the current design relies on lots of pointer math. Is this ok that I add this? Marco said in the comments there was a need so I assume this is a go but I wanted to ask first. Regards, Ryan

Re: [fpc-devel] Aligned dynamic arrays

2019-03-27 Thread Ryan Joseph
> As for extending the array header, maybe introduce a new data type "aligned > array". > So normal arrays do not have that field in there header. The plan was to make a “SetLengthAligned” or add an extra parameter to “SetLength”, i.e, SetLength(arr,100,true).

Re: [fpc-devel] Aligned dynamic arrays

2019-03-28 Thread Ryan Joseph
alignment calls the new one > with alignment 1. > > Note: the compiler can call the new one for both variants, but the old one is > required for bootstrapping, so you could surround that with {$if not > defined(ver3_0) and not defined(ver3_2)}. You mean if the compiler is &

Re: [fpc-devel] Aligned dynamic arrays

2019-03-28 Thread Ryan Joseph
Now I’m using “cd /rtl; make all FPC=/path/to/compiler” to build the RTL but this is obviously slow and unnecessary. Is there a quicker way to build just the unit which contains dynarr.inc and have all the objects files to be put in the correct location? Regards, Ryan Joseph

Re: [fpc-devel] Aligned dynamic arrays

2019-03-29 Thread Ryan Joseph
make variants like InsertAligned() and ignore + operators for aligned arrays Regards, Ryan Joseph ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Re: [fpc-devel] Aligned dynamic arrays / Maybe implement in mem-mgr?

2019-03-29 Thread Ryan Joseph
return an aligned block that had x number of bytes directly before it. No idea if that’s feasible for memory managers. Regards, Ryan Joseph ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Re: [fpc-devel] Aligned dynamic arrays

2019-03-29 Thread Ryan Joseph
ler directive could be used. var {$push} {$dynamic-array-align 4096} a: array of integer; {$pop} begin SetLength(a,10); // just use normal SetLength now Regards, Ryan Joseph ___ fpc-devel maillist - fpc-devel@lists.freepascal.org h

Re: [fpc-devel] Aligned dynamic arrays

2019-03-29 Thread Ryan Joseph
thout pointers. Regards, Ryan Joseph ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Re: [fpc-devel] Aligned dynamic arrays

2019-03-30 Thread Ryan Joseph
k for me. {$push} {$align 16} type TVertex = record pos: TVec2; col: TVec2; end; {$pop} Why not use a similar directive for array alignment? That would solve the problem I discovered with insert/concat. {$push} {$align-array 4096} type TIntArray = array of integer; {$pop} Regards,

Re: [fpc-devel] Aligned dynamic arrays

2019-03-30 Thread Ryan Joseph
t crazy to implement in Pascal. int& getter() { return i; } function getInt: integer; var; begin result := i; end; Regards, Ryan Joseph ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Re: [fpc-devel] Aligned dynamic arrays

2019-03-30 Thread Ryan Joseph
recedent for it (i.e. $align). Can you give some examples of the vector type? I don’t exactly know what you guys are referring to. Regards, Ryan Joseph ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Re: [fpc-devel] Aligned dynamic arrays

2019-03-30 Thread Ryan Joseph
n be okay as well > > That only works in {$mode delphi} Oh that’s why! How does this work in Delphi mode without pointers and why wasn’t it added to ObjFPC mode? That would have saved me some headache in the past if I knew this. Regards, Ryan Joseph __

Re: [fpc-devel] Aligned dynamic arrays

2019-03-30 Thread Ryan Joseph
> On Mar 30, 2019, at 12:53 PM, Mattias Gaertner via fpc-devel > wrote: > > I guess you mean auto dereferencing. > {$ModeSwitch AutoDeref} Yeah I just found this by looking around in the compiler. Mind. Blown. No idea that existed! Regards,

Re: [fpc-devel] Aligned dynamic arrays

2019-03-30 Thread Ryan Joseph
rstand users who like the compiler syntax, which is cleaner and probably faster. So what should I do going forward? Should I abandon the idea or do any of the other core team members want to me pursue this further? {$push} {$dynarrayalign 4096} type

[fpc-devel] class operator overloads

2019-04-16 Thread Ryan Joseph
left; end; Regards, Ryan Joseph ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Re: [fpc-devel] class operator overloads

2019-04-16 Thread Ryan Joseph
o why is this really a problem? It just means the operator needs to mutate the actual class instead of making a copy like for records, but those are the rules anyways. Given that I still don’t understand why "class operator” isn’t included in classes. Regards, Ryan Joseph

Re: [fpc-devel] class operator overloads

2019-04-16 Thread Ryan Joseph
ice so I think most people know how to be safe. What this means is that’s it harder for more advanced programmers to do things like add + and := operator to collection classes like arrays and that’s pretty unfortunate. At this point it’s already been smuggled in via operator fun

Re: [fpc-devel] class operator overloads

2019-04-21 Thread Ryan Joseph
> On Apr 20, 2019, at 9:56 AM, Ryan Joseph wrote: > >> On Apr 16, 2019, at 8:43 PM, Ryan Joseph wrote: >> >> I see why that could be a problem but aren’t users reasonable for not doing >> dangerous things in a language like Pascal with low-level memory access

Re: [fpc-devel] LLVM code generator

2019-04-23 Thread Ryan Joseph
Any new news on the LLVM code generator? I wanted to test this but the old link posted seems to be dead. Is there an updated link and instructions to build? Regards, Ryan Joseph ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http

Re: [fpc-devel] modeswitch multihelpers

2019-05-12 Thread Ryan Joseph
yObject > > very good! > > This feature deserves a bold announcement. Now we are only missing Lazarus > IDE codetools support for it :) > > Again - big thanks. You’re welcome. I’m looking forward to fixing up some old code myself. :) Regards, Ryan Joseph ___

Re: [fpc-devel] modeswitch multihelpers

2019-05-13 Thread Ryan Joseph
end; procedure THelper2.DoThis(msg: string); begin writeln('DoThis:', msg); end; var obj: TObject; begin obj := TObject.Create; obj.DoThis; // < ERROR: Wrong number of parameters specified for call to "DoThis" end. Regards, Ryan Joseph __

[fpc-devel] Closures/anonymous functions update

2019-05-18 Thread Ryan Joseph
ite, tests that need to successfully run, merely successfully compile or even need to fail to compile (look at the files in tests/test/ to see what I mean). } Regards, Ryan Joseph ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Re: [fpc-devel] Closures/anonymous functions update

2019-05-18 Thread Ryan Joseph
> On May 18, 2019, at 11:41 AM, Blaise Thorn wrote: > > Saturday, May 18, 2019 8:32 PM +03:00 from Ryan Joseph > : >> After 2 months now I’ve not been able to get the required sources to help >> finish the closures branch. >> The author Blaise did manage to

Re: [fpc-devel] "Case statement does not handle all possible cases" Warning

2019-05-18 Thread Ryan Joseph
s just > "lazy programming", like it or not... > > Ralf Then should all if statements have an else? Should constructors give warnings if you don’t initialize all fields? It’s a slippery slope. Regards, Ryan Joseph __

[fpc-devel] Constants in generics patch

2019-05-20 Thread Ryan Joseph
it all tested and it’s fully functional now (another user has been tested it also as you’ll see in the notes). Regards, Ryan Joseph ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo

[fpc-devel] Object upgrades

2019-05-23 Thread Ryan Joseph
TMyObject.Destroy; begin end; var o: TMyObjectPtr; begin // new(o, Create); o := TMyObject.Create; // what to do here??? o^.destroy; // implicit free method? o^.free; end. Regards, Ryan Joseph ___ fpc-devel maillist - fpc-devel

[fpc-devel] Class management operators

2019-05-24 Thread Ryan Joseph
to support classes also. I already spent a good amount of time working on “default properties” but that was done in leu of the fact that only records support management operators. Regards, Ryan Joseph ___ fpc-devel maillist - fpc-devel

Re: [fpc-devel] Class management operators

2019-05-24 Thread Ryan Joseph
ult properties. Regards, Ryan Joseph ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Re: [fpc-devel] Class management operators

2019-05-24 Thread Ryan Joseph
to a TNotifyEvent or store it in a > TStringList's Objects property. Isn’t this what fully ARC languages like Swift do though? I would think this would be an interesting option to at least be available for particular use cases. Regards, Ryan Joseph ___

Re: [fpc-devel] Class management operators

2019-05-25 Thread Ryan Joseph
work? I was thinking enabling management operators for classes would have basically the same performance impact as those compiler types (which is actual ARC in Pascal unless I misunderstand). Regards, Ryan Joseph ___ fpc-devel ma

Re: [fpc-devel] Class management operators

2019-05-26 Thread Ryan Joseph
routes to variety of different functions based on the type and could simply be extended like it was for records. I liked the idea of management operators for classes because users can opt in for classes that aren’t doing performance critical stuff. Regards, Ryan Joseph _

Re: [fpc-devel] Object upgrades

2019-05-26 Thread Ryan Joseph
got blocked } I thought FPC was trying to keep them alive? Objects are still the only way to do inheritance for records but they lack operator overloads. The syntax for new/dispose certainly feels legacy but that’s not as important as the class operato

Re: [fpc-devel] Object upgrades

2019-05-26 Thread Ryan Joseph
ads it’s not possible. Also, since we’re not getting ARC classes it looks like, management operators for objects would make it possible to use a base class for “boxing” managed classes. Regards, Ryan Joseph ___ fpc-devel maillist - fpc-devel

Re: [fpc-devel] Object upgrades

2019-05-26 Thread Ryan Joseph
the same also). Operator overloads simply aren’t enabled for objects because apparently they’re a legacy syntax but as you pointed out they’re still useful. Being able to use subclassing for TVec2 -> TVec3 -> TVec4 objects would be really useful. I hope the compiler

Re: [fpc-devel] Closures/anonymous functions update

2019-05-26 Thread Ryan Joseph
worked remarkably well (nested proc vars already do all the work required but they used records for the backing store). Regards, Ryan Joseph ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Re: [fpc-devel] When will the next version of FPC be released?

2019-05-31 Thread Ryan Joseph
> On May 30, 2019, at 4:18 PM, Ryan Joseph wrote: > > I didn’t realize generic functions were in the trunk. I’m not sure I got this > implemented properly so it requires some code review but can we try to > include “implicitfunctionspecialization” mode switch in the next relea

Re: [fpc-devel] When will the next version of FPC be released?

2019-06-01 Thread Ryan Joseph
7;,msg.ClassName); end; generic procedure DoThis(msg: T); begin writeln('DoThis:',msg.ClassName); end; begin DoThis(TMyClass.Create); DoThis(TObject.Create); end. Regards, Ryan Joseph ___ fpc-devel maillist - fpc-devel@list

Re: [fpc-devel] When will the next version of FPC be released?

2019-06-02 Thread Ryan Joseph
n end; Regards, Ryan Joseph ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Re: [fpc-devel] When will the next version of FPC be released?

2019-06-02 Thread Ryan Joseph
> On Jun 2, 2019, at 4:36 PM, Sven Barth via fpc-devel > wrote: > > Am 02.06.2019 um 16:39 schrieb Ryan Joseph: >> I just tried to declare these 2 procedures in 3.3.1 and got an error. You >> can declare them in the reverse order with no problem. A bug? >> >

Re: [fpc-devel] Thoughts on being able to declare "pointer-to-type" parameters directly in method signatures?

2019-06-07 Thread Ryan Joseph
es (which are just as "inline", I'd say) work > just fine. > I don’t get this either. It feels to me like ^ is a modifier more than an actual new type. That’s just me feeling though as a long time Pascal programmer. Regards, Ryan Joseph ___

[fpc-devel] Postfix operator overload or default properties

2019-06-07 Thread Ryan Joseph
nagement operators … class operator postfix: T; end; class operator TAuto.postfix: T; begin result := m_obj; end; var a: TAuto; begin writeln(a.ClassName); // a.m_obj.ClassName Regards, Ryan Joseph ___ fpc-devel maillist - f

Re: [fpc-devel] Thoughts on being able to declare "pointer-to-type" parameters directly in method signatures?

2019-06-07 Thread Ryan Joseph
dition to type declarations though because it makes it more clear what they are. Regards, Ryan Joseph ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Re: [fpc-devel] Thoughts on being able to declare "pointer-to-type" parameters directly in method signatures?

2019-06-07 Thread Ryan Joseph
d be an exception to the rule? Regards, Ryan Joseph ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Re: [fpc-devel] Postfix operator overload or default properties

2019-06-07 Thread Ryan Joseph
> On Jun 7, 2019, at 4:47 PM, Sven Barth via fpc-devel > wrote: > > Am 07.06.2019 um 22:41 schrieb Ryan Joseph: >> Does that make sense? I’d like to scratch the idea of default properties and >> do this instead if it was permitted. > No. FPC is not going down tha

Re: [fpc-devel] Thoughts on being able to declare "pointer-to-type" parameters directly in method signatures?

2019-06-07 Thread Ryan Joseph
kinds of expressions containing specializations that mode ObjFPC > supports. Then maybe it could be optional within type declarations? Delphi mode achieves this so I think ObjFPC could also. Yet another modeswitch like “autoderef”? :) Regards, Ryan Joseph _

Re: [fpc-devel] Postfix operator overload or default properties

2019-06-07 Thread Ryan Joseph
en ; end. = All the postfix operator allows is “.” access. That’s like 90% less intrusion into the compiler. Much smaller can of worms. Sorry C++ had the smarter idea here. Limit the access to “.” and if the user wants assignments or equality etc… they overload other operators. Plea

  1   2   3   4   >