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
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
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
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
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
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
.
> 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
);
fadeAction.SetEndedAction(@
begin
... // scoped in the calling class so "self" is
available
end;
);
fadeAction.FadeOut;
end;
Regards,
Ryan Joseph
___
fpc-pasca
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
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
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
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
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
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
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
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
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
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
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
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
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
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
// 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 -
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
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
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
> 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,
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
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
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
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
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
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
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
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
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
> 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,
”. 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
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
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
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
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
___
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
___
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
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
> 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,
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
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
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
___
> 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,
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
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.
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
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
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
> 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,
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.
) {
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
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
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
t works.
Regards,
Ryan Joseph
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
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
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
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
_
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
TLongIntArray = specialize TGenericArray;
TStringArray = specialize TGenericArray;
TSingleArray = specialize TGenericArray;
TDoubleArray = specialize TGenericArray;
TFloatArray = specialize TGenericArray;
TPointerArray = specialize TGenericArray;
Regards,
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
___
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
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.
pment). Thanks.
Regards,
Ryan Joseph
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
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
tionIndexed :=
wglGetProcAddress('glBindFragDataLocationIndexed');
if not Assigned(glBindFragDataLocationIndexed) then Exit;
glGetFragDataIndex := wglGetProcAddress('glGetFragDataIndex');
if not Assigned(glGetFragDataIndex) then Exit;
Resul
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
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
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 -
;
DoThis(A);
Regards,
Ryan Joseph
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
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
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
in function calls.
Regards,
Ryan Joseph
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
kTileSortingOnRamp,
kTileSortingBufferStatic,
kTileSortingBufferDynamic
);
Regards,
Ryan Joseph
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http:
Flat,
Container,
OnRamp,
BufferStatic,
BufferDynamic
);
{$scopedenums off}
Regards,
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
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
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
) + 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
> 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,
', obj.v);
end;
Regards,
Ryan Joseph
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
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
___
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
> 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
>> 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
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
___
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
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
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
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
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
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
> 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
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
201 - 300 of 1179 matches
Mail list logo