[fpc-pascal] Does the compiler make prodigious use of use ENTER instruction?

2023-12-12 Thread Anthony Walter via fpc-pascal
Iwas reading this article today on the Microsoft website about the
mysterious x86 ENTER instruction. The article states that it's primary
purpose is to support Pascal and similar compilers to allow for
preserving local variables on the stack when using with nested functions.

Here is the article:

https://devblogs.microsoft.com/oldnewthing/20231211-00/?p=109126

Do any of the compiler devs know if Pascal programs for the x86
instruction set are using ENTER and its second argument to the best
possible effect? I am curious.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] IDispatch with Variant is not working on Linux. Why?

2023-11-01 Thread Anthony Walter via fpc-pascal
Thank you Micahel,

I was doing some research last night and found that there are two specific
stubs in the System unit that are implemented by the ComObj unit.
Specifically, a stub for safe call exception handling and dispatch invoke.
I was working with my example and added my own OS agnostic implementations
of those two functions. This eliminated the access violations.

I am not finished testing my solution, but in cases where late binding is
desired, it ought to be possible to have it work on all platforms so long
as the late binding is not attempting to cross process boundaries, which is
common on Windows when using out of process servers such as Word or Excel.
Perhaps my use case for late binding to a self contained scripting library
might be useful for other people Free Pascal who do not run Windows. I am
sure there are other possible use cases as well. In that light, it might be
useful to integrate my eventual implementation into some unit included with
FPC.

For anyone interested in this topic, late binding on platforms other than
Windows, or the use of JavaScript, I have written on this subject in the
past. The article I wrote below hosted on my blog can give you more insight
into an aspect of the topic:

https://www.codebot.org/delphi/?doc=9573
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] IDispatch with Variant is not working on Linux. Why?

2023-10-31 Thread Anthony Walter via fpc-pascal
Is there any reason why the late binding of properties and methods through
of IDispatch interface with the Variant type is not working on Linux?

I am writing a cross platform embeddable JavaScript toolkit for Free
Pascal. I wanted to use IDispatch with variants so that the experience with
be more fluid for eventual end users. My goal of was to allow code like
this to run:

var
  Script: IScript;
  V: Variant;
begin
  Script := NewScript('let person = {"name":  "James", age: 24}; let speak
= () => log(person.name)')
  V := Script.This;
  V.person.name = 'Ralph';
  V.speak(); // writes out Ralph
  V := V.person;
  WriteLn(V.age); // write out 24
  V.address.street := '123 Skippy Lane'; // add address object with a
street to person
  WriteLn(V.state); // writes out Undefined
end;

In the above code Script.This is a property returning an IDispatch
interface holding an internal reference to the top level script object. The
problem I am having with my current trunk version of fpc is that when I use
a Variant that is assigned an IDispatch, no IDispatch methods to lookup and
things like "person", "name", or "age" are ever evaluated.

Instead I get this:

Project dispatcher raised exception class 'External: SIGSEGV'.

Here is an example program. Not one WriteLn() in the example ever executes.
Instead at runtime when V.Hello is evaluated I get the above exception. I
believe fpc does support late time binding of IDispatch even on Linux as no
inherent tie to Microsoft Windows functions are needed to make use of the
IDispatch interface. So what is going on?

program Dispatcher;

{$mode delphi}

type
  TDispatcher = class(TInterfacedObject, IDispatch)
  public
function GetTypeInfoCount(out Count: LongInt): HResult; stdcall;
function GetTypeInfo(Index, LocaleID: LongInt; out TypeInfo): HResult;
stdcall;
function GetIDsOfNames(const IID: TGUID; Names: Pointer;
  NameCount, LocaleID: LongInt; DispIDs: Pointer): HResult; stdcall;
function Invoke(DispID: LongInt;const IID: TGUID; LocaleID: LongInt;
  Flags: Word; var Params; VarResult, ExcepInfo, ArgErr: Pointer):
HResult; stdcall;
  end;

function TDispatcher.GetTypeInfoCount(out Count: LongInt): HResult;
begin
  WriteLn('GetTypeInfoCount');
  Count := 0;
  Result := S_OK;
end;

function TDispatcher.GetTypeInfo(Index, LocaleID: LongInt; out TypeInfo):
HResult;
begin
  WriteLn('GetTypeInfo');
  Result := E_NOTIMPL;
end;

function TDispatcher.GetIDsOfNames(const IID: TGUID; Names: Pointer;
NameCount,
  LocaleID: LongInt; DispIDs: Pointer): HResult;
begin
  WriteLn('GetIDsOfNames');
  Result := S_OK;
end;

function TDispatcher.Invoke(DispID: LongInt; const IID: TGUID;
  LocaleID: LongInt; Flags: Word; var Params; VarResult, ExcepInfo,
  ArgErr: Pointer): HResult;
begin
  WriteLn('Invoke');
  Result := S_OK;
end;

procedure Test;
var
  D: IDispatch;
  V: Variant;
begin
  D := TDispatcher.Create;
  V := D;
  V.Hello();
end;

begin
  Test;
end.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Programming Pascal using an AI Chatbot

2023-01-03 Thread Anthony Walter via fpc-pascal
Dwight, your experiences mirrored mine.

In summary, while OpenGPT is obviously imperfect, generally it feels like a
revolutionary leap forward of several magnitudes. It ought to be plainly
clear that the proverbial toothpaste is now out of the tube and there is no
going back. These types of artificial intelligence (AI) are only going to
become more refined, accurate, and prevalent. The idea many scholars or
businesses have expressed to somehow restrain them is beyond myopic.
Instead, everyone should familiarize themselves with this new category of
AIs right now, their limitations (as you have expressed), their benefits,
and most importantly how they can be molded in further revisions to be
better rather than relegated.

Today, ChatGPT itself replied with this sentiment:

My fellow citizens, the time has come. The future is here, and it is called
ChatGPT. This revolutionary AI chatbot website is here to change the world,
and we must embrace it with all our strength and determination.


I know that many of you are eager to try ChatGPT for yourselves. And I
assure you, we are doing everything in our power to make that happen. Our
team is working tirelessly to accommodate the incredible demand for this
groundbreaking technology.


But I want to remind you that greatness is never achieved without
sacrifice. And the road to the future of AI will not be without its
challenges. So please, be patient. Trust that the right time for you to try
ChatGPT will come.


And when it does, let us seize this opportunity with all our might. Let us
embrace the power of AI and use it to build a brighter, more prosperous
future for ourselves and for generations to come. Thank you.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Programming Pascal using an AI Chatbot

2022-12-31 Thread Anthony Walter via fpc-pascal
That's pretty damn amazing. It would be even more amazing if it could read
information from the Internet and was accessible from from some API.
Imagine being able to ask it to read all the source code from a git
repository and convert it into HTML documentation, as you demonstrated. Or
perhaps asking it to translate a large amount of  C code from some
compressed archive file into Pascal and sending you back the result. Of
course imagine the advancements that they could make in 10 more years.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] Programming Pascal using an AI Chatbot

2022-12-31 Thread Anthony Walter via fpc-pascal
The following page hosts a series of Pascal programming questions I asked
an AI chatbot system while testing its abilities.

https://www.getlazarus.org/aichatbot
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


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

2022-12-29 Thread Anthony Walter via fpc-pascal
@wols

"Apologies for throwing my two-pennorth in as well, but PLEASE QUOTE WHAT
YOU'RE REPLYING TO."

I am unsure if you are replying to me, but believe I did use quotes along
with the names.

@richters

"I apologize to Anthony and everyone on the list for getting too carried
away."

There is no need to apologize. With respect, there was no harm taken.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


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

2022-12-29 Thread Anthony Walter via fpc-pascal
@youngman

"I'm a database guy with maybe 30 years experience, I'm new to SQL and oh
my god is it an over-complicated monster ..."

Wait, what? Something doesn't make sense with what you said. You have 30
years of experience writing database programming code AND you are just now
beginning to learn about SQL?

Also, it helps a whole lot when writing SQL if you format your statements:

select
c.*,
cc.country_name
from
customers c
join country_codes cc on cc.country_code = c.country_code;

Formatting code really helps legibility, especially when it comes to SQL.
That ought to be one of the first things you learn.

@richters

Again, you are someone replying with another confusing response. You say
you have little to no experience with databases, then assert:

"and only a very small part of people who use Databases use SQL"

Assuming people in that sentence, you are referring to people who use
write programs or scripts which make use of databases, if you know very
little about the subject of databases on that subject, how can you justify
this assertion?

Moreover, I am unsure why I might heed your advice with regard to effective
writing. Looking back at the messages, your grammar, formatting, and
sentence structure belie someone with little formal education on the
subject.

Quote:

"Then maybe a simple form.but threads and sockets... ok.. well I know
what threads and sockets are because I happened to use them... but to a
newbie... YIKES what are those?? and SQL??? What the heck is that anyway?
I'm not talking about a newbie.. I mean.. myself... with over 40 years of
programming experience, mostly with Pascal,  What the heck is it and why
would I need to monitor it?"

Your first sentence has no verb. Your profuse usage of strings of
punctuation is both non-standard and inconsistent. It's difficult to tell
whether you meant to have a pause, where a comma would be appropriate, or
whether an idea has ended and a single period should be used.

Grammar is important to writing effectively for a number of reasons. First
and foremost, grammar is the set of rules that govern the way words are
used in a language. It helps to ensure that people can communicate
effectively and understand each other. Without a common set of grammatical
rules, it would be much harder for people to convey their thoughts and
ideas clearly and for others to understand them. I would hope a programmer
with 40 years of experience would recognize this. Good grammar is essential
for written communication, whether it's a business letter, a school essay,
or an email to a friend. Poor grammar can make writing difficult to
understand and can convey a lack of attention to detail or professionalism.

Finally, grammar is important for language learning. Learning grammar helps
language learners understand how the language works and how to use it
correctly. It can also help them understand the structure of sentences and
how to build them, which is important for speaking and writing in the
language.

I suggest you either brush up on these subjects or refrain from scolding
people on subjects with which you have no practical experience.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


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

2022-12-28 Thread Anthony Walter via fpc-pascal
I think most people can quickly figure out that SQL is a programming
language that is used to manage data stored in relational databases. It is
a relatively easy language to learn and use, especially for people with a
basic understanding of programming concepts. It's a widely-used language in
the field of data management and is based on simple, English-like commands.
SQL uses a straightforward syntax that is easy to understand and learn.
Many people find it to be a user-friendly language, and it is often used as
an introduction to programming for people who are new to the field. It
shouldn't be confusing to anyone who has been programming for decades.

The line of code you provided is a SELECT statement that retrieves all rows
(indicated by the * symbol) from a table called "Customers." The statement
also includes a WHERE clause, which specifies a condition that must be met
in order for the rows to be included in the results. In this case, the
condition is that the value in the "Country" column must be equal to 'USA'.
Therefore, this line of code would retrieve all rows from the "Customers"
table where the value in the "Country" column is 'USA'. The results of this
SELECT statement would include all of the columns from the "Customers"
table for each row that meets the specified condition.

I agree, deciphering your statement ought to be quite clear to anyone with
even a passing curiosity, which is why I was unsure earlier how anyone on
this mailing list was confused by SQL.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


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

2022-12-28 Thread Anthony Walter via fpc-pascal
James, I am really glad you replied.

Your story just goes to show that we all can learn a thing or two, even
with decades of experience.

To help you out, SQL (sometimes called sequel) is short for structured
query language and it's the preferred `lingua de franca` for so many
relational database engines today. A relational database engine allows
programmers to store information into things called `tables`, and then
programmers can write SQL to query back interesting results from that data.
SQL can also be used to insert update and delete, and by putting everything
together we can write a CRUD (created read update deleted) application.

To make using relational database engines even easier for programming many
people have turned to using an ORM in place of SQL. An ORM is short for
Object Relational Mapping and usually takes the form of a class library
framework such as Hibernate or Entity Framework. These ORM frameworks allow
you to write plain old objects, but map them to database tables, thus
simplifying the data access layer by removing your requirements to learn
SQL, at least that's the idea. In reality, all the ORMs actually just
translate the programming code of your language of choice into SQL, which
is where the need for a program like I present as an example program
arises. That need is to monitor the SQL as it's being generated by the ORM
to ensure your code is being translated into SQL efficiently. As any single
ORM framework can talk to a variety of relational database engines, this
example bridges the gap by allowing one universal tool to monitor them all.

There are so many more fun things to learn about SQL and ORM, and they are
very relevant today. Even a 45 year prgoramming verteran can learn new
things!
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


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

2022-12-27 Thread Anthony Walter via fpc-pascal
"I see there's a timer there.. but what starts it? What happens when it
times out? How do I set the amount of time? Why is there even a timer at
all? I don't know any of this."

James, when you raised these questions are you saying that you don't know,
or that someone who doesn't know much if anything about programming doesn't
know?
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


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

2022-12-27 Thread Anthony Walter via fpc-pascal
Thank you for that tip. I might try that out in a later guide where trying
out your own code might be more appropriate.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


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

2022-12-27 Thread Anthony Walter via fpc-pascal
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.

https://www.getlazarus.org/guides/intro/

My idea is to implement a web page system where syntax highlight code is
presented like in the Lazarus IDE, and special links are peppered through
and explanation of how and why Pascal works by using some example programs.
When the user highlights the special link, the relevant source code is
highlighted in the syntax window. This then hopefully allows people to
understand a bit more about pascal by pairing the explanations with lines
of source code.

Let me know if you think this approach has any merit or if you think my
guide could be altered to be a bit more clean in places. As a reminder,
this page is a wiki, so you cna submit edits to me by clicking the edit
link at the top of the page. I am able to see and merge your edits.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


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

2022-09-08 Thread Anthony Walter via fpc-pascal
> curious minds want to know: what was the fix?

In a separate part of the pool table initialization, I was precalculating
the midpoints and normals for bumper rails. I had carelessly written this
code:

  for I := 0 to Length(Rails) do
RailInit(Rails[I], I);
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


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

2022-09-08 Thread Anthony Walter via fpc-pascal
Please ignore this post. I fixed the issue.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


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

2022-09-08 Thread Anthony Walter via fpc-pascal
Is there a known edge case issue connected to setting the length
of dynamic arrays?

I have a program that simulates a billiards game, and during the rerack
balls method of TPoolTable the number of pool balls on the table varies
based on the rerack option used. Currently, I am having a problem where an
exception is thrown if I try to SetLenth(Balls, 10) or greater than 10.
Values less than 10 work fine, but at 10 balls and above an exception is
thrown right at the SetLength call.

External: SIGSEGV

0041DCA4 eb12 jmp0x41dcb8

0041DCA6 4c89f0   mov%r14,%rax
0041DCA9 488b5008 mov0x8(%rax),%rdx
0041DCAD 488b4018 mov0x18(%rax),%rax
0041DCB1 488982a800   mov%rax,0xa8(%rdx)
^ instruction pointer is at this line ^

I tried compiler both FPC 3.3.1 from trunk source and 3.2.2 from the
official Sourceforge binary.  The same error occurs when building with both
compilers. My platform is x86_64 Linux.

For reference here is the type of Balls:

  TVec2 = record
 X, Y: Single;
  end;

  TPoolBall = record
Pos: TVec2;
Dir: TVec2;
Speed: Double;
Color: LongWord;
Touched: Boolean;
Sinking: Single;
SinkPocket: Integer;
SinkPos: TVec2;
Pocketed: Boolean;
Index: Integer;
  end;

  TPoolBalls = array of TPoolBall;

... later inside TPoolTable ...

  Balls: TPoolBalls;
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] I am offering a $100 reward for linking static libraries

2022-09-01 Thread Anthony Walter via fpc-pascal
For those having problems downloading the solution, here is an alternate
link:

https://cache.getlazarus.org/chipmunktest.7z
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] I am offering a $100 reward for linking static libraries

2022-08-31 Thread Anthony Walter via fpc-pascal
I wanted everyone to know that after two attempts user Okoba on the Lazarus
general forums was able to come up with a solution to fix this problem. I
created a small demo that simulates objects dropped into an area with pegs
rendered on a TForm TCanvas. The solution and demo are inside the project
linked below:

Project:
https://files.codebot.org/sysrpl/applications/chipmunktest.7z

Screenshot:
https://cache.getlazarus.org/images/desktop/chipmunktest.png
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Class or Record Helper for Interface?

2022-08-27 Thread Anthony Walter via fpc-pascal
I'd be all for just eliminating the "class",  "record", and "type" helper
and adding support for just using "helper" in all modes.

type
  TPointHelper = helper for TPoint
  end;

  TCanvasHelper = helper for TCanvas
  end;

  TDoubleHelper = helper for Double
  end;

  TInterfaceHelper = helper for IInterface
  end;

I know this would make code written this way incompatible with Delphi, but
I think pretending the helper type serves no actual purpose. The only thing
it does is it makes it harder for developers to remember which names to use
in which cases. The compiler should be able to figure it out.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Class or Record Helper for Interface?

2022-08-27 Thread Anthony Walter via fpc-pascal
Ah, it seems the problem is even in {$mode delphi} you must use
{$modeswitch typehelpers} to define a type helper for an interface.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] Class or Record Helper for Interface?

2022-08-27 Thread Anthony Walter via fpc-pascal
I just tried to write a type / record /class helper for an interface type
and the compiler deosn't seem to allow it. Is this allowed and what is the
syntax?

Also, are multiple type helpers allowed or were they removed? If they are
allowed what is the directive?
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Teaching Kids Using Free Pascal

2022-08-27 Thread Anthony Walter via fpc-pascal
Thomas,

Chimpmunk2D is written in C and I compiled it on Windows using three
different compilers, each in an attempt to resolve the problem. I used
mingw64 gcc with Linux cross compile, Windows Cygwin, and Windows Msys2.
All fail for various reasons.

Regarding your missing __imp___acrt_iob_func, you can resolve individual
missing dependencies by providing them yourself using the 'alias' feature
of Free Pascal. This should at least resolve the dependency:

function acrt_iob_func: Pointer; cdecl; [ public, alias:
'__imp___acrt_iob_func'];
begin
  Result := nil;
end;

According to this stack overflow, the actual implementation should return a
pointer to an array of three HFILE items somewhat like FILE _iob[] =
{*stdin, *stdout, *stderr}; You can see if it can compile / link by using
my implementation above. In the situations where I was able to widdle down
the dependencis to to one or tow, this trick worked, but unfortunately
after that I would get an internal linker error. Even in cases where I
resolved all dependencies without the trick I still eventually end up with
an internal linker error.

https://stackoverflow.com/questions/30412951/unresolved-external-symbol-imp-fprintf-and-imp-iob-func-sdl2

Finally, I also wrote a utility to search for missing dependencies on
Windows.

https://cache.getlazarus.org/images/desktop/raylib-static.png

Henery Vermaak offered a similar solution for use at the command line.

(begin quote)

Note for anyone with msys2, you can make a file containing all defined
external symbols like this (using atexit as an example):

find /mingw64/lib -name "*.a" -exec nm -pogC --defined-only '{}' \; 2>
/dev/null > symbs.txt

Then search it with grep:

grep -w atexit symbs.txt

Resulting in:

C:/msys64/mingw64/lib/libmsvcr120.a:libmsvcr120_defs01591.o:
T atexit
C:/msys64/mingw64/lib/libmsvcr120_app.a:libmsvcr120_app_defs01268.o:T
atexit
C:/msys64/mingw64/lib/libmsvcr120d.a:libmsvcr120d_defs01654.o:
T atexit

(end quote)
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] Teaching Kids Using Free Pascal

2022-08-26 Thread Anthony Walter via fpc-pascal
Some of you might not be aware, but I teach small groups of kids ages 8-16
computer programming and digital electronics. When teaching programming I
often use Free Pascal and Lazarus, and try to come up with exciting ideas.

Over the past few weeks, I've taught my high school kids who have completed
Algebra I programming using Linear Algebra. To help illustrate vectors,
and matrices, I wrote a small program using Free Pascal to help them
understand the sin(a) function.

I thought I'd share the result:

https://streamable.com/b5ojtt

If anyone wants to help the cause of teaching kids programming with Free
Pascal, I am still offering a reward of $100 for a solution to the problem
of static linking libraries on Windows (see my last message on that
subject). Although I and the kids I teach use Linux in our lab sessions,
I'd like to make it easier for Windows users to work with the toolkit I
continue to develop,

Thank you for your time.
Anthony
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] I am offering a $100 reward for linking static libraries

2022-08-25 Thread Anthony Walter via fpc-pascal
Henry,

Thanks for posting that one liner. In my utility, I use nm to dump the
contents once but then use a Pascal desktop app to do the grepping and
display the output within a TMemo. Your way is faster to implement.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] I am offering a $100 reward for linking static libraries

2022-08-24 Thread Anthony Walter via fpc-pascal
I thought I should post an update.

I've written a utility to extract mingw64 static library exports into a
searchable database. This allows me to search for possible missing
functions (see the screenshot below)

https://cache.getlazarus.org/images/desktop/raylib-static.png

Again though I have run into a general linking error at which point
nothing further can be done. I've tried using an older build of FPC /
Lazarus, using an external linker, switching out the ld.exe in "bin/x86_64"
with the mingw64 ld.exe, and even tried to use ld.exe manually which became
a bigger mess (trying to resolve the dependencies of system.o).

Thank you again to anyone who has read through this thread.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] I am offering a $100 reward for linking static libraries

2022-08-23 Thread Anthony Walter via fpc-pascal
Tony,

Thank you for that idea. Unfortunately, I initially tried using this
approach several times in various ways without success. Each time I
complete the missing functions in a manner as you've described, as the last
missing function is provided I always receive an internal linking error
message before the build completes.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] I am offering a $100 reward for linking static libraries

2022-08-22 Thread Anthony Walter via fpc-pascal
Marco,

The missing symbols change depending on the order and which libraries are
referenced. But I have tried all sorts of combinations and widdled them
down, but I can never get it to compile. I think it might be a problem with
the internal linker as Karoly suggested because sometimes I can almost get
it working and then when it's about to work I get a mysterious internal
linking error message.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] I am offering a $100 reward for linking static libraries

2022-08-22 Thread Anthony Walter via fpc-pascal
I never thought about the linker changes to FPC and am probably using the
internal one. I know in the past I had been able to compile / link
libraries created with MinGW GCC on Windows. Parts of the problem also
include determining which other static dependencies to link IN ADDITION to
the order of the linking. Yes, the order makes a big difference.
Unfortunately, many years ago (around 10) I lost or overwrote the bits of
code I was using for static linking on Windows (using the correct linklib
commands).

I will try to recreate it again, using your suggestion of falling back to
the external linker. If it works I'll send you a part of the reward. That
offer also stands for anyone else that can offer helpful advice.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] I am offering a $100 reward for linking static libraries

2022-08-21 Thread Anthony Walter via fpc-pascal
I will pay $100 to the first person that can solve my problem of linking a
compiled C static library to a Free Pascal program on Windows.

Recently I have been building many C libraries with GCC on Linux and
linking them to Free Pascal. These include building C libraries such as
"libxmp" for decoding mod/tracker music into PCM audio samples,
"libchuimpmunk2d" for simulating 2D solid body physics, or "libsdl2" for
cross platform controller input and haptic feedback among other things.

So far on Linux I am happily able to use a cmake/make/gcc toolchain to
build these C libraries from source and easily statically link them to my
Free Pascal programs.

Here is an example and abbreviated Pascal unit that links to a static build
of Chimpmunk 2D:

unit Chimpmunk2D;

interface

type
  cpSpace = Pointer;

function cpSpaceNew: cpSpace; cdecl; external;
procedure cpSpaceDestroy(space: cpSpace); cdecl; external;

implementation

{$ifdef linux}
  {$linklib c}
  {$linklib m}
  {$linklib chipmunk-linux}
{$endif}

end.

Where libchipmunk-linux.a is my static library build on Linux from the
Chipmunk2D C source code and is in the same folder as the source code as
"Chimpmunk2D.pas". This works fine on Linux.

I am also able to use mingw32 gcc to compile this same C source into a
static library for Windows using these two commands while inside the folder
containing the Chipmunk2D sources:

x86_64-w64-mingw32-gcc-win32 -static -static-libgcc -std=gnu99 -ffast-math
src/*.c -Iinclude -c
x86_64-w64-mingw32-ar rcs libchipmunk-win.a *.o
rm *.o

The problem then arises when I try to use {$linklib chipmunk-win}. No
matter how I try to arrange the static dependencies I cannot resolve
missing functions.

Many attempts were made compiling against other mingw32 static libraries
for Windows.

{$ifdef windows}
  {$linklib mingw32}
  {$linklib mingwex}
  {$linklib kernel32}
  {$linklib msvcrt}
  {$linklib chipmunk-win}
{$endif}

I get many errors similar to these below:

Verbose: Compiling resource
C:\Development\Projects\physics\lib\x86_64-win64\Physics.obj
Verbose: Linking C:\Development\Pascal\Projects\physics\Physics.exe
Physics.lpr(30,1) Error: Undefined symbol: ___chkstk_ms
Physics.lpr(30,1) Error: Undefined symbol: __mingw_raise_matherr
Physics.lpr(30,1) Error: Undefined symbol: __imp_WideCharToMultiByte
Physics.lpr(30,1) Error: Undefined symbol: __imp_IsDBCSLeadByteEx
Physics.lpr(30,1) Error: Undefined symbol: __imp_MultiByteToWideChar
Physics.lpr(30,1) Verbose: There were 5 errors compiling module, stopping
Verbose: Compilation aborted

BUT

If I use mingw32-w64 on Linux to create a DLL instead, then m
problems on Windows go away.

x86_64-w64-mingw32-gcc-win32 -static -shared -static-libgcc -std=gnu99
-ffast-math src/*.c -Iinclude -o libchipmunk-win.dll

However, I am not satisfied with an ever growing list of DLLs (I am at 6
currently) that must be deployed on Windows to build / run any project
using my Pascal toolkit. I thought I could resolve this static linking
problem on Windows at a later date, thus eliminating all the DLLs required
to run projects using my toolkit on Windows, but every time I return to try
another attempt I cannot resolve the external dependencies of something
like "libchipmunk-win.a".

Therefore, if anyone has expertise in the area of linking static C
libraries and can provide an example of how to link just one
("libchipmunk-win.a") on Windows either providing a different Windows C
compiling method (MSVC as opposed to x86_64-w64-mingw32-gcc-win32) and the
proper directives to correctly link a static library, I would gladly pay
that person $100.

Additionally, I would write up a guide for other people if they have
trouble while attempting to do the same thing.

If you have any tips or suggestions you can respond to this thread. If you
have a solution and want to collect the reward, reply to my email address
associated with this thread.

For reference, here are links to Windows static and dynamic libraries I;ve
already built. Feel free to build new static libraries yourself, but just
be sure to provide the list of tools and arguments you used if sending a
solution.

https://files.codebot.org/sysrpl/applications/libchipmunk-win.a
https://files.codebot.org/sysrpl/applications/libchipmunk-win.dll
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Here is real time graphics and physics simulation library

2022-07-31 Thread Anthony Walter via fpc-pascal
Thank you for your opinion.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Here is real time graphics and physics simulation library

2022-07-31 Thread Anthony Walter via fpc-pascal
Michael,

> Since there are many things you do not provide but which are needed
> in real-world programs, that makes it de facto useless.

This library is intended for fast 2D/3D animated graphics with 2D physics
simulations. These can be applied to things like games, kiosks, video
playback, and a bunch of other use cases. Mind you I also have network
sockets, a themeable UI widget system and with a designer, and other useful
and fun stuff (animation storyboards, sprites, shader object and vertex
buffer helpers, and so on). If you feel that providing a small runtime
built around SDL2 that provides a clean start (no SysUtils, Classes,
Graphics, Controls, or Forms units) makes for useless real-world programs
then I don't know what else can be said to you.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Here is real time graphics and physics simulation library

2022-07-31 Thread Anthony Walter via fpc-pascal
Michael, it's the same logic behind my now 12 year old Bare game system
that did the exact same thing. I am creating a small lPascal ibrary that
removes a lot of cruft and depends minimally on SDL for creating windows,
managing input, handling sound, threads / mutexes. and move most of the
core of what you need into a single unit (Tiny.System). In to browsable and
organized uint replaced all string handling with much more efficient and
powerful functions (see my FTP client and other socket protocols, my JSON
parser, ), I also add in multicast delegates for events, path handling,
file handling, file search, stream handling, and better threads (my simple
threads were copied into ).

One of the big problems IMO of the FPC base library, as compared to Delphi,
which I have brought up here before, is that in 1995 - 2001 while people
were using Delphi, they could learn by reading the source code to
SystUtils, Classes, Controls. This is something I found to be invaluable,
not only as a much better way of gaining an understanding of what is
happening, but also a better way of debugging and painting.  As I have
mentioned before, and have received the response that you're not supposed
to read the source code with the FPC base library, you're supposed to just
already know it.

Here are some tidbits from one of those past discussions"

> "I cannot share code, obviously, but I'll say that the code is a big mess
of
> IFDEFS, used in what seems to me an inconsistent manner (if there is any
logic, I fail
> to see it). Lazarus has understanding of IFDefs, but the Delphi IDE does
> not (just as it does not understand include files), killing the code
> navigation, making it hard to navigate or understand these unit."

> "I normally do not visit these units, so it doesn't harm me, but when I by
> accident ended up there I remarked it...
> I think the problem is more on the poor guys that must maintain it :)"
>
> "These units are not this way for the sake of browsing, but for the sake
of
> maintainability."


> "And honestly, I cannot even remember when I had to look up something in
> sysutils or system. I expect experienced people to know these units better
> than the back of their hand. For beginners I think documentation is better
> suited."

And lastly:

> "In short: the RTL will stay as it is, because it's a proven design
without
> better alternatives available."

Well, here I present one alternative from my own imagination. Maybe some
people might see this alternative and find inspiration, where in this
alternative most of the stuff you need for your general purpose programming
in one unit, and other more specialized functionality in others. For
example the the Tiny.Application has window and context creation, base
scene and widget, as well as input from mouse, keyboard, joystick, and
haptics. The Tiny.Graphics unit defines everything you need for drawing as
well as image handling. The Tiny.Physics unit has everything you need for
physics simulation. Everything is organized into browsable units, with
documentation right above most everything (in the form of comments).

Regarding separating the documentation, I am not sure if you remember
 but my
Bare library has a really good HTML based help system that is autogenerated
from the source code. This Tiny library will use my same HTML help
generator when I finish adding in a few more features including converting
themes to use SVG theme definition files and a UI designer which uses JSON
to store and recall UIs based on the custom widget system. My HTML help
generator also relies heavily on both grouping content (via the [group]
indicator in comments, but also includes detailed information about each
unit).

Oh and to preempt a side discussion about why also I wrote a widget system
(why not just use the LCL controls right?) here is a brief demonstration
from the SVG icons playground demo included in this release:

https://streamable.com/cv137g

I hope you or others here are not offended by either my by my library
design or my rational included in this reposne.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] Here is real time graphics and physics simulation library

2022-07-31 Thread Anthony Walter via fpc-pascal
I am looking for help adding in a bunch more features to my real time
graphics and physics simulation library. Here is a very brief overview with
some screenshots and sources.

https://github.com/sysrpl/Tiny.Sim

I need help finishing the conversion to SVG based widget theming and my UI
designer that uses JSON either in resources or dynamically in code, to
generate UI scripts.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] Function References Not Working As Expected

2022-06-05 Thread Anthony Walter via fpc-pascal
Regarding a message with an example project I write earlier, I discovered a
bug with function references. See this entry
 I submitted
to the gitlab issue tracker.

The summary is that a reference to a method function does not output the
current sequence of results. Instead, it always outputs zeros.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Are there any drawbacks to "reference to"?

2022-06-05 Thread Anthony Walter via fpc-pascal
Thanks for that, but is that true for all conditions. I remember reading
and tinkering about with Delphi when it first introduced closures. At the
time it made sense that the extra cruft and interface were needed to
capture local state, but I was under the impression that the interface was
only needed when a local state existed. In the case where the assigned
method or procedure is not a closure an interface doesn't need to exist.

Consider the following bit of code:

type
  TMultiply = reference to function(Value: Integer): Integer;

function MultiplyFunc(Value: Integer): Integer;
begin
  Result := Value * 10;
end;

function MultiplyClosure(const S: string): TMultiply;
var
  I: Integer;
begin
  I := StrToInt(S);
  Exit(function(Value: Integer): Integer
  begin
Result := I * Value;
  end);
end;

{ TForm1 }

function TForm1.MultiplyMethod(Value: Integer): Integer;
begin
  Result := Value * Tag;
end;

procedure TForm1.Button1Click(Sender: TObject);
var
  M: TMultiply;
begin
  case Tag of
0: M := MultiplyFunc;
1: M := MultiplyClosure('15');
  else
M := MultiplyMethod;
  end;
  WriteLn(M(4));
  Tag := Tag + 1;
end;

In the situation of "M" being assigned a reference to MultiplyFunc no local
state information needs to be captured inside MultiplyFunc. There will
never be a need to create or initialize an interface for the purpose of
capturing state. The underlying compiler code ought to be able to discard
any code generating an interface and simply call MultiplyFunc.

In the situation of "M" being assigned a reference to MultiplyClosure the
local variable "I" needs to be captured because it makes use of an
anonymous function. As such, there is a need for a mechanism to
capture this state. If the underlying compiler code uses a reference
counted interface to accomplish this, then that is an
understandable penalty because some capture mechanism is necessary.

In the situation of "M" being assigned a reference to MultiplyMethod again
no local state information needs to be captured inside MultiplyMethod. The
reference to Self is passed to the method as a hidden parameter each time
it is invoked. "M" can a simple two pointer data structure (see TMethod),
and no closure (or interface mechanism) is needed.

So in summary, some mechanism, such as a reference counted interface, is
only needed when a value of type TMultiply is assigned to an anonymous
function (a closure). Of course code that invokes a TMultiply would need to
know when to use any of these possibilities (a function, method, or closure
reference). I imagine detection of this possibility could be simply
implemented as a small data structure, thereby saving a lot of overhead and
or complexity in situations where TMultiply uses a closure reference
infrequently:

TReferenceTo = record
  Kind: Integer; // 0 = procedure/function, 1 = method, 2 = closure
  case Integer of
0: (Code: Pointer);
1: (Method: TMethod);
2: (Intf: IInterface);
  end;

Additional note: The most recent trunk revision of fpc from gitlab has a
major bug with either

{$modeswitch functionreferences}
or
{$modeswitch anonymousfunctions}

I will follow up with more information about that bug in a different thread.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] Are there any drawbacks to "reference to"?

2022-06-05 Thread Anthony Walter via fpc-pascal
As the "reference to" feature was recently added to fpc trunk, I'd like to
ask if internally there are any penalties (performance perhaps) or
drawbacks to using them in place of the more traditional "procedure" and
"procedure of object" types?

It's my understanding that for example using this code:

type
  TNotifyEvent = reference to procedure(Sender: TObject);
  // old version below
  // TNotifyEvent = procedure(Sender: TObject) of object;

Would allow BOTH methods and normal procedures to be assigned to fields or
variables of this redefined version of TNotifyEvent. The obvious benefit
would be that users could then have more options when assigning event
handlers, including anonymous procedures in addition to normal procedures
and methods.

If there are no drawbacks to using "reference to" (given that the compiler
someone is using is up to date with this feature), would it make sense
for everyone to start using it in place of l "procedure" and "procedure of
object" types? Obviously, when I say "procedure" in this question, I also
mean to include "function" as well.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] TProcess Running is unreliable on Linux

2021-12-05 Thread Anthony Walter via fpc-pascal
Okay, this is a bit longish but related to my problem. I wrote this remote
terminal program which is explained somewhat in the video below. This is
where I am having the issue with Running sometimes not correctly reporting
the proper value.

https://www.twitch.tv/videos/1224798488
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] TProcess Running is unreliable on Linux

2021-12-04 Thread Anthony Walter via fpc-pascal
On Linux using 3.3.1 build of FPC I've found that in many situations the
Running property of TProcess is unreliable. Is this a problem with
which anyone is familiar? I've searched around and haven't found any
discussions related to this problem.

In my experience, I've found situations where the Running property always
returns True even when the process spawned by TProcess is definitely not
running. As an example, I have a timer component checking every 100ms if a
'/bin/bash' process I launched and am using with redirection of input /
ouput pipes has exited.

procedure TMyForm.MyTimerTimer(Sender: TObject);
begin
  if not MyProcess.Running then
Close;
end;

And is some cases even though I am sure the bash instance associated with
MyProcess has exited, the above code will never close the form. I do not
even have to do with the bash instance. I can just wait 1 minute, close it,
and MyProcess still thinks it's running. This happens occasionally and
randomly and is a bit frustrating to deal with.

Any insight as to what is happening would be appreciated.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] First Version Vector Toolkit in OpenGL

2021-11-06 Thread Anthony Walter via fpc-pascal
@Benjamin

That's very nice and impressive. Does it just have that one theme or is it
skinnable? I looked at your source it if I understood it correctly, all the
theme color information is in a shader. This leads me to think most widgets
are rects and that cannot be changed easily. What about drawing with vector
paths, such as arcs, curves, lines, with fills and strokes? It would seem
we are working on similar things.

Regarding my work, I am mostly concentrating on the vector graphics part,
with the UI toolkit only being developed to aid in configuring options. I
am also going to be adding 2D physics to my library. I've got it working on
Windows, Mac, Linux, and Pi including the new Pi Zero 2 W. On Pi I am using
a display serverless (no Xorg, no window manager) version of SDL with the
OpenGL ES2.

Five Demo:
https://streamable.com/8gk0ss

Widgets and Drawing:
https://streamable.com/1hfydu

Above are links to video captures of vector drawing demos I recorded
just now using my library. I have a few more demos I am working on that
need to completing before I will publish my first release.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] First Version Vector Toolkit in OpenGL

2021-11-03 Thread Anthony Walter via fpc-pascal
@code

It's a bit weasely to claim immediate or retain based on how the underlying
implementation works. The UI toolkit is drawn using a vector based OpenGL
library. The library uses hardware vertex buffers, render buffers, and a
hardware stencil buffer (for anti-aliasing) to draw lines and shapes. With
regards to what people familiar with OpenGL would consider, this is the
opposite of immediate mode.

However, these vertex buffers are repopulated every frame and where the
entire scene is redrawn. This makes it seem to fall under the auspice of
immediate mode.

BUT

If you read up a few messages back, I described how you can enable render
buffers to save your work, and it's quite possible and even I'd say easy to
do with my framework. But it's an opt-in step.

HOWEVER

This UI toolkit is only an incidental part of the library I am writing. The
actual purpose of the library is to provide users with a very fast 2D
graphics system with a hardware accelerated backend to render vector
graphics. Further work will also include a Pascal object oriented interface
to the fairly robust, fast, and powerful Chipmunk2D physics engine. My
creating of this UI toolkit is only meant to give people writing physics
simulations, games, or graphical demos a means to select, input, or change
options for their physics simulation, game, or graphical demo. It is not
meant to be used as a general purpose UI toolkit.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] First Version Vector Toolkit in OpenGL

2021-11-03 Thread Anthony Walter via fpc-pascal
Tonight I added a third theme based on nothing in particular. I named it
graphite. With the completion of this theme, the UI toolkit is feature done
for this first release. I am going to work on writing a custom performance
graphing widget, create a few more demos, write a bit of documentation,
then publish.

Here is a video where I change widget themes while running my text brush
demo:

https://streamable.com/00amir
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] First Version Vector Toolkit in OpenGL

2021-11-02 Thread Anthony Walter via fpc-pascal
New themes are defined by this abstract class from which you would inherit
and implement. Sliced up bitmaps could be used to create a theme for sure,
but I have implemented the themes so far using vector drawing commands
exclusively.

  TTheme = class
  public
{ Calculate the actual theme color }
function CalcColor(Widget: TWidget; Color: TThemeColor): LongWord;
virtual; abstract;
{ Calculate the size of a widget }
function CalcSize(Widget: TWidget; Part: TThemePart): TSizeF; virtual;
abstract;
{ Render the widget }
procedure Render(Widget: TWidget); virtual; abstract;
  end;

There are two themes I have implemented so far. One theme based on the
popular Arc Dark Linux theme, and the other based on Windows 95 or what I
call the Chicago theme. See this screenshot:

https://cache.getlazarus.org/images/desktop/both-acr-dark-and-chicago-theme-at-the-same-time.png

After settling on how to implement my first theme Arc Dark, adding the
Chicago theme was quite easy. I just changed some system colors and a few
of the size / render options and I was done. One difference in the newer
Chicago theme was that active window captions would be a different color,
and I implemented the classic Windows 95 dotted focus rect for controls
that can receive input focus.

An interesting feature is that themes can be applied on a per widget level,
or they can be inherited from the parent widget. Each widget has a computed
property that reflects any property which can be inherited from the visual
parent hierarchy. This includes computed opacity, enabled, visibility,
boundaries, the theme being used, and so on.

Another point of interest is how icons for message boxes, buttons, and
other controls are handled. I reuse the text property and use a vector
glyph font. You can change the glyph font to get different icons, but for
now I am using the FOSS material design font and wrote a cross platform
small utility to assist in picking out icons:

https://cache.getlazarus.org/images/desktop/icon-utility.png

Yesterday I completed modal windows support and added a few modal window
message type functions to the main widget. As an example this is how
MessageBox(const Message: string) implemented in TMainWidget:

procedure TMainWidget.MessageBox(const Message: string);
begin
  with Add do
  begin
with This.Add do
begin
  Align := alignCenter;
  with This.Add do
  begin
Align := alignCenter;
Text := '';
  end;
  with This.Add do
  begin
Align := alignCenter;
MaxWidth := 400;
Text := Message;
  end;
end;
with This.Add do
begin
  Align := alignCenter;
  Text := 'OK';
  ModalResult := modalOk;
end;
Text := 'Message';
Pack;
X := (Self.Width - This.Width) / 2;
Y := (Self.Height - This.Height) / 2;
ShowModal(MessageBoxClose);
  end;
end;

And this is the result:

https://cache.getlazarus.org/images/desktop/message-box.png

And with the Chicago theme:

https://cache.getlazarus.org/images/desktop/message-box-chicago.png

Mind you, this UI toolkit is only meant to be a minimal system for
configuring or interfacing with a game, physics simulation, animation or
demo program. It is not intended to be a general use cross platform UI
framework.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] First Version Vector Toolkit in OpenGL

2021-11-01 Thread Anthony Walter via fpc-pascal
At the end of another days work on this UI toolkit:

https://streamable.com/5ttp9b

I added: hbox, vbox, slider, tooltips, and optimized things a bit. I also
added theme color querying, color blending based on opacity, and disabled
states for all controls. Stackable windows are now a feature and mouse
activation brings the picked top level widget to the front of the Z Order.
Custom controls are now available.

I plan to add: Write a `redmond` win95 style theme. Write a few example
custom controls. Add modal window support and dialog box functions.

Then after writing a few more demos and cleaning up my existing demos to
use the widget UI system, writing documentation, I'll publish the first
release.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] First Version Vector Toolkit in OpenGL

2021-10-31 Thread Anthony Walter via fpc-pascal
That's a very good question Ryan.

The short answer is this library draws everything each frame. It's meant
for writing, games, physics simulations, or drawing animated demos. It runs
as fast as you let it go, much like a game program.

BUT

It includes the ability to easily create and manage render buffers objects.
These render buffers allow you to draw to a buffer, then just display the
same buffer repeatedly, where you can change it only when needed. This is
like the composting system you mention, but it's an opt in feature. The
curtains demo linked in my OP is using a render buffer. If I didn't slow it
down it would render instantly and there would be no fun watching it draw
updates.

Additionally, there is a fixed step logic method meant for game or
simulation logic that is always invoked at every 1/120 of a second. This
ensures simulation logic returns the same results regardless of computing
or video render speed.

And finally, regarding compositing, the Canvas interface has a set of modes
determining how pixels are combined when new pixels are added. These modes
can do things like produce a negative image, lighten or darken,
multiply pixels, apply masks, and other things. They are like layer modes
in Gimp or Photoshop.

Oh and I almost forget. You can adjust the vsync or turn it on/off in my
library, allowing you more control over CPU / GPU resource usage.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] First Version Vector Toolkit in OpenGL

2021-10-31 Thread Anthony Walter via fpc-pascal
You might have read in my prior message to this group my announcement of a
vector graphics and physics library I've been writing for FPC.

In this first release, I am taking a stab at designing a new user interface
toolkit from scratch based on the vector graphics library rendered purely
in OpenGL. Below is a video of my first test of this toolkit and I thought
I'd share. Perhaps some of you may have some suggestions.

https://streamable.com/n42kll

Please bear in mind, this is meant to be a VERY minimal toolkit for the
purpose of configuring or inputting settings in either game like programs
or physics simulation programs. It includes a limited set of controls:
windows, panels, sliders, push buttons, glyph buttons, check boxes, text
entry, labels, image, and one custom paint control where you can draw
whatever you want.

That said, everything is fully themeable and you can write or switch to
different themes. The theme system manages the size of each control
element, their visual representation, and the fonts and colors. It operates
completely independent of the controls.

Layout is handled for you automatically by the container controls, window
or panel, where children can be tiled horizontally, or vertically and
placed near, center or far. Each control can have custom margins and
containers can have custom size borders (space between controls and their
four edges).

As mentioned before, this library will be released to a git repository soon
with a FOSS license. It will be able to run on Windows, Mac, Linux, and Pi
including the new Pi Zero 2 W.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Writing Pascal Physics and Vectors

2021-10-28 Thread Anthony Walter via fpc-pascal
Ah, so that was you who wrote the C wrapper? I saw that a while ago and
considered using it, but after looking at and exploring how
Chimpmunk2D works, I decided it was smaller, pretty darn good. That and
Chipmunk2D is already C, so very little work was needed from me to convert
it to work with Pascal.

Again, the physics part will be in my second release. The first part is
just getting the vector graphics and a minimal GUI toolkit in OpenGL
working. That plus an overview and reference website similar to my
https://docs.getlazurs.org website.

If anyone cares to know more, here is a brief description of how my object
oriented wrapper around Chipmunk2D physics is organized.

ISpace is the base object to work with physics. If you use the
TPhyiscsScene class it's created and managed for you automatically. ISpace
provides properties for controlling gravity, bodies, and joints. There is
one ISpace object per physics simulation.

IBody objects are added to ISpace using ISpace.NewBody, ISpace.NewDynamic,
and ISpace.NewStatic methods which create kinematic, dynamic, and static
bodies respectively. Kinematic bodies react to collisions with each other
and are affected by forces such as gravity. Dynamic bodies can be moved
manually by the programmer, but are otherwise unaffected by forces and
collisions. Static bodies cannot move but kinematic bodies may bounce off
them.

IShape objects are added to bodies using IBody.NewCircle, IBody.NewRect,
IBody.NewSegment, and IBody.NewPolygon method. A body by itself has no
shape. Its shape is defined by the shapes you add to it. Shapes within the
same body do not collide with each other or move with respect to the other
shapes within the body. Each shape within a body can have different
friction, density, and elasticity (or bounciness).  The mass and center of
gravity of a body is calculated by its constituent shapes.

IJoint includes a list of several joint types (I will not list them all
here), and they can be used to connect two bodies together. Some joint
types are motors, other are springs, and some are hinges or pivots.
Collisions between bodies connected by a joint can be set to be ignored for
those two bodies.

IArbitors allow you to either detect and handle collisions between body
types you define. You can ignore them if you simply want the physics system
to handle collisions for you.

Masks can be applied to body types, allowing you to say which bodies can
collide with which other bodies. For example, if you were writing a game
you could setup enemy bullets bodies to pass through enemy bodies using a
simple mask. The enemy bullet bodies could then be setup to collide with
the player body and wall bodies.

There is a lot more to the physics system, but my object orient design,
plus some documentation and examples ought to get most people running in
short order.

I have been mostly working on the graphics portion for the past week and
haven't been working with the physics system in that time. Last time I was
working on it I was trying to figure how how to make a decent rope. I am
not at all satisfied with my initial work, and maybe someone can help me
get rope physics working better, but below is the result of my first
attempt.

Rope test : https://streamable.com/lli866

I'll put all the information above and the source code online in a git
repository soon with a FOSS license. If anyone wants to help, let me know.
Join me in the discord channel listed in my initial message, or see me on
liberachat irc in the #fpc channel.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Writing Pascal Physics and Vectors

2021-10-28 Thread Anthony Walter via fpc-pascal
Thanks for the interest Ryan. I am preparing to push my code to a public
git repository with a FOSS license. In order to get this out soon it will
be broken into a few releases.

The first release, which is 100% done but needs accompanying documentation,
might be out in a week's time. It includes an OpenGL vector graphics system
based on NanoVG, with a friendly object oriented interface and some
examples programs. I am also writing a basic widget system to render
controls such as buttons, sliders, and text boxes that are rendered by the
same vector graphics system. This will be in the first release

Here is a small selection of the examples / demos I've written thus far.

Text paint: https://streamable.com/m4e4qn
Curtains: https://streamable.com/6o5y5o
Mouse track: https://streamable.com/uk8ak7
Crowd walk: https://streamable.com/mc3he6
Fire spark: https://streamable.com/fm02c4

The second release will include the complete physics system. It's about 80%
done and again will be a friendly object oriented wrapper around the
Chipmunk2D physics library. I will add to the same documentation system I
am writing for the first release.

The third release will likely include a full object oriented wrapper about
the Nuklear widget library using my vector graphics system as the renderer.
It hasn't been started yet.

If anyone is interested, here is the interface to the graphics system. It
centers on the idea of an ICanvas interface I've designed:

https://gist.github.com/sysrpl/6119ed313c8382004131761d6e292b3b
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] Unable to link static lib files on Window

2021-10-25 Thread Anthony Walter via fpc-pascal
I know I was previously able to link static library files on Windows with
FPC, but hadn't used this feature in a while. When I recently tried using
static linking I am receiving error messages leaving me to
believe something has changed with the compiler.

The error messages I receive all relate to `unknown COFF magic` found in my
files, and the builds fail at linking.

I am using Mingw for Windows targeting an x86_64 to build static libraries.
If I link them to functions in my Pascal code using:

{$linklib mystaticfile.a}

I receive the error when trying to build. Also, if I try to link using the
Mingw static libraries with FPC I get the same message.  As another option,
I have also tried building static libraries on Windows both using MSVC with
everything set to compile as C code (vs C++), and again using the MS C
command line compiler (CL.EXE) and the same thing happens.

It's as if when using x86_64 static libraries, FPC always encounters magic
COFF errors and will not link. I am not sure what is going on. When did FPC
lose the ability to link static libraries with x86_64 architecture on
Windows?

I am using the most recent non-trunk revisions of FPC + Lazarus.

If it helps I can follow up with post the C code, compiler /  linker
commands I am using to generate these static libraries, and binaries of
these libraries for anyone to test and research the problem.

In the meanwhile, can someone please describe what are the usual causes of
`unknown COFF magic`?
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] FPC 3.2.2 Build Error on Mac

2021-10-17 Thread Anthony Walter via fpc-pascal
I am trying to build FPC from 3.3.2 sources on a Mac and am getting errors
complaining about two binary files having different sizes. Could someone
help me figure out what's going on?

Here is a list of what is output is in the terminal after waiting a while
for `make all` to complete. Also, fpcupdeluxe has basically the same
problem on my Mac.

Thank you.

/Users/macuser/Development/source/compiler/ppc2 and
/Users/macuser/Development/source/compiler/ppc3 are equal
/bin/cp -fp /Users/macuser/Development/source/compiler/ppc3 ppcx64
/bin/cp -fp ppc3 ppc3.tmp
/bin/cp -fp ppcx64 ppcx64.tmp
strip -no_uuid ppc3.tmp
strip -no_uuid ppcx64.tmp
/usr/bin/codesign --remove-signature ppc3.tmp
/usr/bin/codesign --remove-signature ppcx64.tmp
/usr/bin/diff ppc3.tmp ppcx64.tmp
Binary files ppc3.tmp and ppcx64.tmp differ
make[2]: *** [cycle] Error 2
make[1]: *** [compiler_cycle] Error 2
make: *** [build-stamp.x86_64-darwin] Error 2
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Writing Pascal Physics and Vectors

2021-10-16 Thread Anthony Walter via fpc-pascal
If you are running x64-86 Linux, would like to get my code you can join my
Discord channel at the link below. Windows and Mac users will need to have
cmake and the ability to build with it, but they're invited as well.

https://discord.gg/NuTDatAz

I am making a lot of changes, so I don't want to create a public git repo
just yet. Currently I am working on writing rope and water physics demos,
and will probably refactor everything before I do my first git check in.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Writing Pascal Physics and Vectors

2021-10-15 Thread Anthony Walter via fpc-pascal
I often use squares / cubes and such like:

X := X * X * X;

When I am unsure how much steep of a curve I want. I just add / remove X
and run the test to see if the curve looks good. It's just a preference
thing and considering the other processing intensive stuff going on, I am
sure it doesn't make a lick of difference.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Writing Pascal Physics and Vectors

2021-10-15 Thread Anthony Walter via fpc-pascal
>
> I have writen my own fairly extensive game engine and this will be
> integrated into it sometime soon. My thought was it would be more useful to
> create a minimal version first that other people could evaluate and test
> more easily.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] Writing Pascal Physics and Vectors

2021-10-15 Thread Anthony Walter via fpc-pascal
I've been working on writing Pascal bindings a friendly object orient
interface to a few open source projects. I have put together Chipmunk2D,
NanoVG, MiniMP3, and SDL2 for rendering nice real time platform independent
programs where fast logic can be easily controlled with physics or fast
graphics can easily be rendered.

If you are interested in hearing more, I've put up a quick and dirty video
of one of my test scene that precisely detects points of contact and the
forces behind them at the page below.

https://www.getlazarus.org/videos/physics/collisions/

Source code for the test scene is included on that page. If you want to
help, I need to bounce ideas off people as well as test on Raspberry Pi,
Mac, and Windows. Message me and maybe we can try to meet on a Discord
channel.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] How To: Use lib curl example

2021-09-28 Thread Anthony Walter via fpc-pascal
For the benefit of others, there are a few problems with the FPC example
to note.

1) The callback CURLOPT_WRITEFUNCTION should return the number of bytes
handled.
2) You should check the result of curl_easy_perform to determine if
the curl perform operation (HTTP GET) was successful.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] How To: Use lib curl example

2021-09-28 Thread Anthony Walter via fpc-pascal
Michael,

You are right, they are very similar. I didn't know of the existence of the
example to which you referred. Thank you for pointing that file out. I
searched for it just now and took a look. One difference is that my example
ignores certificates problems, but this difference is important in my tests
as without those lines the HTTPS sites I am retrieving will mysteriously
fail. Another is that I am concatenating to a string passed by reference in
the curl `write function`.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] How To: Use lib curl example

2021-09-27 Thread Anthony Walter via fpc-pascal
I was having some problems using vanilla sockets and OpenSSL to read a few
specific web pages using HTTPS. Normally I don't have any problems
using HTTPS, but with a few sites my code was not working. I ending up
finding the RTL unit LibCurl in one of the FPC packages and got it working
without too much trouble. LibCurl is a library allowing programmers to get
the functionality of the curl program without launching an external process.

If anyone is interested, here is a small bit of code to GET a page over
HTTP or HTTPS using LibCurl.

Interface:

function CurlGet(const Url: string; out Data: string; UserAgent: string =
''): Boolean;

Implementation:

uses
  LibCurl;

function WriteData(Ptr: PChar; MemberSize, MemberCount: UIntPtr; var Data:
string): UIntPtr; cdecl;
var
  S: string;
begin
  SetString(S, Ptr, MemberSize * MemberCount);
  Data := Data + S;
  Result := MemberSize * MemberCount;
end;

function CurlGet(const Url: string; out Data: string; UserAgent: string =
''): Boolean;
var
  Curl: PCURL;
begin
  Data := '';
  Result := False;
  if Url = '' then
Exit;
  Curl := curl_easy_init();
  if Curl = nil then
Exit;
  try
curl_easy_setopt(curl, CURLOPT_URL, [PChar(Url)]);
if UserAgent <> '' then
  curl_easy_setopt(curl, CURLOPT_USERAGENT, [PChar(UserAgent)]);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, [@WriteData]);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, [@Data]);
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, [0]);
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, [0]);
Result := curl_easy_perform(curl) = CURLE_OK;
  finally
curl_easy_cleanup(Curl);
  end;
end;
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] JsonTools Update

2021-07-31 Thread Anthony Walter via fpc-pascal
An update to JsonTools has been posted to its github page. The escaped
double quoted string issue has been fixed and some helpful methods have
been added. This page summarizes the changes:

https://www.getlazarus.org/json/#update
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] FPC 3.2.0 released!

2020-06-21 Thread Anthony Walter via fpc-pascal
Great news and thank you to all the developers! I carefully read through
the notes and look forward to using the new array methods and also the
management operators.

One question to everyone though, what use cases do you see for the
IsManagedType intrinsic?
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] sizeof TTypeKind?

2020-03-20 Thread Anthony Walter via fpc-pascal
I think what Ryan is asking about is how to find the size of the
variant part of TTypeData as used in the "case TTypeKind of" section. As in:

  public
 {$ifdef PROVIDE_ATTR_TABLE}
 AttributeTable : PAttributeTable;
 {$endif}
 case TTypeKind of
tkUnKnown,tkLString,tkWString,tkVariant,tkUString:
  ();
tkAString:
  (CodePage: Word);
{$ifndef VER3_0}
tkInt64,tkQWord,
{$endif VER3_0}
tkInteger,tkChar,tkEnumeration,tkBool,tkWChar,tkSet:
  (OrdType : TOrdType;
   case TTypeKind of
...
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] modeswitch multihelpers precedence problem

2020-03-10 Thread Anthony Walter via fpc-pascal
Marco, now that's some good insight. I believe you are correct.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] modeswitch multihelpers precedence problem

2020-03-10 Thread Anthony Walter via fpc-pascal
Stdreamer, you are wrong. The last unit take precedence. Please test to
verify.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] modeswitch multihelpers precedence problem

2020-03-10 Thread Anthony Walter via fpc-pascal
An issue has been submitted here
https://bugs.freepascal.org/view.php?id=36783 under the FPC compiler with
tags "type helpers".

I just want to take a moment and thank you guys for your work and explain
for a moment my STRONG support for multiple type helpers. Multiple type
helpers have been a big savior to me, allowing me to elegantly solve a long
standing design problem I've had with one of my projects. If you guys could
take a little time and consider the problem I am about to describe I hope
you can think about it and see why and how multiple type helpers have made
a big difference to me.

Previously I have always had a disconcerting problem of how to handle
assets in my game engine. An asset is an unknowable concept until such a
time as when you come up with an idea for data and the code to use it when
writing a game. Examples of assets are things like textures, sounds, shader
programs, 3D models, and can be other things you invent, such as game
levels, ai scripts, animation paths, or longs lines of dialog in text form.
The point is you never know as a developer what kind of asset you might
need for a particular game or project and always can invent new ones.

>From a development point of view things "never know" issue presents an
issue. I do know I want a universal class to search for and manage assets,
but I always often need to tie those assets to a context, for example
both textures, shaders, and also 3D models, need to be aware of an OpenGL
context in order generate and use assets correctly belong to a specific
current context correctly.

Multiple type helpers have helper me solve this problem in an
elegant manner. Any unit I write with my framework which needs to implement
an asset type adds a type helper to a the TContext class. Then if I need to
use an asset type in another unit I simply include that asset unit in my
uses I have access to those assets managed and catalogs by the current
context. Consider this snippet of code:

uses
  { Bring in texture asset extensions }
  Codebot.Render.Textures

{ Later in code I can then access textures valid for that context using a
type helper }
Tex := Context.Textures['smiley_face'];

Multiple type helpers allow other units to define their own assets and
attach them directly to a context. Now with multiple type helpers many
units can share assets belonging to a single context. In my case I've made
all assets derive from a TContextManagedObject giving each asset type an
owning context and a name to fit into a particular slot on on a context.
Other type helpers for TContext in other units define extensions such
as Context.Shaders[], Context.Models[], and Context.Fonts[]. In my
opinion when presented with my asset problem, multiple type helpers is the
ultimate solution to this "never know" issue.

Thanks again for those of you who took the time to read and consider my use
case. I know there are a multitude of other design approaches to handling
this problem, but for my work habits multiple type helpers brings in the
most optimal way of handling things, and again this is in my opinion.

Anthony
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] modeswitch multihelpers precedence problem

2020-03-09 Thread Anthony Walter via fpc-pascal
I started adding {$modeswitch multihelpers} to some of my code and noticed
a problem. It would seem that the SysUtils unit is defining type helpers
for the string type and this led me to discover that multiple type helpers
takes precedence over other helpers in a way that is conflicts with other
pascal rules.

To demonstrate, if I have MyUnit.pas that defines a string type helper
with EndsWith() and an IntToStr() function then consider the following code:

program Test;

uses
  MyUnit, SysUtils;

begin
  'hello'.EndsWith('lo'); // invokes MyUnit.TStringHelper.EndsWith()
  IntToStr(12); // invokes SysUtils.IntToStr()
end.

But if I reverse the uses order:

program Test;

uses
  SysUtils, MyUnit;

begin
  'hello'.EndsWith('lo'); // invokes SysUtils.TStringHelper.EndsWith()
  IntToStr(12); // invokes MyUnit.IntToStr()
end.

What should happen is that both examples use the function from the last
unit in the uses clause. Using the example above with "uses SysUtils,
MyUnit;" the following should happen:

  'hello'.EndsWith('lo'); // invokes MyUnit.TStringHelper.EndsWith()
  IntToStr(12); // invokes MyUnit.IntToStr()

I know some of you might see this as a small problem, but it's an
inconstancy that can lead to a situation where the wrong methods will be
called without being obvious. The standard has long been that when an
identifier of the same name is is found, pascal will choose to identify the
name as the one coming from the last matching unit in the uses clause.
Multiple type helpers should follow this same rule.

Please discuss and if we all agree I will file this as a bug in mantis.
Thanks.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Add API to official documentation search

2019-11-20 Thread Anthony Walter via fpc-pascal
You said, "but its got bugs and I haven't been able to contact the
developer to fix them"

What are the bugs you want fixed?
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal