Re: [fpc-pascal] Proper preprocessor?

2018-06-20 Thread Sven Barth via fpc-pascal
Mark Morgan Lloyd schrieb am Mi., 20. Juni 2018, 18:38: > On 20/06/18 14:45, Marc Santhoff wrote: > > But I speak up for another reason: > > Long ago, at the time of fpc 1.9.x or 2.0.x I did some digging in > compilersource code, the lexer and parser part. IIRC there were some hooks > for

Re: [fpc-pascal] Feature announcement: Dynamic array extensions

2018-06-18 Thread Sven Barth via fpc-pascal
Am 19.06.2018 um 00:57 schrieb Joao Schuler: If I can, I would like to vote for "&" instead of "+". As I use Free Pascal with math (neural networks), I would vote for "&" with concatenation and "||" with "union" (in the case it's ever required). There won't be any voting as the "+" operator was

Re: [fpc-pascal] Lazarus and Cocoa

2018-06-17 Thread Sven Barth via fpc-pascal
Ryan Joseph schrieb am So., 17. Juni 2018, 11:34: > I’m trying to make a lazarus control which wraps an NSView but I haven’t > used Lazarus before and I don’t really understand the architecture of the > system. It looks like a TForm is essentially a window and TWinControl is > perhaps what I

Re: [fpc-pascal] Multiple thread heaps

2018-06-17 Thread Sven Barth via fpc-pascal
Florian Klämpfl schrieb am So., 17. Juni 2018, 10:47: > Am 17.06.2018 um 09:44 schrieb Sven Barth via fpc-pascal: > > Terry Mead mailto:t...@weighbatch.com>> schrieb am > So., 17. Juni 2018, 07:45: > > > > If the default memory manager for FP creates a heap f

Re: [fpc-pascal] Multiple thread heaps

2018-06-17 Thread Sven Barth via fpc-pascal
Terry Mead schrieb am So., 17. Juni 2018, 07:45: > If the default memory manager for FP creates a heap for each thread, what > happens if an object is created in one thread and freed by another ? > If I remember correctly the memory becomes part of the thread's free list that freed the memory.

Re: [fpc-pascal] Better usage of "with"

2018-06-14 Thread Sven Barth via fpc-pascal
Ryan Joseph schrieb am Do., 14. Juni 2018, 14:48: > > > > On Jun 14, 2018, at 7:26 PM, Sven Barth via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > > > > Because one needs to be able to represent the properties in the RTTI. > Without pointers all t

Re: [fpc-pascal] Better usage of "with"

2018-06-14 Thread Sven Barth via fpc-pascal
Ryan Joseph schrieb am Do., 14. Juni 2018, 11:59: > > > > On Jun 14, 2018, at 4:44 PM, Ryan Joseph > wrote: > > > > Something I tried was using properties like this but it didn’t work. Is > that something properties could do? It feels like they should be able to > reach into records fields that

Re: [fpc-pascal] Better usage of "with"

2018-06-14 Thread Sven Barth via fpc-pascal
Ryan Joseph schrieb am Do., 14. Juni 2018, 10:03: > type > TEntity = record > position: TVec2; > end; > TEntityPtr = ^TEntity; > > type > TDoor = record > with entity: TEntityPtr; // import entity namespace for > entire TDoor scope

Re: [fpc-pascal] round(2.5)=2

2018-06-13 Thread Sven Barth via fpc-pascal
Wolf schrieb am Mi., 13. Juni 2018, 09:27: > Why not ask the CPU to do the rounding? This is what Intel offers in > volume 1 of the Intel ® 64 and IA-32 Architectures Software Developer's > Manual: > 4.8.4.1 > Rounding Control (RC) Fields > In the Intel 64 and IA-32 architectures, the rounding

Re: [fpc-pascal] Feature announcement: Dynamic array extensions

2018-06-07 Thread Sven Barth via fpc-pascal
Mark Morgan Lloyd schrieb am Do., 7. Juni 2018, 11:46: > On 04/06/18 12:00, Nitorami wrote: > >>> It would be reasonable to assume that the predefined + might be>> > substantially more efficient than a programmer-defined one could be. > >> Yes, that's one of the reasons I vote for keeping the

Re: [fpc-pascal] Dynamic arrays using management operators

2018-06-06 Thread Sven Barth via fpc-pascal
Ryan Joseph schrieb am Do., 7. Juni 2018, 03:32: > > > > On Jun 7, 2018, at 4:25 AM, Sven Barth via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > > > > However you can't do that with indexed properties (which is the feature > that Ryan meant) a

Re: [fpc-pascal] Dynamic arrays using management operators

2018-06-06 Thread Sven Barth via fpc-pascal
Nitorami schrieb am Mi., 6. Juni 2018, 22:39: > >2) dynamic arrays can index directly into records and write to fields but > the [] operator overload can’t do this. > > I don't understand this, can you provide an example ? > With dynamic arrays that contain records you can do this: === code

Re: [fpc-pascal] Feature announcement: Dynamic array extensions

2018-06-03 Thread Sven Barth via fpc-pascal
Ryan Joseph schrieb am So., 3. Juni 2018, 10:22: > > > > On Jun 3, 2018, at 3:15 PM, Sven Barth via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > > > > Because operator overloads are static methods not normal methods. > > I don’t understand.

Re: [fpc-pascal] Feature announcement: Dynamic array extensions

2018-06-03 Thread Sven Barth via fpc-pascal
Bernd Oppolzer schrieb am So., 3. Juni 2018, 11:56: > > > Am 02.06.2018 um 15:14 schrieb Sven Barth via fpc-pascal: > > Mark Morgan Lloyd schrieb am Sa., 2. > Juni 2018, 10:53: > >> However as Dennis points out + is also essential for vector operations

Re: [fpc-pascal] Feature announcement: Dynamic array extensions

2018-06-03 Thread Sven Barth via fpc-pascal
Ryan Joseph schrieb am So., 3. Juni 2018, 05:35: > > > > On Jun 2, 2018, at 3:19 PM, denisgolovan wrote: > > > > BTW, you first overload is not implemented properly. You need to clone > "left" first and return it as a result. > > That’s probably the functionality you want but as an aside why

Re: [fpc-pascal] Feature announcement: Dynamic array extensions

2018-06-02 Thread Sven Barth via fpc-pascal
Mark Morgan Lloyd schrieb am Sa., 2. Juni 2018, 10:53: > However as Dennis points out + is also essential for vector operations. > Perhaps either leaving it to the programmer to define what's needed > would be the best approach, or alternatively splitting dynamic arrays > into mathematical

Re: [fpc-pascal] Feature announcement: Dynamic array extensions

2018-06-02 Thread Sven Barth via fpc-pascal
denisgolovan schrieb am Sa., 2. Juni 2018, 10:28: > Yes, I strongly support removing that functionality in favor of user > operator overloads or vector-compatible way. > To clear something up: this new operator will definitely not be removed. Period. What might be done however (and what I had

Re: [fpc-pascal] Feature announcement: Dynamic array extensions

2018-06-02 Thread Sven Barth via fpc-pascal
denisgolovan schrieb am Sa., 2. Juni 2018, 09:18: > @Sven > Please reconsider "+" operator for arrays if your changes really forbid to > overload operators for arrays now. > It wasn't me who implemented that part. I personally had planned to do it with a warning for existing overloads, but

Re: [fpc-pascal] -gw and -O3

2018-05-28 Thread Sven Barth via fpc-pascal
Ryan Joseph schrieb am Mo., 28. Mai 2018, 07:05: > What happens when you have both those switches on at the same time? Does > the -gw affect the performance or just output information in addition to > the optimized compilation? > The generation of debug information

[fpc-pascal] Feature announcement: Unicode character constants outside of BMP

2018-05-27 Thread Sven Barth via fpc-pascal
Hello together! Small feature announcement this time, but some might like it nevertheless: FPC now supports unicode character constants that are outside of the Basic Multilingual Plane (BMP), thus all with a value > $, but < $10 (the highest possible Unicode code point). As these are

Re: [fpc-pascal] Feature announcement: Dynamic array extensions

2018-05-25 Thread Sven Barth via fpc-pascal
Am 25.05.2018 um 08:42 schrieb Ryan Joseph: On May 25, 2018, at 1:02 PM, Sven Barth via fpc-pascal <fpc-pascal@lists.freepascal.org> wrote: Yes, that is what it does. Though a possible optimization would be that the compiler detects "dynarr := dynarr + [elem]" and conver

Re: [fpc-pascal] Management operators question

2018-05-25 Thread Sven Barth via fpc-pascal
Maciej Izak schrieb am Fr., 25. Mai 2018, 14:03: > anyway you should not use management operators in FPC trunk, the work is > discontinued on the trunk and may be removed (not my fault - for one person > in FPC core with admin rights, emotional personal revenge and >

Re: [fpc-pascal] Feature announcement: Dynamic array extensions

2018-05-25 Thread Sven Barth via fpc-pascal
Ryan Joseph <r...@thealchemistguild.com> schrieb am Fr., 25. Mai 2018, 12:45: > > > > On May 25, 2018, at 3:57 PM, Sven Barth via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > > > > If I had to guess you were probably doing something

Re: [fpc-pascal] Feature announcement: Dynamic array extensions

2018-05-25 Thread Sven Barth via fpc-pascal
Ryan Joseph schrieb am Fr., 25. Mai 2018, 10:24: > > > > On May 25, 2018, at 3:18 PM, Michael Van Canneyt > wrote: > > > > I'm guessing you are not using strings either then, for performance > reasons ? Because exactly the same happens there.

Re: [fpc-pascal] Feature announcement: Dynamic array extensions

2018-05-25 Thread Sven Barth via fpc-pascal
Michael Van Canneyt <mich...@freepascal.org> schrieb am Fr., 25. Mai 2018, 10:15: > > > On Fri, 25 May 2018, Sven Barth via fpc-pascal wrote: > > > Yes, that is what it does. Though a possible optimization would be that > the > > compiler detects "d

Re: [fpc-pascal] Feature announcement: Dynamic array extensions

2018-05-25 Thread Sven Barth via fpc-pascal
Ryan Joseph schrieb am Fr., 25. Mai 2018, 07:55: > The procedural syntax of Insert(arr, 0, value) is less enticing than > arr.Insert(0, value) also but again we can fix that with type helpers. > You are overestimating what type helpers are capable of doing for

Re: [fpc-pascal] Feature announcement: Dynamic array extensions

2018-05-25 Thread Sven Barth via fpc-pascal
Ryan Joseph <r...@thealchemistguild.com> schrieb am Fr., 25. Mai 2018, 04:35: > > > > On May 25, 2018, at 1:37 AM, Sven Barth via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > > > > This is currently not supported. And to avoid backwards compatib

Re: [fpc-pascal] Feature announcement: Dynamic array extensions

2018-05-24 Thread Sven Barth via fpc-pascal
Am 24.05.2018 um 17:27 schrieb Ryan Joseph: On May 20, 2018, at 7:23 PM, Sven Barth via fpc-pascal <fpc-pascal@lists.freepascal.org> wrote: The compiler now implements a "+" operator for arrays which is the same as if Concat() would be called on the arrays. I haven’t buil

Re: [fpc-pascal] Dynamic Array, operator +

2018-05-21 Thread Sven Barth via fpc-pascal
Am 20.05.2018 um 18:39 schrieb Mathias: Mixing dynamic and static array does not work properly yet. The "+" operator is currently not supposed to work for static arrays. Please report as a feature request. var   a, b, c: array of byte;   d: array[0..2] of byte = (6, 7, 8); begin [snip]

Re: [fpc-pascal] Feature announcement: Dynamic array extensions

2018-05-21 Thread Sven Barth via fpc-pascal
Am 21.05.2018 um 01:36 schrieb Maciej Izak: 2018-05-21 0:52 GMT+02:00 Sven Barth via fpc-pascal <fpc-pascal@lists.freepascal.org <mailto:fpc-pascal@lists.freepascal.org>>: The thing is that I can easily imagine the Delphi devs to be so stoned to use the "[...]&q

Re: [fpc-pascal] Feature announcement: Dynamic array extensions

2018-05-20 Thread Sven Barth via fpc-pascal
Maciej Izak <hnb.c...@gmail.com> schrieb am So., 20. Mai 2018, 23:32: > 2018-05-20 22:50 GMT+02:00 Sven Barth via fpc-pascal < > fpc-pascal@lists.freepascal.org>: > >> I prohibited it because Delphi does not support it correctly and I don't >> know whether th

Re: [fpc-pascal] Feature announcement: Dynamic array extensions

2018-05-20 Thread Sven Barth via fpc-pascal
Maciej Izak schrieb am So., 20. Mai 2018, 21:49: > Why you decide to prohibit static array constants inside dynamic array > constants for Delphi modes in r39045? I do not understand this decision. It > is some punishment for using Delphi mode? -,- IMO bad decision. > I

Re: [fpc-pascal] Feature announcement: Dynamic array extensions

2018-05-20 Thread Sven Barth via fpc-pascal
Mattias Gaertner schrieb am So., 20. Mai 2018, 17:58: > >[...] > > === code end === > > > > For constants the dynamic array constants adhere to the writable > > constants switch $J. E.g. the following will result in an exception: > > > > === code begin === > > > >

Re: [fpc-pascal] Feature announcement: Dynamic array extensions

2018-05-20 Thread Sven Barth via fpc-pascal
Anthony Walter schrieb am So., 20. Mai 2018, 19:09: > By the way, what's the reason for differences in () / [] syntax between > objpas and delphi mode? > For the non-Delphi modes I decided to keep consistency with static array constants (which use the same syntax in Delphi

[fpc-pascal] Feature announcement: Dynamic array extensions

2018-05-20 Thread Sven Barth via fpc-pascal
Hello together! I'm pleased to announce that after nearly a year various extensions for dynamic arrays have been finished. This includes the following features: - support for array constructors using "[...]" syntax - support for Insert(), Delete() and Concat() - support for "+" operator -

Re: [fpc-pascal] LongBool True = -1

2018-05-20 Thread Sven Barth via fpc-pascal
Dmitry Boyarintsev schrieb am So., 20. Mai 2018, 04:38: > On Thu, May 17, 2018 at 5:26 PM, Anthony Walter wrote: > >> I am working with some a glib library that expects gboolean to be >> positive 1 for true, yet FPC emits -1 for true. >> > > I'd

Re: [fpc-pascal] LongBool True = -1

2018-05-19 Thread Sven Barth via fpc-pascal
Gerhard Scholz schrieb am Sa., 19. Mai 2018, 19:51: > Afaik, the bool types (longbool, wordbool, bytebool) come from the C > language and are mostly used to interface with C libraries (for example: > windows). The definitions there are: 0 means FALSE, anything else means > TRUE.

Re: [fpc-pascal] Undocumented SetLength functionality

2018-05-18 Thread Sven Barth via fpc-pascal
Michael Van Canneyt <mich...@freepascal.org> schrieb am Di., 15. Mai 2018, 14:29: > > > On Tue, 15 May 2018, Sven Barth via fpc-pascal wrote: > > > Torsten Bonde Christiansen <t...@epidata.info> schrieb am Di., 15. Mai > 2018, > > 12:03: > > > >

Re: [fpc-pascal] LongBool True = -1

2018-05-17 Thread Sven Barth via fpc-pascal
Am 17.05.2018 um 23:26 schrieb Anthony Walter: I am working with some a glib library that expects gboolean to be positive 1 for true, yet FPC emits -1 for true. Is there a compiler flag to force boolean types to emit 1 instead of -1? If so, would there possibly be any side effects with other

Re: [fpc-pascal] testing if a float has a fractional part

2018-05-15 Thread Sven Barth via fpc-pascal
Bart schrieb am Di., 15. Mai 2018, 13:22: > On Sun, May 13, 2018 at 3:40 PM, Jonas Maebe wrote: > > The only proper way is to use something like Math.SameValue(x, int(x)). > > B.t.w. the test suite for the new Int() function (win64) > ( >

Re: [fpc-pascal] Undocumented SetLength functionality

2018-05-15 Thread Sven Barth via fpc-pascal
Torsten Bonde Christiansen schrieb am Di., 15. Mai 2018, 12:03: > Is this a feature, bug or undocumented behaviour? > This is a feature and absolutely by design. > Afair, this was allowed back in Delphi7 (which is where i copied some of > my old code from), but i'm not sure

Re: [fpc-pascal] FPC on gaming consoles: XBox One, PlayStation 4, Nintendo Switch

2018-05-10 Thread Sven Barth via fpc-pascal
Am 10.05.2018 um 00:41 schrieb Michalis Kamburelis: Hi, I am wondering about the possibility to port Castle Game Engine to modern gaming consoles. For PlayStation and Nintendo Switch regarding the GPL/NDA stuff you might want to ask them directly: Sony:

Re: [fpc-pascal] FPC on gaming consoles: XBox One, PlayStation 4, Nintendo Switch

2018-05-10 Thread Sven Barth via fpc-pascal
Michalis Kamburelis schrieb am Do., 10. Mai 2018, 05:47: > 2018-05-10 4:08 GMT+02:00 Marco van de Voort : > > In our previous episode, Michalis Kamburelis said: > >> > >> 1. XBox One. It uses an operating system based on Windows 10. As such, > >> maybe

Re: [fpc-pascal] Feature announcement: default namespaces

2018-05-07 Thread Sven Barth via fpc-pascal
Am 07.05.2018 um 10:35 schrieb Mattias Gaertner: [...] The compiler is told about a default namespace using the new -FN parameter, Lazarus now checks for the -FN flag in the custom compiler options. Can you add a message similar to "Using unit path:"? Then Lazarus can find out what default

Re: [fpc-pascal] Feature announcement: default namespaces

2018-05-07 Thread Sven Barth via fpc-pascal
Marco van de Voort <mar...@stack.nl> schrieb am Mo., 7. Mai 2018, 11:51: > In our previous episode, Sven Barth via fpc-pascal said: > > > > > > I'm not sure what are 'all similar -F parameters', but many -F > parameters > > > allow multiple semicolon s

Re: [fpc-pascal] Feature announcement: default namespaces

2018-05-07 Thread Sven Barth via fpc-pascal
Mattias Gaertner <nc-gaert...@netcologne.de> schrieb am Mo., 7. Mai 2018, 10:35: > On Sat, 5 May 2018 19:23:04 +0200 > Sven Barth via fpc-pascal <fpc-pascal@lists.freepascal.org> wrote: > > >[...] > > I'm pleased to announce the implementation of a new feature:

Re: [fpc-pascal] Feature announcement: default namespaces

2018-05-06 Thread Sven Barth via fpc-pascal
Am 05.05.2018 um 19:53 schrieb Tomas Hajny: On Sat, May 5, 2018 19:23, Sven Barth via fpc-pascal wrote: Hi Sven, . . (e.g. "MyUnits" or "FCL.XML" or "FCL.Web.Base"). Like with all similar -F parameters -FN only takes a single value, but can be specified

Re: [fpc-pascal] Feature announcement: default namespaces

2018-05-06 Thread Sven Barth via fpc-pascal
Tomas Hajny <xhaj...@hajny.biz> schrieb am Sa., 5. Mai 2018, 19:52: > On Sat, May 5, 2018 19:23, Sven Barth via fpc-pascal wrote: > > > Hi Sven, > > . > . > > (e.g. "MyUnits" or "FCL.XML" or "FCL.Web.Base"). Like with all s

Re: [fpc-pascal] Feature announcement: default namespaces

2018-05-06 Thread Sven Barth via fpc-pascal
Ryan Joseph schrieb am So., 6. Mai 2018, 09:16: > > > > On May 6, 2018, at 1:46 PM, Mattias Gaertner > wrote: > > > > He meant: > > If you use units with namespaces and you can't use the -FN option, then > > it becomes cumbersome to write

Re: [fpc-pascal] Feature announcement: default namespaces

2018-05-06 Thread Sven Barth via fpc-pascal
Ben Grasset schrieb am So., 6. Mai 2018, 03:16: > Cool I guess. Kind of seems not very important at all though. FPC lacks > compatibility with current Delphi in various other far more significant > areas... > It was something that was relatively easy to implement and what

Re: [fpc-pascal] Feature announcement: default namespaces

2018-05-05 Thread Sven Barth via fpc-pascal
Michael Van Canneyt <mich...@freepascal.org> schrieb am Sa., 5. Mai 2018, 21:24: > > > On Sat, 5 May 2018, Sven Barth via fpc-pascal wrote: > > > Hello together! > > > > I'm pleased to announce the implementation of a new feature: default > > namespaces.

[fpc-pascal] Feature announcement: default namespaces

2018-05-05 Thread Sven Barth via fpc-pascal
Hello together! I'm pleased to announce the implementation of a new feature: default namespaces. As you may know FPC supports the use of dots/points/periods (".") inside unit (and program/library) names which allows to avoid name collisions with a syntax similar to other languages like Java

Re: [fpc-pascal] pas2js Webgl unit committed

2018-05-02 Thread Sven Barth via fpc-pascal
Ryan Joseph schrieb am Do., 3. Mai 2018, 04:54: > Can someone put a simple guide to building on the wiki? I tried to build > from my existing FPC sources and got this error. I never got UNIX down well > so I don’t know what else I’m supposed to do besides cd to the

Re: [fpc-pascal] pas2js Webgl unit committed

2018-05-02 Thread Sven Barth via fpc-pascal
Ryan Joseph schrieb am Mi., 2. Mai 2018, 15:57: > > class TJSWebGL2RenderingContextBase = external name > 'WebGL2RenderingContextBase' (TJSObject) > It's "Typename = class external name 'foobar' (Basetype)", not "class Typename = external name 'foobar' (Basetype)".

Re: [fpc-pascal] Stack alias for ARC like memory management?

2018-04-25 Thread Sven Barth via fpc-pascal
Ryan Joseph schrieb am Mi., 25. Apr. 2018, 15:38: > Certainly this is a crutch because there isn’t a full ARC system. I see it > as an easy solution and a quick fix to get a little more utility out of the > language without overhauling everything. What you are

Re: [fpc-pascal] Stack alias for ARC like memory management?

2018-04-25 Thread Sven Barth via fpc-pascal
Ryan Joseph schrieb am Mi., 25. Apr. 2018, 03:46: > What do you think? Is there any merit to this idea? It’s not real > reference counting but it’s a simple solution to improve performance and > clean up code in many common scenarios. > No. This would more often than

Re: [fpc-pascal] Multiple active class helpers at same time

2018-04-24 Thread Sven Barth via fpc-pascal
Ryan Joseph <r...@thealchemistguild.com> schrieb am Di., 24. Apr. 2018, 10:44: > > > > On Apr 24, 2018, at 12:48 PM, Sven Barth via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > > > > Because that is how helper currently work. Extending

Re: [fpc-pascal] Multiple active class helpers at same time

2018-04-23 Thread Sven Barth via fpc-pascal
Ryan Joseph <r...@thealchemistguild.com> schrieb am Di., 24. Apr. 2018, 04:03: > > > > On Apr 24, 2018, at 12:57 AM, Sven Barth via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > > > > As I said the problem arises when inheritance enters the f

Re: [fpc-pascal] Multiple active class helpers at same time

2018-04-23 Thread Sven Barth via fpc-pascal
LacaK schrieb am Mo., 23. Apr. 2018, 15:22: > > > >> Is planned support for multiple class(objet, record) helpers in a way, >> that all class helpers can be used in parallel not only one? >> > > Yes, it is planned. Main problem currently (aside from time) is to define > when a

Re: [fpc-pascal] Multiple active class helpers at same time

2018-04-23 Thread Sven Barth via fpc-pascal
LacaK schrieb am Mo., 23. Apr. 2018, 13:34: > Hi , > > I am sure that this was already discussed, but I can not find any > conclusion. > > Is planned support for multiple class(objet, record) helpers in a way, > that all class helpers can be used in parallel not only one? >

Re: [fpc-pascal] Using constants instead of comments

2018-04-17 Thread Sven Barth via fpc-pascal
James Richters schrieb am Mi., 18. Apr. 2018, 05:00: > I have a whole section of diagnostic writeln's in a program, and it's > tedious to comment them all out/in as needed. I'm curious if doing > something like > > Const >diagnosticdetail=false; > > If

Re: [fpc-pascal] Proposal for new Free Pascal logo

2018-04-02 Thread Sven Barth via fpc-pascal
Mark Morgan Lloyd schrieb am Mo., 2. Apr. 2018, 15:13: > On 02/04/18 09:45, Michael Van Canneyt wrote: > > > remove the whiskers. > > As an exercise I have done the job for you. See here: > > http://www.freepascal.org/~michael/pascal_logo2.png > > It's of

Re: [fpc-pascal] Managed record questions

2018-03-09 Thread Sven Barth via fpc-pascal
Am 09.03.2018 16:41 schrieb "Ryan Joseph" <r...@thealchemistguild.com>: > On Mar 9, 2018, at 4:51 PM, Sven Barth via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > > Objects share roughly as much code with records as classes do as internally classes and o

Re: [fpc-pascal] Managed record questions

2018-03-09 Thread Sven Barth via fpc-pascal
Am 09.03.2018 10:14 schrieb "Ryan Joseph" : > >> 4) Move() on an object copies memory like a record (as a record does, so this is good). Does that mean they laid out in memory just like records? > > Yes, although I believe there is a hidden VMT field. Not sure how

Re: [fpc-pascal] Managed record questions

2018-03-08 Thread Sven Barth via fpc-pascal
Am 09.03.2018 05:14 schrieb "Ryan Joseph" : > On Mar 9, 2018, at 10:32 AM, Michael Van Canneyt wrote: > > Why don't you use objects ? No-one has obsoleted this, and you get what you > want: an object that can be allocated on the stack or on

Re: [fpc-pascal] Managed record questions

2018-03-08 Thread Sven Barth via fpc-pascal
Am 08.03.2018 12:51 schrieb "Ryan Joseph" <r...@thealchemistguild.com>: > On Mar 8, 2018, at 5:42 PM, Sven Barth via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > > You are supposed to use try...finally for this. The finally-block is always executed when

Re: [fpc-pascal] Managed record questions

2018-03-08 Thread Sven Barth via fpc-pascal
Am 08.03.2018 09:44 schrieb "Ryan Joseph" : 2) We need to remember to call Free() at the end of the function and take precaution to not exit early and leak memory (maybe even using a goto to break out of nested loops or nested functions, who knows). You are supposed

Re: [fpc-pascal] Managed record questions

2018-03-08 Thread Sven Barth via fpc-pascal
Am 08.03.2018 08:33 schrieb "Maciej Izak" : No, this doesn't beg the question, because Object Pascal classes are > designed in the principle to reduce on the heap. Changing this would not > only mean quite some changes in the compiler/RTL with no real gain, but it > would

Re: [fpc-pascal] Managed record questions

2018-03-07 Thread Sven Barth via fpc-pascal
Am 08.03.2018 04:44 schrieb "Ryan Joseph" : 1) Given the example below we have a template for a standard ref counted record. Shouldn’t there be some “meta record” type that implements this automatically? I’m thinking about adding this to some types but the idea of

Re: [fpc-pascal] procedure and function parameters?

2018-03-04 Thread Sven Barth via fpc-pascal
On 04.03.2018 18:06, Bernd Oppolzer wrote: > Are procedure and function parameters allowed in Free Pascal? > > When I tried to compile the Man-or-boy example program (Knuth's test), > FPC complained with a syntax error: > > > c:\work\pascal\work>fpc manorboy.pas > Free Pascal Compiler version

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

2018-02-21 Thread Sven Barth via fpc-pascal
Am 21.02.2018 09:48 schrieb "Ryan Joseph" : > On Feb 21, 2018, at 2:57 PM, Michael Van Canneyt wrote: > > The job of the compiler is to create correct code. Not to ensure you write readable code. Every feature that is introduced > offers more

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

2018-02-20 Thread Sven Barth via fpc-pascal
Am 21.02.2018 04:09 schrieb "Ryan Joseph" : Is this a missing feature or do you need to enable it or something? There is none. The compiler does not know the type of the parameter, because overload selection occurs only after all parameters have been parsed. So

Re: [fpc-pascal] Operator overload resolution with arrays

2018-02-05 Thread Sven Barth via fpc-pascal
Am 05.02.2018 17:50 schrieb "Martok" : Am 05.02.2018 um 15:49 schrieb Maciej Izak: > for example final code for TFoo< TSomeArray> will be different than for > TFoo declared in other module (!). Crap. True. Now I see why it is how it is. The maximum extent would be to

Re: [fpc-pascal] Operator overload resolution with arrays

2018-02-05 Thread Sven Barth via fpc-pascal
Am 05.02.2018 15:49 schrieb "Maciej Izak" : specialization for the same generic type can behaves in different way! for example final code for TFoo< TSomeArray> will be different than for TFoo declared in other module (!). What if TFoo has some class var + class constructor ?

Re: [fpc-pascal] Operator overload resolution with arrays

2018-02-05 Thread Sven Barth via fpc-pascal
Am 05.02.2018 13:02 schrieb "Martok" : Hi all, I'm having some logical problems with fgl generic lists and operator overloads. This is essentially the same issue as discussed last year on the forum as . I know

Re: [fpc-pascal] Is there a smart way to save/restore NotifyEvents and objects?

2018-02-03 Thread Sven Barth via fpc-pascal
Am 03.02.2018 10:08 schrieb "Michael Van Canneyt" <mich...@freepascal.org>: On Sat, 3 Feb 2018, Sven Barth via fpc-pascal wrote: Am 03.02.2018 09:11 schrieb "Michael Van Canneyt" <mich...@freepascal.org>: > > > > On Sat, 3 Feb 2018, Dennis Poon w

Re: [fpc-pascal] Is there a smart way to save/restore NotifyEvents and objects?

2018-02-03 Thread Sven Barth via fpc-pascal
Am 03.02.2018 09:11 schrieb "Michael Van Canneyt" : On Sat, 3 Feb 2018, Dennis Poon wrote: >> >> If your objects inherit from TComponent and you use published properties >> you can use the streaming screen of the RTL. >> >> I am curious how TComponent save and restore

Re: [fpc-pascal] Is there a smart way to save/restore NotifyEvents and objects?

2018-02-02 Thread Sven Barth via fpc-pascal
Am 02.02.2018 17:53 schrieb "Dennis" : I have list of objects which contains references to other objects. I need to save all these objects to harddisk to be restored on a latter day. I know how to stream the data fields of these objects to a TFileStream but the tricky part

Re: [fpc-pascal] question about _fpc_local_unwind

2018-02-02 Thread Sven Barth via fpc-pascal
Am 02.02.2018 18:12 schrieb "Matias Vara" <matiasev...@gmail.com>: Hello, 2018-02-02 17:17 GMT+01:00 Sven Barth via fpc-pascal < fpc-pascal@lists.freepascal.org>: > Am 02.02.2018 15 <02%2002%2020%2018%2015>:50 schrieb "Matias Vara" < > matia

Re: [fpc-pascal] question about _fpc_local_unwind

2018-02-02 Thread Sven Barth via fpc-pascal
Am 02.02.2018 15:50 schrieb "Matias Vara" : Thanks for the answer, I will imitate in Toro the behavior of Win64. Maybe it wound be better if you try to use the i386-embedded or x86_64-embedded targets. The non-embedded targets are simply not geared towards usage on a bare

Re: [fpc-pascal] _Release call location for unused function results

2018-01-30 Thread Sven Barth via fpc-pascal
Am 30.01.2018 15:07 schrieb "Maciej Izak" : > > question is: would we like to enabling this for all Delphi modes? > > Everything that needs this is essentially feature abuse. I would not enable > it by default +1 . Anyway I am still considering : commit or not :P. While

Re: [fpc-pascal] Range checks

2018-01-27 Thread Sven Barth via fpc-pascal
On 27.01.2018 15:10, C Western wrote: > The following innocuous looking code generates a range check error: > > {$R+} > function Count: qword; > begin >   Result := 0; > end; > var >   i: Integer; > begin >   for i := 0 to Count-1 do >     WriteLn(i); > end. > > I can (more or less) see why, but

Re: [fpc-pascal] Dynamic Packages

2018-01-22 Thread Sven Barth via fpc-pascal
Am 22.01.2018 18:19 schrieb "Anthony Walter" : What's the current development status on loading/unloading packages dynamically? Generating metadata required for the loading of a package as well as extending the RTL for dynamically loaded units are the two main items that are

[fpc-pascal] fcl-web on Microsoft's kernel mode HTTP(S) server

2018-01-19 Thread Sven Barth via fpc-pascal
Hello together! In revision 38013 I extended fcl-web with the support to use it together with Microsoft's kernel mode HTTP(S) server (aka http.sys). What does this mean? First of that doesn't mean that you're running kernel mode code. Instead http.sys receives requests to the ports it observes

Re: [fpc-pascal] directive for -CR

2018-01-18 Thread Sven Barth via fpc-pascal
Am 19.01.2018 01:55 schrieb "Mattias Gaertner" : Hi, Is there a compiler directive to enable/disable method call and typecast checks (option -CR). Similar to $R+- for range checks? It's {$ObjectChecks On/Off/+/-}. See here:

Re: [fpc-pascal] AppImage

2018-01-16 Thread Sven Barth via fpc-pascal
Am 16.01.2018 22:58 schrieb "Rainer Stratmann" <rainerstratm...@t-online.de >: Am Dienstag, 16. Januar 2018, 22:41:34 schrieb Sven Barth via fpc-pascal: > This won't work in the more diverse > Linux world where users are more free to decide. But if you take a closer

Re: [fpc-pascal] AppImage

2018-01-16 Thread Sven Barth via fpc-pascal
Am 16.01.2018 20:41 schrieb "Graeme Geldenhuys" < mailingli...@geldenhuys.co.uk>: On 2018-01-16 06:51, Sven Barth via fpc-pascal wrote: > So, yeah, I'm definitely skeptical about such approaches. > All valid points. But if it was such a big concern, then why was Apple happ

Re: [fpc-pascal] AppImage

2018-01-15 Thread Sven Barth via fpc-pascal
Am 16.01.2018 00:50 schrieb "Graeme Geldenhuys" < mailingli...@geldenhuys.co.uk>: On 2018-01-15 20:54, Michael Van Canneyt wrote: > It's nothing but a zip with the needed dependencies. > More precisely, they use a standard ISO image that gets loop mounted. Simply rename any *.AppImage

Re: [fpc-pascal] Dot syntax for types?

2018-01-14 Thread Sven Barth via fpc-pascal
On 14.01.2018 16:19, Michael Van Canneyt wrote: > > > On Sun, 14 Jan 2018, Sven Barth via fpc-pascal wrote: > >> On 14.01.2018 09:56, Michael Van Canneyt wrote: >>> >>> >>> On Sun, 14 Jan 2018, Ryan Joseph wrote: >>> >>>>

Re: [fpc-pascal] Dot syntax for types?

2018-01-14 Thread Sven Barth via fpc-pascal
On 14.01.2018 09:56, Michael Van Canneyt wrote: > > > On Sun, 14 Jan 2018, Ryan Joseph wrote: > >> I remember I heard about a mode switch that requires "type groups” >> (what are these called btw?) to use a . and be prefixed. For example: >> >> type >> TGLType = (GL_FLOAT,

Re: [fpc-pascal] Dot syntax for types?

2018-01-14 Thread Sven Barth via fpc-pascal
Am 14.01.2018 03:42 schrieb "Ryan Joseph" : I remember I heard about a mode switch that requires "type groups” (what are these called btw?) to use a . and be prefixed. For example: type TGLType = (GL_FLOAT, GL_UNSIGNED_BYTE); TGLType.GL_FLOAT would be the

Re: [fpc-pascal] Compiler hangs while generating debug information

2018-01-11 Thread Sven Barth via fpc-pascal
Am 11.01.2018 18:47 schrieb "Nitorami" : Any opinions ? You can try to minimize your source by removing parts to see what might cause the problem. Alternatively you can debug the compiler in Lazarus. Regards, Sven ___

Re: [fpc-pascal] PAS2JS: operations with array of record

2018-01-11 Thread Sven Barth via fpc-pascal
Am 11.01.2018 13:33 schrieb "Mattias Gaertner" : On Wed, 10 Jan 2018 11:40:48 -0700 (MST) warleyalex via fpc-pascal wrote: >[...] > · Add(item [,...]) / Push(item [,...]) : increases Length by one and adds one or more item at the end

Re: [fpc-pascal] PAS2JS: operations with array of record

2018-01-11 Thread Sven Barth via fpc-pascal
Am 11.01.2018 08:16 schrieb "warleyalex via fpc-pascal" < fpc-pascal@lists.freepascal.org>: Anyway, what I couldn't find is the built-in kind of *pseudo-methods for the record data type*, set of operations, for inserting, removing, sorting and otherwise manipulate the content, for instance:

Re: [fpc-pascal] Generics vs templates

2018-01-11 Thread Sven Barth via fpc-pascal
Am 11.01.2018 08:06 schrieb "Michael Schnell" <mschn...@lumino.de>: On 09.01.2018 08:04, Sven Barth via fpc-pascal wrote: But you need to program in a way that allows the usage of multiple, different types. That can more often than not lead to worse performance. Seemingly it

Re: [fpc-pascal] Generics vs templates

2018-01-09 Thread Sven Barth via fpc-pascal
Am 10.01.2018 05:10 schrieb "Ryan Joseph" : > On Jan 10, 2018, at 6:37 AM, Graeme Geldenhuys < mailingli...@geldenhuys.co.uk> wrote: > > When using the Generics.Collections unit of Delphi I can define a list class that can hold Integer data types, by doing the

Re: [fpc-pascal] Generics vs templates

2018-01-09 Thread Sven Barth via fpc-pascal
Am 10.01.2018 07:39 schrieb "Marco van de Voort" <mar...@stack.nl>: In our previous episode, Sven Barth via fpc-pascal said: > Precisely these virtual methods are one point. They might not add much by > themselves, but if they're called for each Add or Remove operation they

Re: [fpc-pascal] Generics vs templates

2018-01-09 Thread Sven Barth via fpc-pascal
Am 09.01.2018 08:13 schrieb "Ryan Joseph" <r...@thealchemistguild.com>: > On Jan 9, 2018, at 2:04 PM, Sven Barth via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > > But you need to program in a way that allows the usage of multiple, different types. Th

Re: [fpc-pascal] Generics vs templates

2018-01-08 Thread Sven Barth via fpc-pascal
Am 09.01.2018 02:59 schrieb "Ryan Joseph" : > On Jan 9, 2018, at 3:30 AM, Graeme Geldenhuys < mailingli...@geldenhuys.co.uk> wrote: > > Recently I did a very simple test with Delphi XE3 using TList and a stock TList. Adding 50,000 and 200,000 integer values to each

Re: [fpc-pascal] Generics vs templates

2018-01-08 Thread Sven Barth via fpc-pascal
Am 08.01.2018 12:52 schrieb "Ryan Joseph" <r...@thealchemistguild.com>: > On Jan 8, 2018, at 5:58 PM, Sven Barth via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > > FPC essentially reparses a generic during specialization so I'd say that they definitel

<    4   5   6   7   8   9   10   11   12   >