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

2018-12-19 Thread Ryan Joseph
n’t understand how they function in the language. They would need to manage stack states and push/restore stacks, which is something a library can’t do right? Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.f

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

2018-12-19 Thread Ryan Joseph
> On Dec 19, 2018, at 6:35 PM, Ryan Joseph wrote: > > How does that work? I’ve been interested in coroutines for a while now but I > don’t understand how they function in the language. They would need to manage > stack states and push/restore stacks, which is something a l

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

2018-12-19 Thread Ryan Joseph
generator so I don’t know how the stack works. However, in theory you should be able to make a compiler intrinsic that wraps this process for you. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.fre

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

2018-12-19 Thread Ryan Joseph
are of it. It sounds like a sound theory but I don’t have the expertise to do the assembly involved for saving/restoring the stack. I think the RTL would need some extra functions to pair with SetJmp/LongJmp but if someone could provide those I’d be

Re: [fpc-pascal] SetLength warnings - request

2019-01-01 Thread Ryan Joseph
on. I was going to say. Hasn’t it been discussed to at least make a compiler switch that initializes all variables? For non-realtime programs the performance penalty is irrelevant. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-p

Re: [fpc-pascal] Constants in generics

2019-01-02 Thread Ryan Joseph
; > end; This is the syntax we’ve settled on. type generic TList = record list: array[0..U-1] of T; function capacity: integer; end; Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pa

Re: [fpc-pascal] Constants in generics

2019-01-02 Thread Ryan Joseph
MyRecord_Int; b: specialize TMyRecord_String; c: specialize TMyRecord_Float; d: specialize TMyRecord_Set; e: specialize TMyRecord_Nil; f: specialize TMyRecord_Byte; g: specialize TMyRecord_Undefined; begin end. Regards, Ryan Joseph

Re: [fpc-pascal] Constants in generics

2019-01-02 Thread Ryan Joseph
onstrained. This was the normal behavior before constants were introduced. generic TMyRecord1 = record Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Constants in generics

2019-01-03 Thread Ryan Joseph
ferent types and following the same logic should be separated with a semicolon. That means the parser only knows if a ; is required after the const keyword is found. Does that matter? Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pasca

Re: [fpc-pascal] Constants in generics

2019-01-03 Thread Ryan Joseph
places where types were used. Sorry but there’s just not enough time for me to dive into that right now so that will have to wait. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Constants in generics

2019-01-04 Thread Ryan Joseph
ntext. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Constants in generics

2019-01-05 Thread Ryan Joseph
can > then put your const implementation on top of that. > Last night I just went for it and pulled out the defs which was smoother than I thought. It seems to work out but I need to test more I think. Regards, Ryan Joseph ___ fp

Re: [fpc-pascal] Constants in generics

2019-01-05 Thread Ryan Joseph
Given the new syntax requirements we talked about there needs to be a ; after T now. What error should be used if there isn’t a ; semicolon separator between types and consts? I just used a parser_e_illegal_expression for now. generic TStuff = record Regards, Ryan Joseph

Re: [fpc-pascal] Constants in generics

2019-01-05 Thread Ryan Joseph
ff0 = record end; generic TStuff1 = record end; generic TStuff2 = record end; generic TStuff3 = record end; Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-

Re: [fpc-pascal] Constants in generics

2019-01-06 Thread Ryan Joseph
ator is used? A more clear example is: . It would make more sense to say of course but it could appear the other way. Maybe I’m not understand you though. For now I just required all const lists separated with ; since that was your first suggestions, i.e. Regards,

Re: [fpc-pascal] Constants in generics

2019-01-06 Thread Ryan Joseph
hr(i) else enumname:=tostr(i); end else enumname:=tostr(i); if length(prettyname) > 1 then prettyname:=prettyname+','+enumname else prettyname:=prettyname+enumname; end; prettyname:=prettyname+&#

Re: [fpc-pascal] Constants in generics

2019-01-06 Thread Ryan Joseph
> On Jan 6, 2019, at 1:31 PM, Ben Grasset wrote: > > generic TStaticList = record > This is exactly the reason I added the feature, there’s no way to extend static arrays otherwise! Beyond this one thing I have no idea what to use them for. ;) Regards,

Re: [fpc-pascal] Constants in generics

2019-01-06 Thread Ryan Joseph
, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Constants in generics

2019-01-06 Thread Ryan Joseph
I updated the github with the requested changes. Is that everything? I’ll submit a patch if so. https://github.com/genericptr/freepascal/tree/generic_constants Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org

Re: [fpc-pascal] Constants in generics

2019-01-07 Thread Ryan Joseph
o. I’ve got a few tests I’ll post next to make sure they cover everything. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Constants in generics

2019-01-08 Thread Ryan Joseph
param2.low,param2.high,orddef2); result:=compare_defs(orddef1,orddef2,nothingn)>=te_convert_l1; end; Is there an existing function for this or a better way to do it? Regards, Ryan Joseph ___ fpc-pascal maillist - f

Re: [fpc-pascal] Constants in generics

2019-01-08 Thread Ryan Joseph
ers). This means another def needs to be added to the PPU write/read system though. 3) Be lazy and don’t do range checking. :) Any idea about this? Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org h

Re: [fpc-pascal] Constants in generics

2019-01-09 Thread Ryan Joseph
ics. That would be the easiest and laziest thing to do but it would mean this would compile: type generic TList = record list: array[0..0-1] of integer; end; Regards, Ryan Joseph ___ fpc-pascal maillist - f

[fpc-pascal] Constants in generics tests

2019-02-15 Thread Ryan Joseph
generic TByte = record end; var a: specialize TByte<300>; begin end. This will now give an error because 300 is a SmallInt. That’s everything I can think of for now. Please let me know if this is ready to submit yet. Regards, Ryan

Re: [fpc-pascal] Constants in generics tests

2019-02-15 Thread Ryan Joseph
e” section (Private const "TTest$1.U" never used). That needs to be fixed also. Sven or some other compiler guy, do you know how to silence that warning? > On Feb 15, 2019, at 1:52 PM, Jeppe Johansen wrote: > > Hi, > > Do you know why this

Re: [fpc-pascal] Constants in generics tests

2019-02-15 Thread Ryan Joseph
> On Feb 15, 2019, at 2:11 PM, Ryan Joseph wrote: > > Also I just noticed that I’m getting warnings from the “U” constant which is > declared in the “strict private” section (Private const "TTest$1.U" never > used). That needs to be fixed also. Sven or some other com

Re: [fpc-pascal] Constants in generics tests

2019-02-15 Thread Ryan Joseph
> On Feb 15, 2019, at 2:11 PM, Ryan Joseph wrote: > > Something with class functions in particular. Very strange it can’t find the > declaration. So never mind about submitting, I need to fix this now. :) I just looked over this and indeed I have no idea idea what happene

[fpc-pascal] building compiler failed

2019-02-15 Thread Ryan Joseph
ch file or directory /Developer/Scripts/ppc386.command: line 12: /usr/local/lib/fpc//ppc386: No such file or directory Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/li

Re: [fpc-pascal] Constants in generics tests

2019-02-15 Thread Ryan Joseph
eally good catch Sven. tstoreddef.is_specialization is not returning true for generics with const params so the procedure body is not getting created. Not sure how to resolve it yet but at least I know where it is. Thanks. Regards, Ryan Joseph ___ fpc-pa

Re: [fpc-pascal] Constants in generics tests

2019-02-16 Thread Ryan Joseph
ment the counter. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Constants in generics tests

2019-02-16 Thread Ryan Joseph
ictypelist.count-1 do begin ttypesym(generictypelist[i]).register_sym; tstoreddef(ttypesym(generictypelist[i]).typedef).register_def; end; Regards, Ryan Joseph ___ fpc-pascal ma

Re: [fpc-pascal] Constants in generics tests

2019-02-16 Thread Ryan Joseph
into the tests which all run now but I’m not sure if I did them correctly. Anyone please let me know if those are correct/complete. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-

[fpc-pascal] blocked on fpc-devel

2019-02-17 Thread Ryan Joseph
I’ve noticed the last few days that my messages aren’t getting through to the fpc-devel list. Can one of the admins check to see if I was blocked or something? Sorry to post here but I didn’t know where else to ask. Thanks. Regards, Ryan Joseph

Re: [fpc-pascal] blocked on fpc-devel

2019-02-17 Thread Ryan Joseph
ssage to see if that helps. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Constants in generics tests

2019-02-24 Thread Ryan Joseph
report. https://bugs.freepascal.org/view.php?id=35140 https://github.com/genericptr/freepascal/tree/generic_constants Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman

[fpc-pascal] Class helper properties

2019-02-24 Thread Ryan Joseph
TMyObject property num2: integer read m_num; // ERROR: Unknown class field or method identifier "m_num" end; begin end. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepasca

[fpc-pascal] Multi helpers

2019-02-25 Thread Ryan Joseph
of (included now) but I wonder if I messed up any subtle order of precedence. If anyone wants to test or has any ideas for more tests to include please let me know. https://github.com/genericptr/freepascal/tree/helperscope Regards, Ryan Joseph

Re: [fpc-pascal] Multi helpers

2019-02-25 Thread Ryan Joseph
eclared, it now checks from the last helper to the first. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Multi helpers

2019-02-25 Thread Ryan Joseph
Question, is this mode switch allowed in Delphi mode? I disabled it because I had a comment that said it was ObjFPC mode only but that doesn’t make sense it couldn’t be enabled manually even in Delphi mode. Regards, Ryan Joseph ___ fpc-pascal

Re: [fpc-pascal] Multi helpers

2019-02-25 Thread Ryan Joseph
> On Feb 25, 2019, at 1:12 PM, Mattias Gaertner via fpc-pascal > wrote: > > Since $modeswitch typehelpers is allowed in mode delphi, it would be > inconsistent to forbid it. Good point, I didn’t know that. I’ve correct this on GitHub. Regards,

Re: [fpc-pascal] Multi helpers

2019-02-25 Thread Ryan Joseph
iff which works well but there doesn’t seem to be a way to choose the directory it starts from. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Multi helpers

2019-02-27 Thread Ryan Joseph
posts getting blocked again, just sending this to see if it gets through. > On Feb 26, 2019, at 9:10 AM, Ryan Joseph wrote: > > > >> On Feb 26, 2019, at 7:05 AM, Graeme Geldenhuys >> wrote: >> >> Rather do as always recommended... develop in a "feat

Re: [fpc-pascal] Multi helpers

2019-02-28 Thread Ryan Joseph
” but I have no idea what the terminal wants me to do. I can’t even cancel or anything, just beeping at me. As for the intention, again I couldn’t figure out what git was seeing. Maybe if I squish the commits into one they’ll go away. Regards, Ryan Joseph ___

[fpc-pascal] include bug?

2019-04-09 Thread Ryan Joseph
{$i include/darwin/pthread.inc} {$i include/darwin/errno.inc} {$i include/foo.inc} <— the compiler ISN'T detecting changes in this file (one directory above) Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepasc

[fpc-pascal] Helper/function overloads

2019-04-10 Thread Ryan Joseph
THelper.DoThis; begin DoThis('string'); // <——— ERROR: Wrong number of parameters specified for call to "DoThis" end; begin end. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists

[fpc-pascal] mode switch madness

2019-04-12 Thread Ryan Joseph
} {$modeswitch-all implicitfunctionspecialization} ... Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] mode switch madness

2019-04-12 Thread Ryan Joseph
ave distribute extra files that contain command line arguments. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] Optional param modifier

2019-04-12 Thread Ryan Joseph
begin writeln(‘new object:’, obj.ClassName); DoThis(obj); FreeThis(obj); // "obj" is "optional var" so we get a compiler error unless we check for assigned writeln(obj.ClassName); end; end. Regards, Ryan Joseph __

Re: [fpc-pascal] Optional param modifier

2019-04-12 Thread Ryan Joseph
DoThis(const p: PMyRecord); begin p.x := 10; end; Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Optional param modifier

2019-04-12 Thread Ryan Joseph
ccept nil?) Using var and pointers to pointers are possible workarounds but they’re not really expressing what we mean so it seemed logical to add this to the list of parameter modifiers already existing. Regards, Ryan Joseph ___ fpc-pasc

Re: [fpc-pascal] Optional param modifier

2019-04-13 Thread Ryan Joseph
* _Nullablesender); So how is this not a common occurrence that deserves a solution? Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Optional param modifier

2019-04-13 Thread Ryan Joseph
about it more to know if this is a real problem I’ve ever experienced. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Optional param modifier

2019-04-13 Thread Ryan Joseph
or cases where nil could be passed/returned and the programmer can be given more information and forced to check since this is the pattern they were supposed to do anyways. It’s not a magic catch-all, just a minor markup thing like “const” is. Regards, Ryan Joseph

Re: [fpc-pascal] Optional param modifier

2019-04-13 Thread Ryan Joseph
a minor subset of cases. Btw, they added the macros into the Objective-C headers so the Swift parser could correctly interpret them as optional types (denoted with the ? symbol if you’re familiar with Swift). Anyways, not a single person thought this was a good idea so

Re: [fpc-pascal] Optional param modifier

2019-04-13 Thread Ryan Joseph
could make this contract more concrete and reliable then comments I’d be happy to hear it. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Optional param modifier

2019-04-13 Thread Ryan Joseph
x. But it has to rely on exceptions and all that overhead? That’s not so great if so. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Optional param modifier

2019-04-14 Thread Ryan Joseph
nvalid’); exit(THero.Invalid); end; Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] mode switch madness

2019-04-14 Thread Ryan Joseph
atter if they weren't > using advanced records to start with. It's just a lot of minor rules that > nobody can really explain but that tend to add up in relatively annoying ways. > I like what Jonas did for the ObjC mode switch where he named them with versions. Maybe a {$mod

Re: [fpc-pascal] Optional param modifier

2019-04-14 Thread Ryan Joseph
e know went wrong. Since this is the compiler maybe it could say which condition failed, like “condition x < 0 failed”. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] mode switch madness

2019-04-14 Thread Ryan Joseph
but the pending multi-helpers could certainly cause some problems. Array operators could also but can’t think of any others. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Optional param modifier

2019-04-14 Thread Ryan Joseph
getting > something that I actually just though of. > For parameters I like what Sven suggested to have a “requires” section in functions to check this but wouldn’t it make sense if the function parameter gave some hint also? “can be nil” or “can’t be nil” would both be helpful in terms

Re: [fpc-pascal] Optional param modifier

2019-04-14 Thread Ryan Joseph
< 100) then // assert(‘condition "(hp > 0) and (hp < 100)" for CreateHero failed); end; Pretty simple right? Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Optional param modifier

2019-04-14 Thread Ryan Joseph
ash. Don’t know why but that’s easier for me to understand. I like the requires section because it works in the same logic. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] Record helper properties

2019-04-20 Thread Ryan Joseph
;—— ERROR: Unknown class field or method identifier "x" end; begin end. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] class operator enumerator

2019-04-23 Thread Ryan Joseph
teger; begin for value in arr do // <<<< ERROR: Cannot find an enumerator for the type "TRec" begin end; end. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.fre

Re: [fpc-pascal] Record helper properties

2019-04-23 Thread Ryan Joseph
So I remember now that any fields are not allowed in helpers. Can anyone explain why this must be the case or if it could be fixed? > On Apr 20, 2019, at 11:24 AM, Ryan Joseph wrote: > > I feel like I may have asked this before but I can’t find anything on Google. > Why doesn

Re: [fpc-pascal] Record helper properties

2019-04-23 Thread Ryan Joseph
t. > > Michael. I mean for properties though so it’s not actually adding a type, just making an alias: property F: integer read x; that should just map “x” to “F”, right? I’m getting an error on this however. Regards, Ryan Joseph _

Re: [fpc-pascal] Record helper properties

2019-04-23 Thread Ryan Joseph
ERROR: Unknown class field or method identifier "GetX" end; begin end. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Record helper properties

2019-04-23 Thread Ryan Joseph
ewValue: integer); inline; public property F: integer read GetX write SetX; end; function THelper.GetX: integer; begin result := x; end; procedure THelper.SetX (newValue: integer); begin x := newValue; end; begin end. Regards, Ryan Joseph __

Re: [fpc-pascal] class operator enumerator

2019-04-24 Thread Ryan Joseph
es/records/objects is to implement a GetEnumerator > function, anyways. Here's an expanded-on version of your example, using your > generic constants feature: I think they just forget to disable the operator for records but I believe the operator function works as

Re: [fpc-pascal] Record helper properties

2019-04-24 Thread Ryan Joseph
check or transformation. I just wanted to add some R,G,B fields to a vector instead of adding them into the vector itself. Minor code hygiene thing that would be nice to accommodate but all the accessors required now makes this not so appealing. R

Re: [fpc-pascal] Heavy heap fragmentation issue

2019-06-02 Thread Ryan Joseph
e, maybe there is something that can > be > done to improve the RTL MM? > > -- > Regards, > Martok can you break it down into a test program and post? Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] TStringList/pchar question

2019-06-02 Thread Ryan Joseph
; strings.Free; glShaderSource(vertexShaderID, 1, @vertexShaderSource, nil); Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] TStringList/pchar question

2019-06-02 Thread Ryan Joseph
because I made a bad assumption about ref counting. Thanks. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Heavy heap fragmentation issue

2019-06-02 Thread Ryan Joseph
nsiderable time (and I’m on Mac also). Can’t you reduce it down to a single test program? Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] Class field property access

2019-06-03 Thread Ryan Joseph
a record/object type end; Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Class field property access

2019-06-06 Thread Ryan Joseph
ion? This appears to be a regression since 3.0.4 also. Did you specifically disable this in 3.3.1? Sorry I’m not understanding this one. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.or

Re: [fpc-pascal] Class field property access

2019-06-07 Thread Ryan Joseph
vate b: TB; public property x: integer read b.x write b.x; procedure AfterConstruction; override; end; procedure TA.AfterConstruction; begin b := TB.Create; end; var a: TA; begin a := TA.Create; a.x := 100; writeln(a.x); end. Regards, Ryan Joseph ___

Re: [fpc-pascal] Class field property access

2019-06-07 Thread Ryan Joseph
ers/setters. Pascal allows potentially unsafe memory access in all other situations so I don’t see why properties are any different. We’re targeting the lowest common denominator instead of allowing careful programers to do their best. Regards, Ryan Joseph ___

[fpc-pascal] server up?

2019-06-15 Thread Ryan Joseph
Is the fpc-devel server back up yet? I’m not seeing new messages getting posted. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] Source file macro

2019-06-19 Thread Ryan Joseph
Is there a macro for the path of the source file being compiled? I could swear there was something like FPC_SOURCE_FILE but I can’t find it now. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https

Re: [fpc-pascal] Source file macro

2019-06-19 Thread Ryan Joseph
> On Jun 19, 2019, at 10:52 AM, Виктор Матузенко wrote: > > {$I %FILE%} ? Sorry I mean something like: {$macro on} writeln(FPC_SOURCE_FILE); Looking for a string I can use. Regards, Ryan Joseph ___ fpc-pascal maillist - f

Re: [fpc-pascal] Source file macro

2019-06-19 Thread Ryan Joseph
> On Jun 19, 2019, at 10:59 AM, gabor wrote: > > try > > writeln({$I %FILE%}); > > it really works ;) > > Regards, > Michał Oh I see now. Strange syntax, never saw that before. Can you get the full path instead of just the name?

[fpc-pascal] not inlined?

2019-06-19 Thread Ryan Joseph
; function TDictionary.IsSet (index: integer): boolean; begin result := assigned(header^.entries[index]^.value); end; Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman

Re: [fpc-pascal] not inlined?

2019-06-19 Thread Ryan Joseph
to get some examples. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] String conversions

2019-06-25 Thread Ryan Joseph
I’m making some string helper functions and using ansistring as inputs (in case there are longer strings than 255 chars). What happens when you pass a short string as an ansistring? Does the compiler have to allocate a new ansistring or can it do some smart optimization? Regards, Ryan

Re: [fpc-pascal] String conversions

2019-06-25 Thread Ryan Joseph
> On Jun 25, 2019, at 2:16 PM, Jonas Maebe wrote: > > On 25/06/2019 20:15, Ryan Joseph wrote: >> I’m making some string helper functions and using ansistring as inputs (in >> case there are longer strings than 255 chars). What happens when you pass a >> short st

Re: [fpc-pascal] String conversions

2019-06-25 Thread Ryan Joseph
erve a certain capacity in advance? Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] String conversions

2019-06-25 Thread Ryan Joseph
s a growing string some > how (or have a separate type, like TStringBuilder mentioned by Jonas) It would be nice if ansistring had a SetCapacity function to accompany SetLength but in leu of that I think making a new type is the best idea. Regards

Re: [fpc-pascal] String conversions

2019-06-26 Thread Ryan Joseph
me really. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] Virtual object methods

2019-06-27 Thread Ryan Joseph
TA.DoThis; begin writeln('TA.DoThis'); end; type TB = object (TA) procedure DoThis; virtual; end; procedure TB.DoThis; begin writeln('TB.DoThis'); end; var obj: TB; begin obj.DoThis; end. Regards, Ryan Joseph __

Re: [fpc-pascal] Virtual object methods

2019-06-27 Thread Ryan Joseph
for constructors. I personally find very useful for my > projects. > > Find fixed example below. Hope it helps, I needed them on the stack though. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http

Re: [fpc-pascal] Virtual object methods

2019-06-27 Thread Ryan Joseph
> On Jun 27, 2019, at 4:20 PM, Jonas Maebe wrote: > > tt.pp(4,6) Warning: Virtual methods are used without a constructor in "TA" > tt.pp(14,6) Warning: Virtual methods are used without a constructor in "TB" That’s what the meant! Than

Re: [fpc-pascal] Virtual object methods

2019-06-27 Thread Ryan Joseph
constructor seems to fix this and puts the VMT table on the stack (I think anyways). Btw I’m doing this specifically as testing for a possible “advancedobjects” mode switch and the only reason to use objects is for inheritance on the stack (otherwise records or classes). Regards,

Re: [fpc-pascal] String conversions

2019-06-28 Thread Ryan Joseph
ting. How could we test this to see if it’s true? Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Virtual object methods

2019-07-02 Thread Ryan Joseph
reates VMT for TB+TA? obj.DoThis; 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] Virtual object methods

2019-07-02 Thread Ryan Joseph
> On Jul 2, 2019, at 10:32 AM, Michael Van Canneyt > wrote: > > It overwrites the first. There is no such thing as '2 VMT tables'. That’s what I thought. How costly is this? Not sure what it’s doing under the hood but I’d like to know more. Regard

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

[fpc-pascal] += property bug?

2019-08-11 Thread Ryan Joseph
+= 10; // ERROR: Variable identifier expected 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] += property bug?

2019-08-11 Thread Ryan Joseph
> On Aug 11, 2019, at 11:41 AM, Sven Barth via fpc-pascal > wrote: > > This is forbidden by design. Why? It makes sense it should resolve to: d.setter(d.getter + 10) but maybe there’s a problem? Regards, Ryan Joseph __

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