Recent

Author Topic: Is Meta programming possible with fpc?  (Read 5431 times)

dsiders

  • Hero Member
  • *****
  • Posts: 1012
Re: Is Meta programming possible with fpc?
« Reply #30 on: May 24, 2023, 04:35:37 pm »
The context-menu key does not work for me too. It's Lazarus+Qt5. (It's that key by the right Ctrl).

Each of the QT versions maps the VK_APPS key to the QtKey_Menu value in the widgetset. In what context does it not work?

A bug report might be needed.
Preview Lazarus 3.99 documentation at: https://dsiders.gitlab.io/lazdocsnext

Blaazen

  • Hero Member
  • *****
  • Posts: 3237
  • POKE 54296,15
    • Eye-Candy Controls
Re: Is Meta programming possible with fpc?
« Reply #31 on: May 24, 2023, 06:02:03 pm »
Quote
Each of the QT versions maps the VK_APPS key to the QtKey_Menu value in the widgetset. In what context does it not work?

A bug report might be needed.

Regular Qt5 apps opens popup-menu in position of the mouse cursor (just like the right click) OR in a position of caret - if some TEdit (which is a QLineEdit), TComboBox etc. is focused.
The second works in Lazarus (and in Double Commander as well). The first doesn't. I.e. that key does nothing in Messages or Source Editor but eventually works in Object Inspector - if there is a caret.
Lazarus 2.3.0 (rev main-2_3-2863...) FPC 3.3.1 x86_64-linux-qt Chakra, Qt 4.8.7/5.13.2, Plasma 5.17.3
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.21

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

Curt Carpenter

  • Sr. Member
  • ****
  • Posts: 395
Re: Is Meta programming possible with fpc?
« Reply #32 on: May 24, 2023, 09:24:34 pm »
I'd like to offer another viewpoint about metaprogramming.

First, I don't consider it advanced in any way.  Specifically, anything that for the most part gratuitously complicates matters, isn't advanced, it's deficient/obtuse/"ill conceived".  In the accomplishment of those characteristics, it might be an advanced technique (but that doesn't make it desirable.)

I subscribe to the rule that features that allow creating simpler, easier to understand code are good features and, those that do not or, worse make the code harder to understand, are bad/undesirable features and, so far, metaprogramming falls squarely in the latter.

<snip>

I'd like to second this view.  "Readability" is a core value of Pascal, and language enhancements that impact that value negatively should be avoided absent a very compelling case for their adoption.

PascalDragon

  • Hero Member
  • *****
  • Posts: 5418
  • Compiler Developer
Re: Is Meta programming possible with fpc?
« Reply #33 on: May 24, 2023, 10:14:37 pm »
and it gives these warnings
Quote
tester_2023.pas(74,6) Note: Call to subroutine "operator :=(const source:ShortString):Variant;" marked as inline is not inlined
tester_2023.pas(76,38) Note: Call to subroutine "operator :=(const source:OleVariant):AnsiString;" marked as inline is not inlined
tester_2023.pas(77,28) Note: Call to subroutine "operator :=(const source:Variant):AnsiString;" marked as inline is not inlined
what do these warnings about inline mean?

These are not warnings, these are notes as is mentioned after the position of the message.

I don't know why operators are not inlined.

There are various reasons when the compiler decides not to inline a function. In this case the issue is that the function uses a variable that is private to the Variants unit and is thus not accessible from outside. The trunk compiler has the ability to support this nevertheless on most platforms (e.g. Windows, macOS and the ELF-based ones) and thus this specific note won't appear anymore.

You can select multiple messages by left mouse click + Ctrl or Shift. Then right click -> Copy -> Copy selected messages to clipboard.
Thanks for the info, unfortunately I’m using a laptop with trackpad. I’m not sure how to make that wo even trying what would usually be considered a right clicks while holding control and/or shift key

I don't see what a trackpad has to do with that. I'm on a tablet with a trackpad as well and have no issue doing multi selection.

I was chatting with someone recently who told me that pascal has variants so that it can utilize code from c libraries. Suffice it to say that I was not thrilled to find out about dependencies on c  :o

How do you think FPC interacts with the operating system? Magic?

If this someone meant the Variant type then as I said that was introduced to interact with COM libraries. If they meant variant records then these exist to simplify various coding usecases and not only to interact with C code (though they definitely help there as well).

Joanna

  • Hero Member
  • *****
  • Posts: 635
Re: Is Meta programming possible with fpc?
« Reply #34 on: May 25, 2023, 12:28:22 am »
Quote
I don't see what a trackpad has to do with that. I'm on a tablet with a trackpad as well and have no issue doing multi selection

The left click while pressing ctrl/shift keys Technique works ok if I use it to select file names but doesn’t work for multi selecting messages in Lazarus.

If it matters I’m using windows parallels on a Mac ..
✨ 🙋🏻‍♀️ More Pascal enthusiasts are needed on IRC .. https://libera.chat/guides/ IRC.LIBERA.CHAT  Ports [6667 plaintext ] or [6697 secure] channel #fpc  Please private Message me if you have any questions or need assistance. 💁🏻‍♀️

PascalDragon

  • Hero Member
  • *****
  • Posts: 5418
  • Compiler Developer
Re: Is Meta programming possible with fpc?
« Reply #35 on: May 26, 2023, 10:14:46 pm »
Quote
I don't see what a trackpad has to do with that. I'm on a tablet with a trackpad as well and have no issue doing multi selection

The left click while pressing ctrl/shift keys Technique works ok if I use it to select file names but doesn’t work for multi selecting messages in Lazarus.

If it matters I’m using windows parallels on a Mac ..

Might be a problem of your specific setup then, cause for me it works on Windows 10.

Joanna

  • Hero Member
  • *****
  • Posts: 635
Re: Is Meta programming possible with fpc?
« Reply #36 on: May 31, 2023, 09:07:33 am »
Is there any way to make it work with win 7 ?  Does anyone else here use win 7?
✨ 🙋🏻‍♀️ More Pascal enthusiasts are needed on IRC .. https://libera.chat/guides/ IRC.LIBERA.CHAT  Ports [6667 plaintext ] or [6697 secure] channel #fpc  Please private Message me if you have any questions or need assistance. 💁🏻‍♀️

ASerge

  • Hero Member
  • *****
  • Posts: 2196
Re: Is Meta programming possible with fpc?
« Reply #37 on: May 31, 2023, 04:39:06 pm »
Is there any way to make it work with win 7 ?  Does anyone else here use win 7?
In Windows 7 this also works.

Joanna

  • Hero Member
  • *****
  • Posts: 635
Re: Is Meta programming possible with fpc?
« Reply #38 on: May 31, 2023, 11:57:27 pm »
Oh well I don’t know what I’m doing wrong... :(
✨ 🙋🏻‍♀️ More Pascal enthusiasts are needed on IRC .. https://libera.chat/guides/ IRC.LIBERA.CHAT  Ports [6667 plaintext ] or [6697 secure] channel #fpc  Please private Message me if you have any questions or need assistance. 💁🏻‍♀️

 

TinyPortal © 2005-2018