Recent

Recent Posts

Pages: [1] 2 3 ... 10
1
Windows / Re: Lazarus for Windows on aarch64 (ARM64) - Native Compiler
« Last post by Wallaby on April 23, 2024, 11:46:56 pm »
I've also launched this job at Upwork:
https://www.upwork.com/jobs/~017b8f1ec5e0058846
As an interim solution to figuring out where the right bounty is to be offered.

Thanks for pursuing this! Hopefully someone skilled will respond and get the job done.

It might be worth to mention the job in the dev mailing list list, so that the core developers notice it: https://lists.freepascal.org/pipermail/fpc-devel/
2
General / Re: Parameter passing oddities
« Last post by KodeZwerg on April 23, 2024, 11:04:39 pm »
Alright, agreed that I am responsible for the call, and for overwriting "a".

But the compiler expects that I don't do it and that "a" remains unchanged. Currently everything works, but can we exclude that a  future optimisation relies on "a" being unchanged ?
It seems you still have not understood yet so help me to help you.
In what line of code is "a" changed?
Code: Pascal  [Select][+][-]
  1. procedure Add(const a, b: Integer; out c: Integer); inline;
  2. begin
  3.   c := a + b;
  4. end;
So if you want that "a" stay unchanged, that you already have done since nothing write to "a", right?

You have 3 arguments, each of them can have the same reference but treated internal as unique variables where "a" does know nothing about "b" and so on.

Equal how you watch on it the result stay same, the person that uses your method needs a 1 week training to know that you as the inventor of that method wants maby 3 different arguments or 2 same or or or .... as often you change your mind what you actually want my saying stays same :D
3
Beginners / Re: Can function be used for change event
« Last post by jamie on April 23, 2024, 10:53:10 pm »
In this case the event is oneditingdone I suppose different controls have different types of change events but I try to handle them all through one event procedure. Which is why it’s important to know if the control actually changed..,

I have no idea what would be involved in creating a new type of event that uses a function instead of procedure but acts like tnotifyevent. How are events created? Can I create one in my tedit descendant similar to oneditingdone ?

For the OnEditingDone event do this..

While in the event, test for the focus..

If Self.Focused then We are still in the control and someone hit the return key.
4
General / Re: TIndexedAVLTree in Trunk
« Last post by lainz on April 23, 2024, 10:49:03 pm »
{$IF FPC_FULLVERSION >= 30400}
uses
  avglvltree;
{$ELSE}
uses
  LAZ_AVL_Tree;
{$ENDIF}
5
General / Re: Parameter passing oddities
« Last post by Nitorami on April 23, 2024, 10:48:22 pm »
Alright, agreed that I am responsible for the call, and for overwriting "a".

But the compiler expects that I don't do it and that "a" remains unchanged. Currently everything works, but can we exclude that a  future optimisation relies on "a" being unchanged ?

6
General / Re: Parameter passing oddities
« Last post by KodeZwerg on April 23, 2024, 10:42:51 pm »
Kodezwergs check protects the "constref" declaration by prohibiting Add (C1,C2,C1).

WITHOUT this check, Add (C1,C2,C1) works, BUT formally violates the "constref" agreement.
I don't like this.

I would wish for a construct which allows Add (C1,C2,C2) as well as Add (foo(), bar(), C3) efficiently and without violating the const or constref agreement. And that does not seem to exist in Pascal.
Code: Pascal  [Select][+][-]
  1. procedure Add(const a, b: Integer; out c: Integer); inline;
  2. begin
  3.   c := a + b;
  4. end;
If on the other hand you as developer call such method in a (a, b, a) way, then its upon you to decide if its smart or not.

So every information about that specific topic is given.

Nothing violates, as told, you as programmer are responsable how to call methods correct.
When you call Add(a, b, a) than live with it that you overwrite "a" on purpose, within method everything works like you coded it and the variables behave like expected.
Make method a function with boolean result and constref to check addresses inside, thats how I would do to have a good workflow (if Add() then ...)
7
General / Re: TIndexedAVLTree in Trunk
« Last post by lainz on April 23, 2024, 10:33:29 pm »
I've seen that avglvltree.pas includes that class in trunk, how I can add an ifdef so lazarus 3.3 and lower uses the old LAZ_AVL_Tree and the trunk 3.99 uses avglvltree.pas unit?

Thanks in advance.
8
Graphics / Re: Demo Scene Picture sinwave
« Last post by KodeZwerg on April 23, 2024, 10:26:21 pm »
Code: Pascal  [Select][+][-]
  1.      Bitmap.PutImagePart(0, i*5-4 , Plasma,  Rect(w,  i*5-4,  600*w ,i*10+4), dmDrawWithTransparency);
Should be
Code: Pascal  [Select][+][-]
  1.      Bitmap.PutImagePart(0, i*5-4 , Plasma,  Rect(w,  i*5-4,  600*w ,i*10+4), dmSet);
for best performance.

Nice wiggle effect!
9
General / (Solved) TIndexedAVLTree in Trunk
« Last post by lainz on April 23, 2024, 10:19:29 pm »
Hi, I can't install trunk, but I know from other colleague that TIndexedAVLTree from LAZ_AVL_Tree is not available anymore.

How I can replace that unit and class?

Thanks.
10
General / Re: Parameter passing oddities
« Last post by Nitorami on April 23, 2024, 10:12:36 pm »
Kodezwergs check protects the "constref" declaration by prohibiting Add (C1,C2,C1).

WITHOUT this check, Add (C1,C2,C1) works, BUT formally violates the "constref" agreement.
I don't like this.

I would wish for a construct which allows Add (C1,C2,C2) as well as Add (foo(), bar(), C3) efficiently and without violating the const or constref agreement. And that does not seem to exist in Pascal.


Pages: [1] 2 3 ... 10

TinyPortal © 2005-2018