Re: [fpc-pascal] Linux GTK-2 GUI app

2020-09-01 Thread Adriaan van Os via fpc-pascal
leledumbo via fpc-pascal wrote: Or create different packages for different distros ? If you can afford the maintenance burden, this is the best that every specific distro user will love. Otherwise, just provide a compressed archive with README inside. What about flatpak or snap-pak packages

[fpc-pascal] Linux GTK-2 GUI app

2020-08-31 Thread Adriaan van Os via fpc-pascal
Any recommendations for distributing a FPC gtk-2 GUI app on Linux ? I would prefer it to be as simple as possible. Use something like AppImage ? Create a .desktop file? Or create different packages for different distros ? The application consists of an executable and a folder with .html and

Re: [fpc-pascal] Linux GTK-2 GUI app

2020-08-31 Thread Adriaan van Os via fpc-pascal
Michael Van Canneyt wrote: This is a puzzling sentence: "From the Linux Terminal only" - As opposed to what ? I meant to say that, without a .desktop file, the app is not double-clickable. Regards, Adriaan van Os ___ fpc-pascal maillist -

Re: [fpc-pascal] Linux GTK-2 GUI app

2020-09-01 Thread Adriaan van Os via fpc-pascal
Michael Van Canneyt wrote: Normally a zip file with a the binary and supporing files, plus a README file should be enough. Can you refer me to an example ? Thanks, Adriaan van Os ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org

[fpc-pascal] x86-linux-gnu cross

2020-09-01 Thread Adriaan van Os via fpc-pascal
On Mac OS X 10.8, I have built an fpc-3.0.4 runtime-library for CPU_TARGET=x86_64 OS_TARGET=linux BINUTILSPREFIX=x86_64-linux-gnu- after building gnu binutils-2.34 for --target=x86_64-linux-gnu --host=i686-apple-darwin --build=i686-apple-darwin --prefix=/usr/local. Now the following program

[fpc-pascal] Coalition for App Fairness

2020-09-25 Thread Adriaan van Os via fpc-pascal
Leading App Developers Form The Coalition for App Fairness to Promote Competition and Protect Innovation on Digital Platforms Regards, Adriaan van Os ___

[fpc-pascal] Statically linked-in fpc code

2021-02-04 Thread Adriaan van Os via fpc-pascal
I am getting crashes on Mac OS X 10.8.5 in a C-program with statically linked-in fpc code. The crashes seem related to fpc unit initialisation. This happens with fpc-3.2.0 but not when compiling the same code with fpc-3.0.4. Has something changed from 3.0.4 to 3.2.0 related to unit

Re: [fpc-pascal] Statically linked-in fpc code

2021-02-05 Thread Adriaan van Os via fpc-pascal
Adriaan van Os via fpc-pascal wrote: Jonas Maebe via fpc-pascal wrote: On 2021-02-05 09:24, Adriaan van Os via fpc-pascal wrote: It's crazy ! <https://bugs.freepascal.org/view.php?id=38440> The default fpc.cfg file contains this (both in 3.0.4 and 3.2.0): Thanks for tne

Re: [fpc-pascal] Statically linked-in fpc code

2021-02-05 Thread Adriaan van Os via fpc-pascal
Jonas Maebe via fpc-pascal wrote: On 04/02/2021 21:26, Adriaan van Os via fpc-pascal wrote: I am getting crashes on Mac OS X 10.8.5 in a C-program with statically linked-in fpc code. The crashes seem related to fpc unit initialisation. This happens with fpc-3.2.0 but not when compiling the same

Re: [fpc-pascal] Statically linked-in fpc code

2021-02-05 Thread Adriaan van Os via fpc-pascal
Jonas Maebe via fpc-pascal wrote: On 2021-02-05 09:24, Adriaan van Os via fpc-pascal wrote: It's crazy ! <https://bugs.freepascal.org/view.php?id=38440> The default fpc.cfg file contains this (both in 3.0.4 and 3.2.0): Thanks for tne reply. # For a debug version compile with deb

Re: [fpc-pascal] Statically linked-in fpc code

2021-02-05 Thread Adriaan van Os via fpc-pascal
Michael Van Canneyt via fpc-pascal wrote: Not sure where the 1.3.31 came from, but stack checking is mentioned in 1.7.72; For fpc-3.0.4 stack stacking is mentioned in 1.3.31 as a global directive. For 3.2.0 stack checking is indeed mentioned in 1.2.72 as a local directive. If the directive

Re: [fpc-pascal] Traits Proposal

2021-02-10 Thread Adriaan van Os via fpc-pascal
Michael Van Canneyt via fpc-pascal wrote: On Tue, 9 Feb 2021, Ryan Joseph via fpc-pascal wrote: We had talked about this some time ago and it's been rattling around in my brain so I wanted to write it down into a formal proposal where we can discuss it and hopefully agree upon a syntax.

[fpc-pascal] FPC PasCocoa/Differences

2021-03-27 Thread Adriaan van Os via fpc-pascal
The FPC PasCocoa/Differences wiki writes about ObjC class extensions: "You can use regular (non-external) categories defined in the implementation of a unit instead of class extensions, as the effect will be the same." However,

Re: [fpc-pascal] FPC PasCocoa/Differences

2021-03-27 Thread Adriaan van Os via fpc-pascal
Jonas Maebe via fpc-pascal wrote: You are correct. OTOH, it feels kind of useless in general, because "A class extension bears some similarity to a category, but it can only be added to a class for which you have the source code at compile time (the class is compiled at the same time as the

Re: [fpc-pascal] Unicode chars losing information

2021-03-08 Thread Adriaan van Os via fpc-pascal
adriaan% cat uniquizz-utf8.pas {$codepage utf8} program uniquizz; var chars: UnicodeString; begin chars := '⌘ key'; writeln(chars); writeln(chars[1]); writeln( 'size ', sizeOf( chars)); writeln( 'length ', length( chars)); end. adriaan% fpc uniquizz-utf8.pas -FcUTF-8 Free Pascal

Re: [fpc-pascal] Unicode chars losing information

2021-03-08 Thread Adriaan van Os via fpc-pascal
Michael Van Canneyt wrote: The output for me is the same, regardless of the -FcUTF-8 flag being present or not: question marks. But if I add uses cwstring; all will be well. Rationale: Without that, the RTL cannot convert whatever the compiler wrote in the binary to UTF8 to display it on

Re: [fpc-pascal] Traits Proposal

2021-02-17 Thread Adriaan van Os via fpc-pascal
To streamline the discussion, let me recapitulate: 1. multiple inheritance is nice to have, but it has the big issue that the inheritance tree becomes an inheritance graph and that makes overrules ambiguent. 2. interfaces don't have this issue with multiple inheritance, because they just

[fpc-pascal] Not available duties

2021-12-24 Thread Adriaan van Os via fpc-pascal
I got a message from UPS this morning stating "! Duties, taxes, and fees totaling NaN are due for this delivery." Oops, I don't hope I will ever get a message from UPS "! Duties, taxes, and fees totaling INF are due for this delivery." and with that I wish everybody a merry

Re: [fpc-pascal] Caller agnostic procedure variables

2022-02-16 Thread Adriaan van Os via fpc-pascal
Sven Barth via fpc-pascal wrote: "However assigning a nested function variable to a function reference is much harder. Assigning a function reference to a nested function variable is hard as well. " "is nested" means that the actual function passed can be either global or

Re: [fpc-pascal] All methods vitrual ?

2023-10-16 Thread Adriaan van Os via fpc-pascal
That's absurd, there are many features in modes objfpc and macpas that don't compile with Delphi. That doesn't make it any less true. Also we won't add it anyway, so... 路‍♀️ Apperently, a sensible discussion, based on logical arguments, instead of dogma, is impossible. Adriaan

Re: [fpc-pascal] All methods vitrual ?

2023-10-11 Thread Adriaan van Os via fpc-pascal
Michael Van Canneyt via fpc-pascal wrote: $M controls the inclusion of RTTI, i.e. it allows or disallows the use of the published section. No more, no less. I don't see any use in allowing or disallowing something. And with the current design, it is, as I said, impossible, without macros,

Re: [fpc-pascal] All methods vitrual ?

2023-10-13 Thread Adriaan van Os via fpc-pascal
Michael Van Canneyt via fpc-pascal wrote: On Wed, 11 Oct 2023, Adriaan van Os via fpc-pascal wrote: Michael Van Canneyt via fpc-pascal wrote: $M controls the inclusion of RTTI, i.e. it allows or disallows the use of the published section. No more, no less. I don't see any use

Re: [fpc-pascal] All methods vitrual ?

2023-10-13 Thread Adriaan van Os via fpc-pascal
Martin Frb via fpc-pascal wrote: On 11/10/2023 16:46, Adriaan van Os via fpc-pascal wrote: I don't see any use in allowing or disallowing something. And with the current design, it is, as I said, impossible, without macros, to compile the same code with {$M+} and {$M-}. Use $IfOpt instead

Re: [fpc-pascal] All methods vitrual ?

2023-10-15 Thread Adriaan van Os via fpc-pascal
Sven Barth via fpc-pascal wrote: There will be no new visibility specifiers for something like this. And yes, it affects compatibility, as that means that code using that feature couldn't be compiled with Delphi and especially for library developers that might be an important point. That's

Re: [fpc-pascal] A new FP-like fork of Oberon

2023-10-27 Thread Adriaan van Os via fpc-pascal
Liam Proven via fpc-pascal wrote: On Thu, 26 Oct 2023 at 08:57, Adriaan van Os via fpc-pascal wrote: It might interest you that I ported the Oberon-0 compiler, from the book Compiler Construction, to FreePascal. It does indeed! Is that FOSS? Is the code anywhere online? There are still

Re: [fpc-pascal] Compiler probem?

2023-11-05 Thread Adriaan van Os via fpc-pascal
Paul Renaud via fpc-pascal wrote: Hi, I have a question about some code. The following code segment generated a compiler error when I compiled it with... "A compiler error" assumes that we all have a crystal ball to look in Regards, Adriaan van Os

Re: [fpc-pascal] A new FP-like fork of Oberon

2023-10-26 Thread Adriaan van Os via fpc-pascal
Liam Proven via fpc-pascal wrote: https://github.com/mikewarot/OberonSystem3FP It might interest you that I ported the Oberon-0 compiler, from the book Compiler Construction, to FreePascal. I guess this thread should be on fpc-other. Regards, Adriaan van Os

Re: [fpc-pascal] All methods vitrual ?

2023-10-10 Thread Adriaan van Os via fpc-pascal
Hairy Pixels via fpc-pascal wrote: On Oct 10, 2023, at 4:18 PM, Adriaan van Os via fpc-pascal wrote: Interesting ! If I am correct, the docs referred to at <https://gitlab.com/freepascal.org/fpc/source/-/issues/38964> say ; visibility-clause: ; METHODS|PROPERTIES|FIELDS (visi

Re: [fpc-pascal] All methods vitrual ?

2023-10-10 Thread Adriaan van Os via fpc-pascal
Sven Barth via fpc-pascal wrote: No. Only those in the published section are part of the vMethodTable. And when compiled with $M+ the default visibility is changed from public to published. Also, I can get a list of the interfaces inherited from by a class, by looking at the vIntfTable of

Re: [fpc-pascal] All methods vitrual ?

2023-10-10 Thread Adriaan van Os via fpc-pascal
Michael Van Canneyt via fpc-pascal wrote: On Mon, 9 Oct 2023, Adriaan van Os via fpc-pascal wrote: Is there a trick to make (in mode macpas) all class methods implicitely virtual ? I mean, without adding the virtual keyword to all of them ? The reason is that I want to create a tree view

[fpc-pascal] All methods vitrual ?

2023-10-09 Thread Adriaan van Os via fpc-pascal
Is there a trick to make (in mode macpas) all class methods implicitely virtual ? I mean, without adding the virtual keyword to all of them ? The reason is that I want to create a tree view of the class hierarchy with all the method names (not just those that are normally in the VMT because they

[fpc-pascal] All methods vitrual ?

2023-10-09 Thread Adriaan van Os via fpc-pascal
Is there a trick to make (in mode macpas) all class methods implicitely virtual ? I mean, without adding the virtual keyword to all of them ? The reason is that I want to create a tree view of the class hierarchy with all the method names (not just those that are normally in the VMT because they

Re: [fpc-pascal] All methods vitrual ?

2023-10-11 Thread Adriaan van Os via fpc-pascal
Sven Barth via fpc-pascal wrote: Ah, yes, only classes and interfaces can be used for published fields. For properties anything is allowed. However, what makes the whole thing unuseable is that with {$M-} the compiler doesn't accept "published". So, without using macros, the same source

Re: [fpc-pascal] All methods vitrual ?

2023-10-10 Thread Adriaan van Os via fpc-pascal
Sven Barth via fpc-pascal wrote: Am 10.10.2023 um 11:18 schrieb Adriaan van Os via fpc-pascal: - In the released compiler, if you remove all visibility specifiers, you can get a list by specifying {$M+} on your base object and then list all published methods using the RTTI. My

Re: [fpc-pascal] All methods vitrual ?

2023-10-09 Thread Adriaan van Os via fpc-pascal
Sven Barth via fpc-pascal wrote: No. Only those in the published section are part of the vMethodTable. And when compiled with $M+ the default visibility is changed from public to published. OK, but that means that by explicitely specifying public/private/protected for fields and published

Re: [fpc-pascal] Barriers semantics

2023-08-15 Thread Adriaan van Os via fpc-pascal
Jonas Maebe via fpc-pascal wrote: See e.g. the explanation of "data dependency barrier" at https://www.sobyte.net/post/2022-08/cpu-cache-and-memory-barriers/ . In Interesting stuff to read. Regards, Adriaan van Os ___ fpc-pascal maillist -

[fpc-pascal] overriden or not ?

2023-08-18 Thread Adriaan van Os via fpc-pascal
Is there a way to see if a specific class/object method has been overridden or not ? Regards, Adriaan van Os ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] overriden or not ?

2023-08-18 Thread Adriaan van Os via fpc-pascal
Bart via fpc-pascal wrote: On Fri, Aug 18, 2023 at 10:21 AM Adriaan van Os via fpc-pascal wrote: Is there a way to see if a specific class/object method has been overridden or not ? There's an example of this in Lazarus Controls unit: // Check if SetTextBuf is overridden, otherwise

Re: [fpc-pascal] Access Violation When SetLength(DynArray, Value)

2022-09-09 Thread Adriaan van Os via fpc-pascal
Peter B via fpc-pascal wrote: I suggest trying without optimisations and/or using cmem, to see if that changes the outcome. I would rather use a system memory debugger to find the cause of the corruption. Regards, Adriaan van Os

Re: [fpc-pascal] iOS

2022-10-06 Thread Adriaan van Os via fpc-pascal
OK, thanks, Adriaan van Os On Oct 6, 2022, at 7:12 PM, Adriaan van Os via fpc-pascal wrote: I would be pleased to know where I can find the latest iOS parsed headers and possibly a hello program. Also, the cross compilers for iOS don't seem to be available at <ht

[fpc-pascal] iOS

2022-10-06 Thread Adriaan van Os via fpc-pascal
I would be pleased to know where I can find the latest iOS parsed headers and possibly a hello program. Also, the cross compilers for iOS don't seem to be available at on any of the listed mirrors. Regards, Adriaan van Os

Re: [fpc-pascal] iOS

2022-10-07 Thread Adriaan van Os via fpc-pascal
Jonas Maebe via fpc-pascal wrote: Unless you need FPC 3.2.2-specific fixes, you can probably just use FPC 3.2.0 instead for iOS. OK, I will do that, thanks. Adriaan van Os ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org

Re: [fpc-pascal] Working on a new way to educate people about pascal

2022-12-29 Thread Adriaan van Os via fpc-pascal
Anthony Walter via fpc-pascal wrote: Hi guys, I had a new idea for an interface design to help people who either are not into programming yet or have only used a language other than Free Pascal. Please see this draft Introduction to Free Pascal web page I posted this morning. Well, I still

Re: [fpc-pascal] Oberon-0

2023-04-19 Thread Adriaan van Os via fpc-pascal
Ralf Quint via fpc-pascal wrote: What does Oberon and Forth have to do with the FreePascal compiler?  1. Niklaus Wirth 2. Strong resemblance between Oberon and Pascal 3. An early version of his book Compiler Construction used Pascal rather than Oberon There is no relation with Forth, bur I

[fpc-pascal] Oberon-0

2023-04-18 Thread Adriaan van Os via fpc-pascal
Any suggestions for running simple Oberon-0 programs on the MacOSX command-line ? EIther by emulating its RISC processor or by changing the Oberon-0 compiler ? I prefer not to load the entire Oberon system (for which there do exist emulators). Regards, Adriaan van Os

[fpc-pascal] Oberon-0

2023-04-18 Thread Adriaan van Os via fpc-pascal
Any suggestions for running simple Oberon-0 programs on the MacOSX command-line ? EIther by emulating its RISC processor or by changing the Oberon-0 compiler ? I prefer not to load the entire Oberon system (for which there do exist emulators). To answer my own question maybe the simplest

Re: [fpc-pascal] Nested comments.

2024-01-21 Thread Adriaan van Os via fpc-pascal
Guillermo Martínez Jiménez via fpc-pascal wrote: Hi Pascaloids, I'm wondering if it is possible to make FPC detect and warn (or even stop compillation when) it has detect a nested comment. That's because I'm using Vim and it closes odd comments. For example, the nex code: { This comment

Re: [fpc-pascal] Floating point question

2024-02-06 Thread Adriaan van Os via fpc-pascal
James Richters via fpc-pascal wrote: What's apparently happening now is: MyExtended := ReducePrecisionIfNoLossOfData (8246) + ReducePrecisionIfNoLossOfData (33.0) / ReducePrecisionIfNoLossOfData (1440.0); But it is not being done correctly, the 1440.0 is not being reduced all the way to an

Re: [fpc-pascal] Labels

2023-12-18 Thread Adriaan van Os via fpc-pascal
Jean SUZINEAU via fpc-pascal wrote: Le 17/12/2023 à 17:47, Adriaan van Os via fpc-pascal a écrit : Turbo Pascal (5.5) defines label = digit-sequence . Are you sure ? I had a doubt and I had a look in some very old source code from 1990 made with tp 5.5, it seems you could have letters

[fpc-pascal] ordinal-type

2023-12-19 Thread Adriaan van Os via fpc-pascal
Michael Van Canneyt wrote: 29. Am I correct to assume ? ordinal-type = ordinal-type-identifier . ordinal-type-identifier = identifier . Yes. That may not be correct after-all, because an e.g. indexes arrays array-type = [ "PACKED" | "bitpacked" ] "ARRAY" [ "[" ordinal-type { ","

[fpc-pascal] Labels

2023-12-17 Thread Adriaan van Os via fpc-pascal
According to Section 13.0 of the FreePascal Language Reference (version 3.2.0) "A label can be an identifier or an integer digit." What may be meant is that a label can be an identifier or an integer digit-sequence (and that's what the compiler accepts) label :=

Re: [fpc-pascal] case statement

2023-12-17 Thread Adriaan van Os via fpc-pascal
Tony Whyman via fpc-pascal wrote: Back in the early eighties, I worked at ICL and we made extensive use of the Prospero Pascal compiler building embedded systems based on the Z80 microprocessor. I still have a 1988 edition of the language specification, and this uses EBNF to define the case

Re: [fpc-pascal] More syntax questions (part 3)

2023-12-24 Thread Adriaan van Os via fpc-pascal
Michael Van Canneyt via fpc-pascal wrote: The following zip file contains the updated documentation: http://downloads.freepascal.org/fpc/beta/3.2.4-rc1/docs/doc-pdf.zip Besides correcting your remarks, I did a general overhaul: - I changed the use of space character in syntactic elements to

Re: [fpc-pascal] More syntax questions (part 3)

2023-12-24 Thread Adriaan van Os via fpc-pascal
Michael Van Canneyt via fpc-pascal wrote: I added univ and documented it. Something seems to have gone wrong with the defintion on page 212. Having a better look, the rule defines just one parameter. So, we get instead formal-parameter-list = "(" [ parameter-declaration { ";"

Re: [fpc-pascal] More syntax questions (part 3)

2023-12-25 Thread Adriaan van Os via fpc-pascal
Michael Van Canneyt via fpc-pascal wrote: This is not correct either, as it suggests that ( ... ) is correct. It is not, if you use ... there must be other arguments present. That is offending the reader: "You are to stupid to be given complete information". It misses the point that

Re: [fpc-pascal] case statement

2023-12-15 Thread Adriaan van Os via fpc-pascal
Jean SUZINEAU via fpc-pascal wrote: Le 15/12/2023 à 10:39, Adriaan van Os via fpc-pascal a écrit : I don't see a semicolon in the formal syntax. May be included in the ' "DO" statement ' ? No, have a look at the syntax diagrams, statements never end with a semicolon. Regards, A

[fpc-pascal] method-definition

2023-12-15 Thread Adriaan van Os via fpc-pascal
I am puzzled by the syntax rule in Chapter 6. Classes of the FreePascal Language Reference (version 3.2.0) Section 6.1 Class definitions has method-definition = [ "CLASS" ] ( function-header | procedure-header | constructor-header | destructor-header ) ";" [ ( ( ( "virtual" | "dynamic" ) [

[fpc-pascal] case statement

2023-12-14 Thread Adriaan van Os via fpc-pascal
I am looking in detail at the syntax diagrams in the Freepascal Language Reference (version 3.2.0) Section 13.2.2 discusses the case-statement. Translated to EBNF (WSN) the syntax is case-statement = "CASE" expression "OF" case { ";" case } [ else-part ] [ ";" ] . case = constant [ ".."

[fpc-pascal] More syntax questions (and more to follow)

2023-12-16 Thread Adriaan van Os via fpc-pascal
More questions about the FreePascal Language Reference (version 3.2.0) 1. Section 17.1 defines a rule and raise-statement = "raise" [ exception-instance [ exception-address ] ] . exception-address = "at" exception-address [ "," address-expression ] . a) Is it correct that

Re: [fpc-pascal] More syntax questions (and more to follow)

2023-12-16 Thread Adriaan van Os via fpc-pascal
Michael Van Canneyt via fpc-pascal wrote: Thanks for the replies. Please note that the syntax diagrams are NOT meant to be exhaustive. They are an aid to explain the syntax. I strive to make them as correct as possible, but they make no pretense to being complete. Anyway, I strive to make

Re: [fpc-pascal] case statement

2023-12-14 Thread Adriaan van Os via fpc-pascal
James Richters via fpc-pascal wrote: I didn’t know there was such a thing as OTHERWISE. Is there any functional difference between OTHERWISE and ELSE? No. It is just that OTHERWISE doesn't have the IF-THEN-ELSE ambiguity. Macintosh Pascal compilers had OTHERWISE but not ELSE. Maybe,

Re: [fpc-pascal] case statement

2023-12-14 Thread Adriaan van Os via fpc-pascal
Michael Van Canneyt via fpc-pascal wrote: On Thu, 14 Dec 2023, Adriaan van Os via fpc-pascal wrote: I am looking in detail at the syntax diagrams in the Freepascal Language Reference (version 3.2.0) Section 13.2.2 discusses the case-statement. Translated to EBNF (WSN) the syntax

[fpc-pascal] implementation-part

2023-12-14 Thread Adriaan van Os via fpc-pascal
The Freepascal Language Reference (version 3.2.0) states in section 16.2 "As can be seen from the syntax diagram, a unit always consists of a interface and an implementation part." and "Both the interface part or implementation part can be empty, but the keywords Interface and

[fpc-pascal] More syntax questions (part 2)

2023-12-16 Thread Adriaan van Os via fpc-pascal
More questions about the FreePascal Language Reference (version 3.2.0) part 2 17. For the following rules, I couldn't find a definition in the Language Reference. Can I assume they can all be defined as ? object-type-identifier = identifier .

[fpc-pascal] More syntax questions (part 3)

2023-12-16 Thread Adriaan van Os via fpc-pascal
More questions about the FreePascal Language Reference (version 3.2.0) part 3 26. Am I correct to assume the following equivalents for rules that I couldn't find a definiton for: formal-parameter-list = parameter-declaration . parameter-list

[fpc-pascal] More syntax questions (part 4)

2023-12-16 Thread Adriaan van Os via fpc-pascal
More questions about the FreePascal Language Reference (version 3.2.0), part 4 34. Are macpas LEAVE and CYCLE statements undocumented ? 35. Are macpas ellipsis (...) parameters undocumented ? 36. Is the macpas RETURN statement undocumented ? 37. Shouldn't the macpas "mwpascal" modifier be

Re: [fpc-pascal] More syntax questions (part 3)

2023-12-17 Thread Adriaan van Os via fpc-pascal
Michael Van Canneyt via fpc-pascal wrote: 28. The documentation for macpas "UNIV" is missing ? I have no idea what this is ? UNIV is macpas specific (as mentioned in Appendix D.6 of the Programmer's Manual) With UNIV, ... ":" [ "ARRAY" "OF" ] type-identifier ... in the syntax

Re: [fpc-pascal] More syntax questions (part 4)

2023-12-17 Thread Adriaan van Os via fpc-pascal
Michael Van Canneyt via fpc-pascal wrote: On Sat, 16 Dec 2023, Adriaan van Os via fpc-pascal wrote: More questions about the FreePascal Language Reference (version 3.2.0), part 4 34. Are macpas LEAVE and CYCLE statements undocumented ? Yes. Well, according to Appendix D.6

Re: [fpc-pascal] More syntax questions (part 2)

2023-12-17 Thread Adriaan van Os via fpc-pascal
Michael Van Canneyt via fpc-pascal wrote: On Sat, 16 Dec 2023, Adriaan van Os via fpc-pascal wrote: More questions about the FreePascal Language Reference (version 3.2.0) part 2 17. For the following rules, I couldn't find a definition in the Language Reference. Can I assume they can

Re: [fpc-pascal] More syntax questions (part 3)

2023-12-17 Thread Adriaan van Os via fpc-pascal
On Sat, 16 Dec 2023, Adriaan van Os via fpc-pascal wrote: More questions about the FreePascal Language Reference (version 3.2.0) part 3 26. Am I correct to assume the following equivalents for rules that I couldn't find a definiton for: formal-parameter-list

Re: [fpc-pascal] More syntax questions (part 3)

2023-12-17 Thread Adriaan van Os via fpc-pascal
Another use of UNIV is type-compatibility of procedural parameters. For example with function BinaryFind ( theValuePtr : univ UnivPtr; theFirstIndex : Int32; theLastIndex : Int32; function SmallerThan (

Re: [fpc-pascal] More syntax questions (part 4)

2023-12-17 Thread Adriaan van Os via fpc-pascal
Michael Van Canneyt via fpc-pascal wrote: 37. Shouldn't the macpas "mwpascal" modifier be added to ? call-modifiers = "register" | "cdecl" | "pascal" | "stdcall" | "safecall" | "inline" | "mwpascal" . call-modifiers = "cdecl" | "inline" | "local" | "nostackframe" | "overload" |

Re: [fpc-pascal] case statement

2023-12-16 Thread Adriaan van Os via fpc-pascal
Tony Whyman via fpc-pascal wrote: Prospero Pascal was close to ISO Pascal (although I have lost my original copy of ISO Pascal) and I would guess that the above is copied from ISO Pascal. You can find the ISO-7185 document on the internet, just search for "iso7185.pdf". A less known aspect

Re: [fpc-pascal] case statement

2023-12-16 Thread Adriaan van Os via fpc-pascal
I find the idea of a "closest containing value" rather weird. For me, programming is strict logic, not finding something "closest". What I wrote here, is nonsense. "Closest containing" is rather a grammatical concept, that I misunderstood. Regards, Adriaan van Os

[fpc-pascal] string-type

2023-12-20 Thread Adriaan van Os via fpc-pascal
Section 3.2.4 of the FreePascal Language Reference defines string-type = "STRING" [ "[" unsigned-integer "]" ] | "TYPE" ( "STRING" | "ansistring" ) "(" unsigned-integer ")" . Ansistring is shown in the syntax diagram in boldface and thus as a keyword. But it is not listed as either a

Re: [fpc-pascal] string-type

2023-12-20 Thread Adriaan van Os via fpc-pascal
Adriaan van Os via fpc-pascal wrote: Section 3.2.4 of the FreePascal Language Reference defines string-type = "STRING" [ "[" unsigned-integer "]" ] | "TYPE" ( "STRING" | "ansistring" ) "(" unsigned-integer

[fpc-pascal] inherited

2023-12-21 Thread Adriaan van Os via fpc-pascal
Sections 5.5.2 and 6.6.8 of the FreePascal Language Reference discuss the "inherited" keyword, but I couldn't find it in the syntax diagrams. Sections 12.2 and 13.1.2. have procedure-statement = ( procedure-identifier | method-identifier | qualified-method-identifier | variable-reference ) [

Re: [fpc-pascal] How to avoid Copy

2023-12-29 Thread Adriaan van Os via fpc-pascal
Amir--- via fpc-pascal wrote: Hi all, I have a List of record, where the record has a WideString field. I have some code like the following: function check(constref v: TMyRecord; data: TListOfMyRecord): Boolean; var r: TMyRecord; begin Result := False; for r in data do if r.State

Re: [fpc-pascal] case statement

2023-12-15 Thread Adriaan van Os via fpc-pascal
Note that the same ambiguity exists in the syntax (and this is less well known) exceptionhandlers = [ exception-handler { ";" exception-handler } [ "ELSE" statement-list ] | statement-list ] . exception-handler = "ON" [ identifier ":" ] class-type-identifier "DO" statement . as ends with

Re: [fpc-pascal] case statement

2023-12-15 Thread Adriaan van Os via fpc-pascal
Michael Van Canneyt via fpc-pascal wrote: On Fri, 15 Dec 2023, Adriaan van Os via fpc-pascal wrote: Note that the same ambiguity exists in the syntax (and this is less well known) exceptionhandlers = [ exception-handler { ";" exception-handler } [ "ELSE" statemen

Re: [fpc-pascal] case statement

2023-12-15 Thread Adriaan van Os via fpc-pascal
Michael Van Canneyt via fpc-pascal wrote: The fact that the semicolon before the else is optional ? I don't see a semicolon in the formal syntax. This works: OK, than an optional semicolon must be added to the rule exceptionhandlers = [ exception-handler { ";" exception-handler } [ ";"

Re: [fpc-pascal] What's in Hello World

2024-01-07 Thread Adriaan van Os via fpc-pascal
Peter B via fpc-pascal wrote: Try building with smartlinking, -XX I get 35k You can also experiment with ld linker options like --strip-all and --strip-debug or run the produced code through strip with various options (e.g. -u -r on

Re: [fpc-pascal] What's in Hello World

2024-01-11 Thread Adriaan van Os via fpc-pascal
Nikolay Nikolov via fpc-pascal wrote: But that increases the binary size to 28 bytes. We can put a 'ret' That's still 27 bytes too much. Let's design a CPU that has "Hello World" as a one-byte instruction, implement that CPU in a Field-programmable gate array, write an OS for it and let it

[fpc-pascal] $definec and $define

2024-01-12 Thread Adriaan van Os via fpc-pascal
The FreePascal Programmer's Guide version 3.2.0 reads in section 1.2.11 "Under Mac Pascal mode, the $DEFINEC directive is equivalent to the $DEFINE directive and is provided for Mac Pascal compatibility. {$DEFINE} can also be used to define macros or compile-time constants:" This is not

Re: [fpc-pascal] Trash variables (-gt) - Translation

2024-01-18 Thread Adriaan van Os via fpc-pascal
LacaK via fpc-pascal wrote: Hi *, I am translating "Trash variables" (from English to Slovak), but I can not find appropriate words. That's why I want to describe it in more words. Is this correct: "Initialize local variables with random values" ? Or better suggestion? I once had a bug in a

Re: [fpc-pascal] IntToStr implementation

2024-01-18 Thread Adriaan van Os via fpc-pascal
Also something which cannot be handled by 'standard' syntax. (unless you wish to count generics and implicit specialization as "standard syntax") actual-parameter = expression { ":" expression } . actual-parameter-list = "(" actual-parameter { "," actual-parameter } ")" . Regards,

Re: [fpc-pascal] IntToStr implementation

2024-01-18 Thread Adriaan van Os via fpc-pascal
Michael Van Canneyt via fpc-pascal wrote: More accurately, I meant: you cannot write a function declaration to handle that syntax. It is true that a regular (non-built-in) procedure/function with that syntax can not be declared. Some more strange ducks - Exit allowing Program as

[fpc-pascal] Quiz

2024-01-07 Thread Adriaan van Os via fpc-pascal
Quiz. Which of below constant declarations are accepted by the compiler and what is their value ? const ki1 = + 2; ki2 = +2; ki3 = 2+; kr1 = 1.; kr2

[fpc-pascal] %LINENUM%

2024-01-11 Thread Adriaan van Os via fpc-pascal
Section 1.2.41 of the Free Pascal Programmer’s Guide version 3.2.0 says: "As a result, this will generate a macro with the value of the XXX specifier, as if it were a string (or, in the case of LINENUM, an integer)." I don't think this is correct, or at least requires clarification. One can

Re: [fpc-pascal] More syntax questions (part 3)

2023-12-17 Thread Adriaan van Os via fpc-pascal
Michael Van Canneyt wrote: 32. Are the set operators "include", "exclude" missing in the syntax diagrams ? Is "><" missing (specifically) as set operator in the syntax diagrams ? Include/Exclude are not operators. They are procedure calls. Section 12.8.5 says "Elements can be added or

Re: [fpc-pascal] what is release plan for fpc?

2023-12-07 Thread Adriaan van Os via fpc-pascal
Sven Barth via fpc-pascal wrote: The next version currently planned is 3.2.4 in a soonish time frame. At least as far as I'm aware MIPS64 should be supported there. If there are specific commits from main that would fix issues with that platform we could potentially still merge them to the

Re: [fpc-pascal] Floating point question

2024-01-27 Thread Adriaan van Os via fpc-pascal
Thomas Kurz via fpc-pascal wrote: 1. The "writeln" in line 32 correctly prints "0." when (cross-) compiling to win64, but "39.375" when compiling to win32 (with ppc386). Maybe the word "cross-compiling" gives a clue ? In a cross-compiler, floating-point operations of constants must be

[fpc-pascal] Crash with cthreads and snapshot ppca64 on macos 14.2.1

2024-02-02 Thread Adriaan van Os via fpc-pascal
I get a "Threading has been used before cthreads was initialized." crash for a simple program program test; uses cthreads; begin writeln( 'Hello') end. on macos 14.2.1 with a fpc 3.3.1-14334-g5205ce30f4 snapshot, but the crash only occurs with mode -Mmacpas (which I assumes implicitely

Re: [fpc-pascal] Crash with cthreads and snapshot ppca64 on macos 14.2.1

2024-02-03 Thread Adriaan van Os via fpc-pascal
I get a "Threading has been used before cthreads was initialized." crash for a simple program program test; uses cthreads; begin writeln( 'Hello') end. on macos 14.2.1 with a fpc 3.3.1-14334-g5205ce30f4 snapshot, but the crash only occurs with mode -Mmacpas (which I assumes implicitely

Re: [fpc-pascal] Floating point question

2024-02-04 Thread Adriaan van Os via fpc-pascal
Jonas Maebe via fpc-pascal wrote: On 03/02/2024 18:42, James Richters via fpc-pascal wrote: Constants are also evaluated wrong,you don’t know what that constant is going to be used for, so all steps of evaluating a constant MUST be done in extended by the compiler, or the answer is just wrong.

Re: [fpc-pascal] Floating point question

2024-02-04 Thread Adriaan van Os via fpc-pascal
Jonas Maebe via fpc-pascal wrote: On 04/02/2024 13:50, Adriaan van Os via fpc-pascal wrote: Jonas Maebe via fpc-pascal wrote: On 03/02/2024 18:42, James Richters via fpc-pascal wrote: Constants are also evaluated wrong,you don’t know what that constant is going to be used for, so all steps

Re: [fpc-pascal] FPC and SIMD intrinsics

2024-04-22 Thread Adriaan van Os via fpc-pascal
Alecu Ștefan-Iulian via fpc-pascal wrote: Hello! I am interested in making a high-performance project which involves a lot of math, which is why I am interested in using SIMD (AVX2) on x86_64 (and for fun as well, if I'm honest). I am coming mainly from the C and C++ world where one has

[fpc-pascal] Type-casting a class variable

2024-05-01 Thread Adriaan van Os via fpc-pascal
Suppose I have a var myClass: TClass and (for example) a class function TWindow.CreateNewWindow( ) Now I want to call CreateNewWindow for var myClass. Of course, depending on the class, CreateNewWindow will behave different. Type-casting myClass to TWindow crashes (in my

Re: [fpc-pascal] Type-casting a class variable

2024-05-02 Thread Adriaan van Os via fpc-pascal
In addition to what Martin said: as long as you have a non-static class method the value of the variable you call the class method on (e.g. myClass in your example) will be passed as Self parameter. So no need for extra parameters. But how can myClass be passed ?

Re: [fpc-pascal] Type-casting a class variable

2024-05-02 Thread Adriaan van Os via fpc-pascal
Martin Frb via fpc-pascal wrote: Silly question, but did you assign the value to the variable? myClass := TWindow; That's what I did. TWindow(myClass).CreateNewWindow; And this is what crashes. I can report this, if the type-cast is supposed to work. Regards, Adriaan van Os

  1   2   >