Re: [fpc-pascal] GLM library alternative?

2017-05-28 Thread Ryan Joseph
ops in FPC I would remove the nested for..loops in your matrix overloads. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] named parameter

2017-05-28 Thread Ryan Joseph
look nicer. The declaration syntax is already the same as the label for the calling syntax so that seems like a nice fit. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] named parameter

2017-05-29 Thread Ryan Joseph
ng from Delphi I’m not familiar with. That’s too bad, a single colon matches the declaration better and looks nice. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] GLM library alternative?

2017-05-29 Thread Ryan Joseph
m nervous about loops in highly optimized low level code now but that may be unfounded. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] Subclassing generic records?

2017-07-17 Thread Ryan Joseph
x; property Height: TFloat read y write y; 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] Subclassing generic records?

2017-07-17 Thread Ryan Joseph
ct constructs don’t really make sense more imo. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Subclassing generic records?

2017-07-21 Thread Ryan Joseph
. > On Jul 20, 2017, at 4:11 AM, Sven Barth via fpc-pascal > wrote: > > I have also another solution for your original problem. Take this code: Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepas

[fpc-pascal] inline callback functions?

2017-08-07 Thread Ryan Joseph
); fadeAction.SetEndedAction(@ begin ... // scoped in the calling class so "self" is available end; ); fadeAction.FadeOut; end; Regards, Ryan Joseph ___ fpc-pasca

Re: [fpc-pascal] inline callback functions?

2017-08-08 Thread Ryan Joseph
abandoned but it’s a good idea none the less. Thanks. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] TStringHelper missing

2017-08-20 Thread Ryan Joseph
s the methods are not found. For example: var str: string; parts: TStringArray; parts := str.Split(' ‘); What am I doing wrong? Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepasc

[fpc-pascal] implements

2017-09-01 Thread Ryan Joseph
end; constructor TBaseClass.Create; begin m_hook := THook.Create; end; base: TBaseClass; base := TBaseClass.Create; base.DoIt; // CANT DO THIS base.hook.DoIt; // MUST DO THIS Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists

Re: [fpc-pascal] implements

2017-09-02 Thread Ryan Joseph
makes it useless. The only possible use of this I could think of is not needing to type “hook.” every time but since you need to anyways I just don’t get it. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org

Re: [fpc-pascal] implements

2017-09-02 Thread Ryan Joseph
hook.XXX for every method. It just feels broken and not complete as a feature. Furthermore if you know that a class implements an interface but you need to call another variable (like hook) then how do you know the name of the variable??? I use interfaces often but that would break them for

Re: [fpc-pascal] implements

2017-09-04 Thread Ryan Joseph
a practical use patterns for “implements properties”. I should have seen that at the start but I’m still hung up on how it’s implemented. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org

Re: [fpc-pascal] implements

2017-09-05 Thread Ryan Joseph
ism but without subclassing. That’s why I wanted the “implements” feature to implicitly include the name of the property so they would behave like this transparently. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.free

Re: [fpc-pascal] implements

2017-09-06 Thread Ryan Joseph
ed. It would be messy to implement probably because you would risk a number of name collisions with existing methods. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Where and Why is there a memory leak?

2017-09-06 Thread Ryan Joseph
just add the Free() call? I would expect it to leak without that. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Where and Why is there a memory leak?

2017-09-06 Thread Ryan Joseph
before I posted the message, and it didn't make any difference. FHook is > a IHook interface reference, not a object reference. I can't change it > either, otherwise FPC gives me a compiler error on the property ... > implements...; l

Re: [fpc-pascal] Where and Why is there a memory leak?

2017-09-06 Thread Ryan Joseph
am I missing? type THook = class(TInterfacedObject, IHook) private procedure DoIt; 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] Where and Why is there a memory leak?

2017-09-06 Thread Ryan Joseph
e assignment of the new memory. Is FPC doing something magic behind the scenes? Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] Inclocked/declocked

2017-09-11 Thread Ryan Joseph
doing something else I would be interested in? SYSTEM_$$_INCLOCKED$INT64 SYSTEM_$$_DECLOCKED$INT64$$BOOLEAN Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc

Re: [fpc-pascal] Inclocked/declocked

2017-09-11 Thread Ryan Joseph
xtreme. See if I have a dynamic array and call arr[0] := xxx then those functions will be called (or FPC_DYNARRAY_ASSIGN)? I also have a dynamic array in an object which is passed a function parameter, but not by value so that doesn’t fit your descriptio

[fpc-pascal] Comparison operator for generics

2017-09-11 Thread Ryan Joseph
// comparison operator doesn't exist for records so I get compiler errors if I specialize TCollection<> with a record type if value = T then ; end; Regards, Ryan Joseph ___ fpc-pascal maillist -

Re: [fpc-pascal] Inclocked/declocked

2017-09-11 Thread Ryan Joseph
led (how could I track in the debugger?) but I consider this a pretty serious bug and I wouldn’t use dynamic arrays in high performance code. If I had to guess I would say it was from SetLength but 16%? When I replaced with static arrays and used ReAllocMem instead this didn’t happen so what are

Re: [fpc-pascal] Inclocked/declocked

2017-09-12 Thread Ryan Joseph
e locking. That’s probably it then even though I wasn’t growing the arrays by single elements (ReAllocMem didn’t give me problems). De facto Solution is to be safe and not use dynamic arrays in low-level high performance code. Regards, Ryan Joseph

Re: [fpc-pascal] Comparison operator for generics

2017-09-12 Thread Ryan Joseph
tor overloads. > Do any examples of how to use the class exist? I searched around and couldn’t find a single snippet even though it appears to exist in Delphi. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.or

Re: [fpc-pascal] Comparison operator for generics

2017-09-12 Thread Ryan Joseph
> On Sep 12, 2017, at 4:46 PM, Maciej Izak wrote: > > Please check example at : > packages\rtl-generics\examples\tcomparer\tcomparerproject.lpr Thanks. What is the & here? TCompare.&String(Left.Name, Right.Name); I don’t think I’ve ever seen that before. Regards,

[fpc-pascal] Booleans vs sets

2017-09-21 Thread Ryan Joseph
I have a class that is filling up with booleans. Would it be more efficient to store these as a “set of”? I have 10 bools which is getting up there. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http

Re: [fpc-pascal] Booleans vs sets

2017-09-22 Thread Ryan Joseph
Got it, thanks guys. Btw, how can I know what the size in bytes these 2 options are? > On Sep 21, 2017, at 4:47 PM, Michael Van Canneyt > wrote: > > > > On Thu, 21 Sep 2017, Mattias Gaertner wrote: > >> On Thu, 21 Sep 2017 15:16:21 +0700 >> Ryan Joseph w

[fpc-pascal] For ..in GetEnumerator Allocation

2017-10-04 Thread Ryan Joseph
more efficiently in tight loops. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] For ..in GetEnumerator Allocation

2017-10-04 Thread Ryan Joseph
oc for each iterator. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] For ..in GetEnumerator Allocation

2017-10-04 Thread Ryan Joseph
e a magic method so I’m not sure how the memory is being managed but I assume the stack space for the method return value is reserved and I just fill in the values of the record to that location. Regards, Ryan Joseph ___ fpc-pascal maillis

Re: [fpc-pascal] For ..in GetEnumerator Allocation

2017-10-04 Thread Ryan Joseph
ow also to make sure I understand it. Thanks. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] Managed properties idea

2017-10-04 Thread Ryan Joseph
begin TObject(obj).Release; result := nil; end; 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] Managed properties idea

2017-10-05 Thread Ryan Joseph
tically handled by the > compiler is an added bonus. > > example? I’ve been doing retain management manually and honestly I prefer that for some cases where I want more control so I still like that syntax option. Regards, Ryan Joseph

[fpc-pascal] Const params question

2017-10-11 Thread Ryan Joseph
If you declare a parameter as const does that effectively behave like passing by reference? I have some performance sensitive functions that take records as arguments and I don’t want copying to the stack so I’ve been using @ but maybe const is just as good? Thanks. Regards, Ryan

Re: [fpc-pascal] Const params question

2017-10-11 Thread Ryan Joseph
> On Oct 11, 2017, at 5:01 PM, Michael Van Canneyt > wrote: > > No, you need constref then. Ok, so constref/var are the same in terms of copying. The docs say const reduces stack size? I never label my parameters with const but maybe it’s worth it some cases. Regards,

[fpc-pascal] AbstractError in 3.1.1

2017-10-11 Thread Ryan Joseph
”. What does this mean? There is just the last line of the unit so presumably it occurred higher up but I don’t have any other information to go on. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http

Re: [fpc-pascal] AbstractError in 3.1.1

2017-10-12 Thread Ryan Joseph
s obviously a last resort and I’ve avoided it for 6 months now. ;) Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] AbstractError in 3.1.1

2017-10-12 Thread Ryan Joseph
roblem went away. Are abstract methods broken or something? Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] AbstractError in 3.1.1

2017-10-12 Thread Ryan Joseph
is doing it and if I remove that name the error goes away. type TAbstractClass = class function GetLocation (system: TObject): TPoint; virtual; abstract; end; Regards, Ryan Joseph ___ fpc-pascal ma

Re: [fpc-pascal] AbstractError in 3.1.1

2017-10-12 Thread Ryan Joseph
in > the System unit it's safe to assume that the compiler is getting confused > there. > Would you please open a bug report with this as a full example? > > But I'm glad that you found the issue... > Regards, Ryan Joseph ___

Re: [fpc-pascal] Lua language in /packages/lua will be update?

2017-10-15 Thread Ryan Joseph
t; > Best regards, > Marcos Douglas > ___ > fpc-pascal maillist - fpc-pascal@lists.freepascal.org > http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal Regards, Ryan Joseph ___

[fpc-pascal] Printing types in generics

2017-10-18 Thread Ryan Joseph
PInteger(@value)^); // this is just a hack to print compiler types end; 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] Printing types in generics

2017-10-18 Thread Ryan Joseph
e and just call .Show() or something but I couldn’t figure that out. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Generic compiler error

2017-10-22 Thread Ryan Joseph
> On Oct 23, 2017, at 9:14 AM, Marcos Douglas B. Santos > wrote: > > How do the same with generic classes, using mode delphi? I think you need to specialize then alias the specialize type. Why do you want to make an alias for an untyped generic anyways? Regards,

[fpc-pascal] Callbacks as nested functions

2017-10-23 Thread Ryan Joseph
Is there anyway to get callbacks to work as nested functions? I get crashes when I try this and I assume it’s because the the compiler is replacing the first parameter with another value. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc

Re: [fpc-pascal] Callbacks as nested functions

2017-10-23 Thread Ryan Joseph
writeln(a); end; var callback: TCallback; begin callback := TCallback(@DoThis); callback(100); 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] Callbacks as nested functions

2017-10-23 Thread Ryan Joseph
ecause FPC does not yet support Delphi's "reference to". Thanks, I never heard of nestedprocvars. Why isn’t that the default? If I have a callback I may have it be nested or not so I always want “is nested” on I guess. Regards, Ryan Joseph ___

Re: [fpc-pascal] Callbacks as nested functions

2017-10-23 Thread Ryan Joseph
> On Oct 23, 2017, at 9:05 PM, Michael Van Canneyt > wrote: > > It is not the default because neither Delphi nor TP allow this. then that begs the question, why not? :) If local functions are a useful feature then local callbacks should be too. Regards,

[fpc-pascal] InitThread/DoneThread

2017-10-27 Thread Ryan Joseph
support as to why their crashing but if they’re needed I’d like to omit them obviously. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] InitThread/DoneThread

2017-10-27 Thread Ryan Joseph
amework (which were crashing) but I was also using it in the SDL library for platform independent threads (which isn’t crashing). Maybe just old obsolete information so I’ll remove them since they weren’t doing anything anyways as far as I can tell. Thanks.

[fpc-pascal] move problem

2017-11-02 Thread Ryan Joseph
here??? var i: integer; dest: pointer; src: pointer; dest := GetMem(sizeof(i)); i := 100; src := @i; Move(src, dest, sizeof(i)); writeln(PInteger(block)^); Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal

Re: [fpc-pascal] move problem

2017-11-02 Thread Ryan Joseph
used by something else and got derailed. Thanks. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] Float packing

2017-11-05 Thread Ryan Joseph
I do: 50/1000 = 0.050 and get a value with 3 decimal places which could fit into an RGB value, but how can I extract the decimal places? I think it has something to do bit shifting but I wasn’t able to figure it out. The final result should be: r = 0 g = 5 b = 0 Regards, Ryan Joseph

Re: [fpc-pascal] Float packing

2017-11-05 Thread Ryan Joseph
> On Nov 6, 2017, at 10:43 AM, Ryan Joseph wrote: > > I have a number which I need to encode as an RGB value each component being 4 > bytes (12 bytes total) I don’t know why I typed this, each component is 1 byte obviously so each digit can be up to 255 for a total value of 255,

Re: [fpc-pascal] Float packing

2017-11-05 Thread Ryan Joseph
e to figure it out. The final result should be: > > r = 0 > g = 5 > b = 0 > > > Regards, > Ryan Joseph > > ___ > fpc-pascal maillist - fpc-pascal@lists.freepascal.

Re: [fpc-pascal] Float packing

2017-11-06 Thread Ryan Joseph
) { c.r = c.r*255; c.g = c.g*255; c.b = c.b*255; return floor(c.r + c.g * 256 + c.b * 256 * 256); } I think I got this solved but i need to implement it fully. Regards, Ryan Joseph ___ fpc-pascal ma

[fpc-pascal] -O2 internal compiler errors

2017-11-08 Thread Ryan Joseph
When I turn on -O2 I get a never ending stream of internal error 2009112601 which I think is from various inlined operator overloads (didn’t do much testing though). Is this a bug or are they not compatible? Regards, Ryan Joseph ___ fpc

Re: [fpc-pascal] -O2 internal compiler errors

2017-11-08 Thread Ryan Joseph
PM, Karoly Balogh (Charlie/SGR) > wrote: > > Example code to trigger it please, if possible, also which CPU > architecture and OS? An internal error is always a compiler bug which > we'd like to fix. If with nothing else, but with a more user readable > error message. Re

Re: [fpc-pascal] First pas2js public release

2017-12-21 Thread Ryan Joseph
t works. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] any existing units/libraries for sorting?

2018-01-03 Thread Ryan Joseph
ote: > > I have a list of records (each with a few fields). > I want to let users display this list of records in ascending orders of any > record field. > Is there any existing units/library I can use? > > Thanks in advance. Rega

Re: [fpc-pascal] Translate C code

2018-01-06 Thread Ryan Joseph
encing and taking the addressing of a nil pointer sounds like a bad idea. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Translate C code

2018-01-06 Thread Ryan Joseph
I thought nil suggested) then I don’t see where it’s getting an address of anything. For anyone interested can you recode that function to more Pascal? It feels like we’re going needlessly low level when another method would make more sense. Regards, Ryan Joseph _

[fpc-pascal] Generics vs templates

2018-01-07 Thread Ryan Joseph
are strictly off limits for the same reasons. Having just started to use generics in FPC myself I was curious if FPC suffers from the same problem of slow compile times? Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal

Re: [fpc-pascal] Generics vs templates

2018-01-08 Thread Ryan Joseph
TLongIntArray = specialize TGenericArray; TStringArray = specialize TGenericArray; TSingleArray = specialize TGenericArray; TDoubleArray = specialize TGenericArray; TFloatArray = specialize TGenericArray; TPointerArray = specialize TGenericArray; Regards,

Re: [fpc-pascal] Generics vs templates

2018-01-08 Thread Ryan Joseph
h generics exactly? If I understand correctly generics are “meta-programming” where they essentially just re-insert a generated class based on the template (c++’s naming scheme makes more sense imo) but they don’t actually add any runtime code. Regards, Ryan Joseph ___

Re: [fpc-pascal] Generics vs templates

2018-01-08 Thread Ryan Joseph
reas I didn’t want to and a virtual method but beyond that I don’t see what would affect performance. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Generics vs templates

2018-01-09 Thread Ryan Joseph
e so every instance will be using TList. Does Delphi do this also? I think FPC requires you MUST specialize at compile time so simply using TList won’t compile. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.

[fpc-pascal] Dot syntax for types?

2018-01-13 Thread Ryan Joseph
pment). 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] Dot syntax for types?

2018-01-14 Thread Ryan Joseph
guide about enums ( > https://freepascal.org/docs-html/current/ref/refsu4.html#x26-280003.1.1). > Ah yes enums. {$scopedenums on} was what I was looking for but it looks like even if I remembered what they were called I still wouldn’t have found

[fpc-pascal] glGetString crash

2018-02-17 Thread Ryan Joseph
tionIndexed := wglGetProcAddress('glBindFragDataLocationIndexed'); if not Assigned(glBindFragDataLocationIndexed) then Exit; glGetFragDataIndex := wglGetProcAddress('glGetFragDataIndex'); if not Assigned(glGetFragDataIndex) then Exit; Resul

Re: [fpc-pascal] glGetString crash

2018-02-18 Thread Ryan Joseph
Maybe SDL has a bug then because glGetString should never crash. When are the land Load_GL_VERSION_XXX functions meant to be called in the pipeline? I was calling them before the openGL context is created (which works except for 3.x on the old MacBook) but I just tried calling Load_GL_VERSION_3

Re: [fpc-pascal] glGetString crash

2018-02-19 Thread Ryan Joseph
VERSION_3_2 and call glGetError to clear the error which is erroneous it appears. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] glGetString crash

2018-02-20 Thread Ryan Joseph
ighest fully implemented version of OpenGL on this Mac according to “OpenGL Extension Viewer” also. I don’t need any 3.3+ extensions so I’ll just ignore it for now but I think something is wrong. Regards, Ryan Joseph ___ fpc-pascal maillist -

[fpc-pascal] Scoped enums and inferred types

2018-02-20 Thread Ryan Joseph
; DoThis(A); Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Scoped enums and inferred types

2018-02-20 Thread Ryan Joseph
the compiler could certainly help here. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Scoped enums and inferred types

2018-02-20 Thread Ryan Joseph
ntation/Swift/Conceptual/Swift_Programming_Language/Enumerations.html) but I don’t know if they have overloaded functions. That’s too bad, it would be a nice feature. Thanks. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org htt

Re: [fpc-pascal] Scoped enums and inferred types

2018-02-21 Thread Ryan Joseph
in function calls. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Scoped enums and inferred types

2018-02-21 Thread Ryan Joseph
kTileSortingOnRamp, kTileSortingBufferStatic, kTileSortingBufferDynamic ); Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http:

Re: [fpc-pascal] Scoped enums and inferred types

2018-02-21 Thread Ryan Joseph
Flat, Container, OnRamp, BufferStatic, BufferDynamic ); {$scopedenums off} Regards,

Re: [fpc-pascal] Scoped enums and inferred types

2018-02-21 Thread Ryan Joseph
at some point also. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Scoped enums and inferred types

2018-02-21 Thread Ryan Joseph
also) Extended > Pascal. How does that look? Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Scoped enums and inferred types

2018-02-21 Thread Ryan Joseph
exist in the first Pascal specs? I honestly kind of forgot about them since I was doing desktop apps from C based API’s that used all constants. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepa

[fpc-pascal] Better way to convert short string to pchar?

2018-02-22 Thread Ryan Joseph
) + 1); StrPCopy(pname, name); result := glGetUniformLocation(programID, pname); StrDispose(pname); Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Better way to convert short string to pchar?

2018-02-23 Thread Ryan Joseph
> On Feb 23, 2018, at 6:51 PM, Marco van de Voort wrote: > > When creating the content of name append #0 (name:=whateverexpression+#0 ); , > then do > result = glGetUniformLocation(programID, @name[1]); Thanks now I remember. That was driving me crazy. Regards,

[fpc-pascal] Managed record questions

2018-03-07 Thread Ryan Joseph
', obj.v); 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] Managed record questions

2018-03-07 Thread Ryan Joseph
manager used for class constructors? If a class reused the same block of memory that would have a similar effect and useful for tight loops where you’re allocating/deallocating memory over and over again. Regards, Ryan Joseph ___

Re: [fpc-pascal] Managed record questions

2018-03-08 Thread Ryan Joseph
implementing that in Pascal would be a massive overhaul and probably not worth 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] Managed record questions

2018-03-08 Thread Ryan Joseph
> On Mar 8, 2018, at 2:43 PM, Ryan Joseph wrote: > > In many cases I don’t actually need anything on the heap and a record could > be used instead but because of limitations on records in Pascal I need a full > class. Doing the ARC route is just solving a problem I create

Re: [fpc-pascal] Managed record questions

2018-03-08 Thread Ryan Joseph
>> over again. > > You can do this for particular classes by overriding NewInstance. Can you elaborate please? Not sure how that looks. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Managed record questions

2018-03-08 Thread Ryan Joseph
ve any standing in the modern landscape it should at least be fast and low-level otherwise it’s hard not justify using Java, C# or any other language that is reckless with memory allocation and inefficient with automatic garbage collection schemes. Regards, Ryan Joseph ___

Re: [fpc-pascal] Managed record questions

2018-03-08 Thread Ryan Joseph
it’s a really unfortunate oversight. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Managed record questions

2018-03-08 Thread Ryan Joseph
more (I didn’t go full in on OOP until much later and I switched to FPC in ~2005 I think). Classes were easier to work with I can remember but why abandon the stack allocation intentionally? Regards, Ryan Joseph ___ fpc-pascal mailli

Re: [fpc-pascal] Managed record questions

2018-03-08 Thread Ryan Joseph
cally overhaul the entire system to make this work. Until then we’re stuck in the middle, using records when we want stack allocation (with a broken OOP model) and using Classes when we need OOP features but forced into dynamic memory management scenarios. Regards, Ryan Joseph

Re: [fpc-pascal] Managed record questions

2018-03-08 Thread Ryan Joseph
ng objects more flexible is possible but making classes behave like records on the stack is not. The best we can do now is use management operators on generic records to wrap classes so they get deallocated when out of scope. I can’t believe how complicated we’ve made

Re: [fpc-pascal] Managed record questions

2018-03-09 Thread Ryan Joseph
ut if it did that they would be an interesting replacement for classes in some cases. The compiler knows how to cleanup stack variables but does it call any virtual method on objects in this situation? Regards, Ryan Joseph ___ fpc-p

Re: [fpc-pascal] Managed record questions

2018-03-09 Thread Ryan Joseph
ps not. If you could add that then objects would have built-in ARC and since you can actually subclass them the implementation would be hidden away (instead of the messy generic wrapper we need to use with records). Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Managed record questions

2018-03-09 Thread Ryan Joseph
> On Mar 9, 2018, at 4:13 PM, Ryan Joseph wrote: > > type > TDataObject = object > v: array[0..2] of integer; > end; > > procedure TestObjectCopy; > var > obj: TDataObject; > data: array[0..2] of integer; > i: in

Re: [fpc-pascal] Managed record questions

2018-03-09 Thread Ryan Joseph
ion Maciej I guess. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

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