[fpc-pascal] RAD Studio XE4 Released?

2013-04-23 Thread vfclists .
http://www.h-online.com/developer/news/item/RAD-Studio-XE4-focuses-on-cross-platform-apps-1848176.html

http://www.embarcadero.com/press-releases/embarcadero-technologies-unveils-multi-device-true-native-app-development-suite
-- 
Frank Church

===
http://devblog.brahmancreations.com
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

[fpc-pascal] Examples of tiOPF logging in the wild

2013-05-16 Thread vfclists .
Are there some examples of using tiOPF logging besides those in the demos?


I want to use tiLogToGUI, but I am not happy with the amount of screen
space it takes. Is there some way it can be adapted or themed to be tidier
or smaller?

The code gives the impression that it can be embedded or extended in
another form or is
that a misconception on my part?

-- 
Frank Church

===
http://devblog.brahmancreations.com
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

[fpc-pascal] Should TObject or TComponent have a Comment property?

2013-07-11 Thread vfclists .
Should TObject or TComponent have a Comment property?

I think they should. One for the design itself and one for describing the
usage at design or runtime.

Smalltalk has it.

Consider it a version of the Hint property but for the developer

-- 
Frank Church

===
http://devblog.brahmancreations.com
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

[fpc-pascal] Re: [Lazarus] Should TObject or TComponent have a Comment property?

2013-07-11 Thread vfclists .
On 11 July 2013 23:07, Benito van der Zander  wrote:

>  Annotations like in Java would be nice...
>
>
> On 07/11/2013 10:22 PM, vfclists . wrote:
>
>   Should TObject or TComponent have a Comment property?
>
>  I think they should. One for the design itself and one for describing the
> usage at design or runtime.
>
>  Smalltalk has it.
>
>  Consider it a version of the Hint property but for the developer
>
> --
> Frank Church
>
> ===
> http://devblog.brahmancreations.com
>
>
> --
> ___
> Lazarus mailing 
> listLazarus@lists.lazarus.freepascal.orghttp://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
>
>
> --
> ___
> Lazarus mailing list
> laza...@lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
>

This attitude which exists in the Pascal community needs to end. I say
Pascal not FreePascal because when I examine a lot of free Delphi libraries
I see the same thing. Lots and lots of code and not a comment in sight. It
makes stuff needlessly difficult. The simple fact is documentation is never
going to happen because no one has time to create it with separate tools,
not even the people writing the code themselves. Coding time is the best
time for documentation because that is when the intent of the code is clear
and fresh in the developers mind, and incurs minimal additional cost. After
all it takes barely a minute or two to describe a function, and the same
parsing tools compiling the code can pull out the comments and create
documentation stubs if there is a need to flesh them out further, eg with
examples etc

Even a lot of the funded open source libraries don't have the resources to
create proper documentation. If you take Delphi for instance, since Turbo
Pascal, Delphi 7 etc the quality of documentation has gone down and these
are companies that are well funded.

Instead of doing the simple thing a purist attitude has been adopted which
never does anyone any good.

It is time developers learn to treat other developers as consumers not
people who are supposed to RTFC or RTFM. Developers are people who are
supposed to put parts together just by examining the function parameters
and the function descriptions rather than wade through loads of procedure
definitions and sample code full of similar sounding and confusing names.

Enough digression - if considered carefully a comment about the purpose of
an object belongs in the object definition itself. Why should interrogation
about an object's purpose be handled by a whole subsystem of code which has
precisely nothing to do with the object, ie the operating system, a help
displaying program, a filename which is the help document, as well as a
search string which is the object's name? Multiply that by the variety of
help displaying programs for each operating system, then by the number of
operating systems available then you can see how ridiculous the whole
concept is. Just bureaucracy piled on bureaucracy and attachment to ill
thought out convention and tradition. There is never a direct link between
an object and the  help display programs available on the operating system.

There is a totally insane disconnect here. The Smalltalk guys got it right.

There can be an options to strip the comments out in the final deliverable
just like the debugging information.

-- 
Frank Church

===
http://devblog.brahmancreations.com
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Re: [Lazarus] Should TObject or TComponent have a Comment property?

2013-07-12 Thread vfclists .
On 12 July 2013 09:09, Graeme Geldenhuys  wrote:

> On 2013-07-12 07:07, vfclists . wrote:
> > Coding time is the best
> > time for documentation because that is when the intent of the code is
> clear
> > and fresh in the developers mind, and incurs minimal additional cost.
>
>
> And you just said it yourself. If the developer of the code doesn't even
> have the time to add code comments in his code, why do you think having
> an "Comment" property would make it any better? It will not - the
> developer would still not have any time.
>
> You don't need seperate tools to create documentation - code comments
> can serve as documentation. You don't even need special formatting in
> code comments, because tools like Lazarus IDE can read plain text
> comments and show them as documentation. Please try it yourself to see
> what I mean.
>
>
Anyway I am not talking about documentation as such, just a property that
an object can be queried about on its role, something no different from the
Hint property of components, for the developer rather than the end user.

Regards,
>   - Graeme -
>
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>



-- 
Frank Church

===
http://devblog.brahmancreations.com
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Re: [Lazarus] Should TObject or TComponent have a Comment property?

2013-07-16 Thread vfclists .
On 15 July 2013 22:58, Kenneth Cochran  wrote:

>
>
>
> I completely disagree. It is the code that is the primary expression of
> intent not the comments. This is mainly accomplished through sensible
> identifier naming. Comments exist to compensate for a developer's inability
> to express intent through the code and IMHO should be reserved for this
> sole purpose. In most cases you should be able to look at a function
> signature and know exactly what that function's intent is. Likewise you
> should be able to tell the intent of a class by its name and the names of
> its public/published members. This is, at least, what I strive for in my
> own code. Bob Martin's "Clean Code" dedicates the entire 4th chapter to the
> discussion of comments and make some very compelling arguments for limiting
> their use.
>
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>

I have 2 main concerns here, a comment for the component itself which is
not particularly important and a comment for the component when I add it to
a form or data module. When I create a method I can add a comment to the
method. If I create a component in code, I can label that section of code,
but if I drag and drop a component from the palette onto the form what
option do I have?  Descriptive variable and component names have a habit of
getting too long. It is hardly for the end users sake unless the enduser is
a programmer. I just need something to help when working in the IDE, eg
hovering over a component and seeing the comment in addition to what is
current displayed.

-- 
Frank Church

===
http://devblog.brahmancreations.com
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

[fpc-pascal] Graeme would love this, or not, I think

2013-10-14 Thread vfclists .
You couldn't make this up. Is it a joke or not?

Department of Basic Education bans Free and Open Source Software in SA
Schools and mandates programming an ancient, moribund language in
contradiction of government's own policy 


http://dkeats.com/index.php?module=blog&action=viewsingle&postid=gen21Srv8Nme0_40332_1381256759&userid=7050120123

-- 
Frank Church

===
http://devblog.brahmancreations.com
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

[fpc-pascal] Re: Graeme would love this, or not, I think

2013-10-14 Thread vfclists .
I suspect is its a trick to introduce Linux by the back door. If their
Delphi programs can easily be switched to Lazarus the software will be easy
to convert to Linux and the Mac


On 11 October 2013 20:18, vfclists .  wrote:

> You couldn't make this up. Is it a joke or not?
>
> Department of Basic Education bans Free and Open Source Software in SA
> Schools and mandates programming an ancient, moribund language in
> contradiction of government's own policy <http://twitter.com/share>
>
>
>
> http://dkeats.com/index.php?module=blog&action=viewsingle&postid=gen21Srv8Nme0_40332_1381256759&userid=7050120123
>
> --
> Frank Church
>
> ===
> http://devblog.brahmancreations.com
>



-- 
Frank Church

===
http://devblog.brahmancreations.com
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

[fpc-pascal] Is there an industry language for specifying for declaring GUIs in JSON?

2013-12-01 Thread vfclists .
Are there some industry standards for specifying GUIs in JSON?

Something which can specify the type of elements like edit controls,
buttons, the positions etc, and draw stuff like squares, triangles, boxes
etc? It doesn't have to be an official standard, but have widespread use to
make it easier to work with?

QML appears to be one, are there any others?

FWIW I am trying to use the LCL Widgets as a means of displaying
information from interpreter based development, passing the GUI creation
commands over a socket.


-- 
Frank Church

===
http://devblog.brahmancreations.com
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

[fpc-pascal] with statement using mulltiple objects

2014-09-13 Thread vfclists .
According to the docs the with statement when used with mulltiple objects
only works with the last parameter.


The statement
With A,B,C,D do Statement;

is equivalent to
With A do
 With B do
  With C do
   With D do Statement;

-- 

I thought that if all the objects have the property the statement would
apply to them eg.


with Label1, Label2, Label3 do
  Caption = 'Text'.


I thought all the 3 labels would have the caption set, but only Label3's
caption is set. Is this a difference between Delphi's Object Pascal and
FreePascal, or has Delphi's Object Pascal always worked in the same manner?


Frank Church

===
http://devblog.brahmancreations.com
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] with statement using mulltiple objects

2014-09-13 Thread vfclists .
On 13 September 2014 20:02, Sven Barth  wrote:

> On 13.09.2014 20:13, vfclists . wrote:
>
>> According to the docs the with statement when used with mulltiple
>> objects only works with the last parameter.
>>
>>
>> The statement
>>
>> With A,B,C,D do Statement;
>>
>> is equivalent to
>>
>> With A do
>>   With B do
>>With C do
>> With D do Statement;
>>
>> --
>>
>> I thought that if all the objects have the property the statement would
>> apply to them eg.
>>
>>
>> with Label1, Label2, Label3 do
>>Caption = 'Text'.
>>
>> I thought all the 3 labels would have the caption set, but only Label3's
>> caption is set. Is this a difference between Delphi's Object Pascal and
>> FreePascal, or has Delphi's Object Pascal always worked in the same
>> manner?
>>
>
> It has always worked in this manner. It's just for abbreviating typing,
> not for combining properties. (and then the with-variant with multiple
> elements is even more seldomly used than the single-element one...)
>
> Regards,
> Sven
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
>

What then is the nesting for if the command will only apply to the last
item with the property? Is each nested element supposed to be a property of
the enclosing element?

What is the rationale for such a statement, ie using multliple elements?

-- 
Frank Church

===
http://devblog.brahmancreations.com
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] with statement using mulltiple objects

2014-09-15 Thread vfclists .
On 13 September 2014 20:29, vfclists .  wrote:

>
>
> On 13 September 2014 20:02, Sven Barth 
> wrote:
>
>> On 13.09.2014 20:13, vfclists . wrote:
>>
>>> According to the docs the with statement when used with mulltiple
>>> objects only works with the last parameter.
>>>
>>>
>>> The statement
>>>
>>> With A,B,C,D do Statement;
>>>
>>> is equivalent to
>>>
>>> With A do
>>>   With B do
>>>With C do
>>> With D do Statement;
>>>
>>> --
>>>
>>> I thought that if all the objects have the property the statement would
>>> apply to them eg.
>>>
>>>
>>> with Label1, Label2, Label3 do
>>>Caption = 'Text'.
>>>
>>> I thought all the 3 labels would have the caption set, but only Label3's
>>> caption is set. Is this a difference between Delphi's Object Pascal and
>>> FreePascal, or has Delphi's Object Pascal always worked in the same
>>> manner?
>>>
>>
>> It has always worked in this manner. It's just for abbreviating typing,
>> not for combining properties. (and then the with-variant with multiple
>> elements is even more seldomly used than the single-element one...)
>>
>> Regards,
>> Sven
>> ___
>> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
>> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
>>
>
> What then is the nesting for if the command will only apply to the last
> item with the property? Is each nested element supposed to be a property of
> the enclosing element?
>
> What is the rationale for such a statement, ie using multliple elements?
>
> --
> Frank Church
>
> ===
> http://devblog.brahmancreations.com
>



This is a fragment I was using with multiple elements. So it means that all
this time it was only working  because all of them had been set at design
time and the command was only applied to the last one.

I wonder where I got the impression that because they all shared the
property the command applied to all of them.

  with qrySCParameters, qrySavedCommands, qryTemplateParameters,
qryLiveCommands, qryLCParameters do
  begin
Connection := dmCentral.localCommandsConnection;
  end;

dmCentral.localCommandsConnection.Connected := True;

I am happy with the use of 'with' on a single element, but using it with
multiple elements is plainly evil.

-- 
Frank Church

===
http://devblog.brahmancreations.com
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Free Pascal and Lazarus Nightly Builds

2015-03-12 Thread vfclists .
On 3 March 2015 at 17:47, Anthony Walter  wrote:

> This is a public notice. Get Lazarus has switched from hosting arbitrary
> revisions to hosting setup programs from nightly builds.
>
> http://www.getlazarus.org/setup/
>
> Going forward each night the current svn trunk sources of FPC and Lazarus
> will be updated and converted into a Windows installer, Linux, and
> Macintosh  archives. The installer, setup scripts, application shortcuts,
> and website have now prominently inform users that they have installed or
> might be installing nightly build versions of FPC and Lazarus.
>
> As before any changes get Lazarus makes are hosted in a diff file
> distributed with each install. This information is also mirrored on github.
>
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
>


Is there changes.diff kept up to date, regularly?

On the Linux version the patch has failed for me a number of times, so I
had to get the source directly from a local Git mirror. Including the
option to get the source from a local Git mirror will save a lot of
bandwidth. If the boot strapping FPC is not changed, then it may be better
to test for its presence and skip the download and extraction as well.
There is no sign that it ever gets changed by the script once it is
downloaded
-- 
Frank Church

===
http://devblog.brahmancreations.com
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] How do you build FPC?

2015-03-13 Thread vfclists .
On 20 February 2015 at 15:40, leledumbo  wrote:

> > FPC seems incredibly flexible and I'd like to take advantage
> of it on some other platforms but so far it looks like that is reserved
> for a wizard elite somewhere and nobody is saying how to get there.
>
> Other than the buildfaq, reading the Makefile.fpc might help (assuming you
> already know make) since all Makefiles are generated by fpcmake. The
> process
> is currently run hybrid with fpmake in many places (but as far as I can
> see,
> not all make has been replaced). Reading and understanding fpmake might
> help
> you, too.
>
> I myself customize my FPC directory layout, such that I can easily update
> my
> FPC from svn and cross build to 8 different targets (excluding host) with a
> single script execution, using only single fpc.cfg for all of them.
>
> The build process is no magic and easily understandable. Section 7 of the
> cross compiling wiki explains the prerequisites well, and in general, make
> all CPU_TARGET= OS_TARGET= suffices (optionally
> install if you want), except perhaps for arm targets where there are
> multiple implementations of FPU mode which you have to choose at make time.
>
>
>
> --
> View this message in context:
> http://free-pascal-general.1045716.n5.nabble.com/How-do-you-build-FPC-tp5721047p5721051.html
> Sent from the Free Pascal - General mailing list archive at Nabble.com.
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
>


Do you have some FPC/Lazarus compilation scripts or sample fpc.cfg files
you can share?

-- 
Frank Church

===
http://devblog.brahmancreations.com
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] How do you build FPC?

2015-03-13 Thread vfclists .
On 13 March 2015 at 15:09, Anthony Walter  wrote:

> Although it's not for the faint of heart, but you can follow this guide if
> you are determined to build it yourself:
>
> http://www.getlazarus.org/setup/making/
>
>
I have already checked that page. I want to see Leledumbo's scripts as well
as he is crosscompiling for 8 different targets.

-- 
Frank Church

===
http://devblog.brahmancreations.com
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Free Pascal and Lazarus Nightly Builds

2015-03-13 Thread vfclists .
On 13 March 2015 at 18:54, Anthony Walter  wrote:

> Okay, here is what was happening and I apologize for the confusion.
>
> Before the source files are updated each night, my script applies
> "changes.diff" the uploads the sources to an amazon s3 bucket (I pay for
> the bandwidth and avoid leaching from other peoples servers). Next the
> Linux install script downloads this file archive from an my amazon bucket,
> extracts it, and attempts to run "patch changes.diff". The problem being
> that the patch was already been applied the night before and as a
> consequence it fails. The install should still work same as normal, but the
> patch wouldn't have done anything.
>
> The fix, which has already been applied to the Linux setup script, is to
> not run patch on the extracted archive. You can validate this by re-running:
>
> curl -L http://www.getlazarus.org/download/?platform=linux -o setup.sh
>
> And examining the commented out patch command at line:
>
>
> https://github.com/sysrpl/Codebot.Setup/blob/master/linux/install.fpc-3.0.linux.sh#L251
>
> I believe this fixes the problem. Let me know if you have any further
> questions.
>
>
That is how I got it working. I made sure I updated the git mirror to the
latest version and commented out the patch command.

 I think you should also consider testing for the presence of the boot
strapping binary before downloading it as it doesn't seem to change that
frequently, or run a test to compare the version on the host server against
the local version. It is not just the bandwidth which may be an issue on
slow links, which may also be expensive. The time it takes matters.

The unzipping of the bootstrapping binary may also not be necessary as
there is no sign that any of the files extracted are changed during the
compile process.

It looks like developing efficient shell scripts is not one of the
favourite pastimes of FPC developers. Many of them are spoiled rotten by
Pascal and don't have patience for the quirkyness of bash and DOS batch
files. :)

-- 
Frank Church

===
http://devblog.brahmancreations.com
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] Is the current stable release of FPC 2.6.4 or 3.0.1?

2015-03-14 Thread vfclists .
Is the current stable release  FPC 2.6.4 or 3.0.1? Is it actually 3.0.1?

When I check this site - http://svn.freepascal.org/cgi-bin/viewvc.cgi/tags/
the last tag is release_2_6_4. Is that site for release versions only? Is
there another location which as the 3.0 series among its tags?

I don't know if I'm confused because the FPC accompanying Lazarus 1.4 is
still 2.6.4.

After checking the site I see that the branches directory contains
fixes_3_0 and the tags directory goes up to release__2_6_4.

Does that mean the FPC 3.0  isn't actually a release version yet?

-- 
Frank Church

===
http://devblog.brahmancreations.com
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] How do you build FPC?

2015-03-14 Thread vfclists .
On 14 March 2015 at 09:27, leledumbo  wrote:

> > Do you have some FPC/Lazarus compilation scripts or sample fpc.cfg files
> you can share?
>
> The build script:
> build-fpc-cross-all.sh
> <
> http://free-pascal-general.1045716.n5.nabble.com/file/n5721321/build-fpc-cross-all.sh
> >
> My fpc.cfg:
> fpc.cfg
> 
>
> Now read carefully. The final directory layout is now:
> $outdir
> + 
> + $stableversion
> ++ 
> + $svnversion
> ++ 
> + $srcdir
> + lexyacc
> + tmp
>
> * The script assumes you have proper assembler/linker accessible in PATH
> and
> use above fpc.cfg
> * Adjust fpc.cfg above to your environment
> * Please start with latest release, since the script doesn't pass
> OVERRIDEVERSIONCHECK=1 to make. If you insist, however, just add that flag
> to make
> * The script passes GDBMI=1 when building host, so you can still have
> debugger enabled for fpIDE without libgdb.a exists
> * tmp will be temporary destination folder, before the contents are mv-ed
> and rsynced with $outdir
> * In case of failure, there will be build-fpc-cross-all.log in the current
> directory from which you can search for triple asterisks (***) to find what
> went wrong
> * $stableversion doesn't have to be there, I just do it for single fpc.cfg
> requirement
> * $srcdir too, but I never move it out of $outdir, though
>
>
>
>
> --
> View this message in context:
> http://free-pascal-general.1045716.n5.nabble.com/How-do-you-build-FPC-tp5721047p5721321.html
> Sent from the Free Pascal - General mailing list archive at Nabble.com.
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
>


Thanks.

The building process needs as much help as it can get.

-- 
Frank Church

===
http://devblog.brahmancreations.com
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Google Code closing down

2015-03-14 Thread vfclists .
Google Code now has an Export to Github version on the repository pages. It
seemed to have popped out of nowhere and it must have been implemented
while I was browsing or showed up when I dropped my Javascript blockers.


-- 
Frank Church

===
http://devblog.brahmancreations.com
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] Mode Delphi and functions as parameters.

2015-03-18 Thread vfclists .
I have recently compiled projects which were converted from Delphi and it
seems to me that the passing a function as a parameter does not require the
'@' symbol. I suspect syntax errors came because I wasn't compiling from
the command line.

e.g

function AFunction()
begin

end;

CallFunctionWithFunctionParameter (AFunction) instead of
CallFunctionWithFunctionParameter (@AFunction)

Is passing a function as parameter without the '@' symbol accepted in
Delphi?

-- 
Frank Church

===
http://devblog.brahmancreations.com
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] Where is the 'write' function defined and how is it different from 'writeln'?

2015-03-20 Thread vfclists .
Where is the 'write'  function defined and how is it different from
'writeln'?

I can see a lot of fpc_writeXXX and other Write functions, but no
'write' itself

-- 
Frank Church

===
http://devblog.brahmancreations.com
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Where is the 'write' function defined and how is it different from 'writeln'?

2015-03-20 Thread vfclists .
On 20 March 2015 at 18:01, leledumbo  wrote:

> > Where is the 'write'  function defined and how is it different from
> 'writeln'?
> >
> > I can see a lot of fpc_writeXXX and other Write functions, but no
> > 'write' itself
>
> those fpc_writeXXX ARE the actual write. Write(Ln) is NOT a function as
> like
> others whose implementation you can clearly see. It's rather a command for
> the compiler to translate to the correct fpc_writeXXX call. So, if you:
>
> WriteLn(123,' is an integer');
>
> the compiler will translate it to:
>
> fpc_write_text_shortint(123);
> fpc_write_text_shortstring('is an integer');
> fpc_writeln_end;
>
> The same case applies to Read(Ln). AFAIK Pascal's I/O is part of the
> language, not the RTL.
>
>
>
Where does the output go? Is it for stdout, strderr  or the console?

-- 
Frank Church

===
http://devblog.brahmancreations.com
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Where is the 'write' function defined and how is it different from 'writeln'?

2015-03-20 Thread vfclists .
On 20 March 2015 at 19:34, Sven Barth  wrote:

> Am 20.03.2015 19:19 schrieb "vfclists ." :
>
> >
> >
> >
> > On 20 March 2015 at 18:01, leledumbo  wrote:
> >>
> >> > Where is the 'write'  function defined and how is it different from
> >> 'writeln'?
> >> >
> >> > I can see a lot of fpc_writeXXX and other Write functions, but no
> >> > 'write' itself
> >>
> >> those fpc_writeXXX ARE the actual write. Write(Ln) is NOT a function as
> like
> >> others whose implementation you can clearly see. It's rather a command
> for
> >> the compiler to translate to the correct fpc_writeXXX call. So, if you:
> >>
> >> WriteLn(123,' is an integer');
> >>
> >> the compiler will translate it to:
> >>
> >> fpc_write_text_shortint(123);
> >> fpc_write_text_shortstring('is an integer');
> >> fpc_writeln_end;
> >>
> >> The same case applies to Read(Ln). AFAIK Pascal's I/O is part of the
> >> language, not the RTL.
> >>
> >>
> >
> > Where does the output go? Is it for stdout, strderr  or the console?
>
> It depends.
>
> Write('foobar');
>
> Will write to whatever Textfile is contained in Output and
>
> Write(xyz, 'foobar');
>
> Will write to the xyz Textfile. And these Textfiles can basically be
> anything. By default Output simply writes to StdOut (there's also a
> variable for StdErr, but I have forgotten how it's called...), but you
> could also use an implementation that writes to a TStream or one which uses
> sockets. It's quite flexible...
>
> Regards,
> Sven
>
> How do you ensure own implementation overrides the system's
implementation, does the compiler take care of that automatically, or will
you have to name your function differently?

-- 
Frank Church

===
http://devblog.brahmancreations.com
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Where is the 'write' function defined and how is it different from 'writeln'?

2015-03-21 Thread vfclists .
On 20 March 2015 at 20:54, Sven Barth  wrote:

> On 20.03.2015 21:18, vfclists . wrote:
>
>>
>>
>> On 20 March 2015 at 19:34, Sven Barth > <mailto:pascaldra...@googlemail.com>> wrote:
>>
>> Am 20.03.2015 19:19 schrieb "vfclists ." > <mailto:vfcli...@gmail.com>>:
>>
>
snip

> How do you ensure own implementation overrides the system's
>> implementation, does the compiler take care of that automatically, or
>> will you have to name your function differently?
>>
>
> There is no need to ensure that. Here is an example:
>
> === code begin ===
>
> var
>   f, oldout: TextFile;
> begin
>   Writeln('Hello Output as StdOut');
>
>   oldout := Output;
>
>   Assign(Output, 'test.txt');
>   Rewrite(Output);
>
>   Writeln('Hello Output as file');
>
>   Close(f);
>
>   Output := oldout;
>
>   Writeln('Hello Output as StdOut again');
> end.
>
> === code end ===
>
> To see how such a TextFile is implemented you can take a look at unit
> StreamIO which is part of FPC's units.
>
> (Though I wonder why "Assign(f, 'test.txt'); Output := f; Writeln('Hello
> Output as file');" does not work :/ )
>
> Regards,
> Sven
>
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
>

I need to get the output of a program which uses a lot of Write and Writeln
commands into the GUI in realtime, by that I not having to output it to a
text file and reading it afterwards, but by capturing the output of each
Write command into a variable and displaying it in the GUI immediately.

If each Write or Writeln could trigger an event, I could use the event to
capture the output. My other option is to replace the calls to write with
my own function, but Write has different number of call parameters and it
may require as many variants of the function as are used in the program,
assuming that the call syntax is regular, not something like this one -
write(JSValToDouble(cx,pom^)):1:scale).

-- 
Frank Church

===
http://devblog.brahmancreations.com
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Mode Delphi and functions as parameters.

2015-03-21 Thread vfclists .
On 21 March 2015 at 10:04, Constantine Yannakopoulos 
wrote:

> On Fri, Mar 20, 2015 at 11:55 AM, Michael Schnell 
> wrote:
>
>> what to to if a function has no parameter and returns a value that is a
>> pointer to a function of exactly this type ?
>
>
> ​The logical thing for the compiler would be to assume that the
> programmer meant that a reference should be passed​. If the programmer
> wanted to invoke the function ans pass the result reference they should use
> empty parentheses aka "the invocation operator":
>
> CallFunction(SomeFunction); // passes a reference to SomeFunction.
> CallFunction(SomeFunction()); // passes the result of the invocation of
> SomeFunction.
>
> ​So no ambiguity, albeit a very subtle semantic difference that can easily
> produce bugs.​ But IMHO the "@" notation isn't much better either.
>
> PS: I tend to always use the "()" notation when invoking functions with no
> arguments so it will be clear to a future reader that I'm invoking a
> function and not assigning some variable. Makes a difference with poorly
> named functions (not starting with a verb):
>
> ADate := Date;
> ADate := Date();
>
>
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
>

Compilers should not assume. Programmers should be explicit about what they
want.
Assumptions based on ambiguous semantics are an unending source of problems.

-- 
Frank Church

===
http://devblog.brahmancreations.com
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Where is the 'write' function defined and how is it different from 'writeln'?

2015-03-21 Thread vfclists .
On 21 March 2015 at 11:35, Sven Barth  wrote:

> On 21.03.2015 11:13, vfclists . wrote:
>
>>
>>
>> On 20 March 2015 at 20:54, Sven Barth > <mailto:pascaldra...@googlemail.com>> wrote:
>>
>> On 20.03.2015 21:18, vfclists . wrote:
>>
>>
>>
>> On 20 March 2015 at 19:34, Sven Barth
>> mailto:pascaldra...@googlemail.com>
>> <mailto:pascaldragon@__googlemail.com
>>     <mailto:pascaldra...@googlemail.com>>> wrote:
>>
>>  Am 20.03.2015 19:19 schrieb "vfclists ."
>> mailto:vfcli...@gmail.com>
>>  <mailto:vfcli...@gmail.com <mailto:vfcli...@gmail.com>>>:
>>
>>
>>
>> snip
>>
>> How do you ensure own implementation overrides the system's
>> implementation, does the compiler take care of that
>> automatically, or
>> will you have to name your function differently?
>>
>>
>> There is no need to ensure that. Here is an example:
>>
>> === code begin ===
>>
>> var
>>f, oldout: TextFile;
>> begin
>>Writeln('Hello Output as StdOut');
>>
>>oldout := Output;
>>
>>Assign(Output, 'test.txt');
>>Rewrite(Output);
>>
>>Writeln('Hello Output as file');
>>
>>Close(f);
>>
>>Output := oldout;
>>
>>Writeln('Hello Output as StdOut again');
>> end.
>>
>> === code end ===
>>
>> To see how such a TextFile is implemented you can take a look at
>> unit StreamIO which is part of FPC's units.
>>
>> (Though I wonder why "Assign(f, 'test.txt'); Output := f;
>> Writeln('Hello Output as file');" does not work :/ )
>>
>> Regards,
>> Sven
>>
>> _
>> fpc-pascal maillist  - fpc-pascal@lists.freepascal.__org
>> <mailto:fpc-pascal@lists.freepascal.org>
>> http://lists.freepascal.org/__cgi-bin/mailman/listinfo/fpc-__pascal
>> <http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal>
>>
>>
>> I need to get the output of a program which uses a lot of Write and
>> Writeln commands into the GUI in realtime, by that I not having to
>> output it to a text file and reading it afterwards, but by capturing the
>> output of each Write command into a variable and displaying it in the
>> GUI immediately.
>>
>> If each Write or Writeln could trigger an event, I could use the event
>> to capture the output. My other option is to replace the calls to write
>> with my own function, but Write has different number of call parameters
>> and it may require as many variants of the function as are used in the
>> program, assuming that the call syntax is regular, not something like
>> this one - write(JSValToDouble(cx,pom^)):1:scale).
>>
>
> The usage of a text file was merely an example. As I said there already is
> the possibility to use a TStream provided by FPC. But since I'm nice here
> you also have an example for a TMemo, I'm sure you can adjust that for your
> needs:
>
> === code begin ===
>
> resourcestring
>   SErrNilMemo = 'Memo is nil';
>
> type
>   PMemo = ^TMemo;
>
> function GetMemo(var F: TTextRec): TMemo;
> begin
>   Result:=PMemo(@F.Userdata)^;
> end;
>
> function MemoWrite(var F: TTextRec): LongInt;
> var
>   s: String;
> begin
>   Result := 0;
>   with F do
> if BufPos > 0 then
>   try
> SetLength(s, BufPos);
> Move(BufPtr^, s[1], BufPos);
> GetMemo(F).SelText := s;
> BufPos:=0;
>   except
> Result:=101;
>   end;
> end;
>
>
> function MemoClose(var F: TTextRec): LongInt;
> begin
>   Result := 0;
> end;
>
> function MemoOpen(var F: TTextRec): LongInt;
> begin
>   Result := 0;
>   with F do begin
> BufPos:=0;
> Bufend:=0;
> case Mode of
>   fmInput: begin
> Result := 104;
>   end;
>   fmOutput, fmAppend: begin
> InOutFunc := @MemoWrite;
> FlushFunc := @MemoWrite;
> if Mode = fmAppend then
>   Try
> with GetMemo(F) do begin
>   SelStart := Length(Text);
> end;
>   except
> Result := 156;
>   end;
> end else begin
>   GetMemo(F)

Re: [fpc-pascal] Mode Delphi and functions as parameters.

2015-03-23 Thread vfclists .
On 18 March 2015 at 14:49, vfclists .  wrote:

>
> I have recently compiled projects which were converted from Delphi and it
> seems to me that the passing a function as a parameter does not require the
> '@' symbol. I suspect syntax errors came because I wasn't compiling from
> the command line.
>
> e.g
>
> function AFunction()
> begin
>
> end;
>
> CallFunctionWithFunctionParameter (AFunction) instead of
> CallFunctionWithFunctionParameter (@AFunction)
>
> Is passing a function as parameter without the '@' symbol accepted in
> Delphi?
>
> --
> Frank Church
>
> ===
> http://devblog.brahmancreations.com
>

More questions on Mode Delphi.

1. Does Mode Delphi simply allow Delphi syntax to be compiled, or does it
also affect the code generation, like data structures, pointer handling,
parameter handling / calling conventions, stack frames etc?

2. When Mode Delphi is applied to a project, ie the .dpr, does it affect
the whole project, or does each project require its own mode delphi
statement?

3. Can it be switched on and off within the same unit, ie some procedures
and data structures use it, some don't?


-- 
Frank Church

===
http://devblog.brahmancreations.com
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Free Pascal and Lazarus Nightly Builds

2015-03-25 Thread vfclists .
On 13 March 2015 at 18:54, Anthony Walter  wrote:

> Okay, here is what was happening and I apologize for the confusion.
>
> Before the source files are updated each night, my script applies
> "changes.diff" the uploads the sources to an amazon s3 bucket (I pay for
> the bandwidth and avoid leaching from other peoples servers). Next the
> Linux install script downloads this file archive from an my amazon bucket,
> extracts it, and attempts to run "patch changes.diff". The problem being
> that the patch was already been applied the night before and as a
> consequence it fails. The install should still work same as normal, but the
> patch wouldn't have done anything.
>
> The fix, which has already been applied to the Linux setup script, is to
> not run patch on the extracted archive. You can validate this by re-running:
>
> curl -L http://www.getlazarus.org/download/?platform=linux -o setup.sh
>
> And examining the commented out patch command at line:
>
>
> https://github.com/sysrpl/Codebot.Setup/blob/master/linux/install.fpc-3.0.linux.sh#L251
>
> I believe this fixes the problem. Let me know if you have any further
> questions.
>
>
Bypassing the  patch commands enabled it to succeed.


The earlier success was on an x86_64  system and I am trying it now on a
32bit i686 system. The fpc-2.6.4.i386-linux.7z doesn't contain the ppc386
executable. It is actually a symlink to an executable in
/home/delluser/fpctest/fpc-2.6.4/lib/fpc/2.6.4/ppc386. I replaced the whole
package with an existing fpc 2.6.4 on my system before it was able to
proceed. There are still some failures but I am looking into it.

-- 
Frank Church

===
http://devblog.brahmancreations.com
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] Does the basic make INSTALL create ppcross386

2015-03-29 Thread vfclists .
At some stage in the make INSTALL the installation stops with this message.

/usr/bin/install -c -m 755 ppcross386
/home/user/lazarusBuildTesting/testbuild01/fpc/lib/fpc/3.1.1/ppcross386

/usr/bin/install: cannot stat `ppcross386': No such file or directory

The script is adapted from the Codebot setup.sh script created for Linux
and follows the logic below. It works on a 64bit Ubuntu 14.04 system but
fails when I try it on a 32bit Ubuntu 12.04 system. The first make all and
make install succeeds. When it gets to crossinstall phase is when the error
occurs with the ppcross386 message


if [ "$CPU" = "i686" ]
then
  CPU="i386"
fi

echo "starting main FPC compilation"
cd $THIS_BUILD_DIR/fpc
make all
make install INSTALL_PREFIX=$THIS_BUILD_DIR/fpc



if [ "$CPU" = "i686" ]
then
  echo CPU = ${CPU} making crossinstall OS_TARGET=linux CPU_TARGET=x86_64
INSTALL_PREFIX=$THIS_BUILD_DIR/fpc
  make crossinstall OS_TARGET=linux CPU_TARGET=x86_64
INSTALL_PREFIX=$THIS_BUILD_DIR/fpc
else
  echo CPU = ${CPU} making crossinstall OS_TARGET=linux CPU_TARGET=i386
INSTALL_PREFIX=$THIS_BUILD_DIR/fpc
  make crossinstall OS_TARGET=linux CPU_TARGET=i386
INSTALL_PREFIX=$THIS_BUILD_DIR/fpc
fi
make crossinstall OS_TARGET=win32 CPU_TARGET=i386
INSTALL_PREFIX=$THIS_BUILD_DIR/fpc
make crossinstall OS_TARGET=win64 CPU_TARGET=x86_64
INSTALL_PREFIX=$THIS_BUILD_DIR/fpc



-- 
Frank Church

===
http://devblog.brahmancreations.com
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Does the basic make INSTALL create ppcross386

2015-03-29 Thread vfclists .
On 29 March 2015 at 20:13, leledumbo  wrote:

> > Does the basic make INSTALL create ppcross386
> > It works on a 64bit Ubuntu 14.04 system but fails when I try it on a
> 32bit
> > Ubuntu 12.04 system.
>
> It's weird to ask something like this, assuming you've understood the build
> process already. I thought I've ever mentioned it, but here's again: when
> you build the cross compiler, that is when CPU_TARGET is not the same as
> host, the resulting compiler is ppcross. Otherwise, which is your case
> now, it's ppc.
>
> Make install accepts the same parameter as other make targets, so above
> rule
> holds. Certainly, make install does NOT compile anything. Its purpose is to
> install what "make all" compiles and links.
>
> To conclude: No ppcross386 shall be created nor installed in case of
> building for i386 under i386 systems.
>
>
As I mentioned before my script was adapted from the Sysrpl script which
written for a 64bit Ubuntu 14.04 , and may not have been tried on a 32bit
system.

1. When 'make all' followed by 'make install' does the 'make all' command
generate the cross compilers as well, for them to be installed by
crossinstall, or does cross install create the cross compiler from scratch
then install it afterwards?

2. Does the source download come with all the necessary tools for a
successful crossinstall, or are there additional tools required, and does
the make process check for their presence before starting the compilation?

-- 
Frank Church

===
http://devblog.brahmancreations.com
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] Which programs or packages do I need to cross compile for 64bit Linux on 32 bit Linux?

2015-03-30 Thread vfclists .
When I do 'make crossinstall OS_TARGET=linux CPU_TARGET=x86_64
INSTALL_PREFIX=$THIS_BUILD_DIR/fpc' on 32 bit Linux I get this error :
'x86_64-linux-as: Command not found'.

Which packages or group of  programs are missing on my system?

-- 
Frank Church

===
http://devblog.brahmancreations.com
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] Does a single cross compiler for a CPU used for all operating systems?

2015-03-30 Thread vfclists .
Does a single cross compiler for a CPU used for all operating systems?

eg ppcross386 is the cross compiler for i386. Is it the same compiler that
would be used whether the target was a 32bit Linux, OS/X or Win32, with
different linkers and libraries used for the final executable?

-- 
Frank Church

===
http://devblog.brahmancreations.com
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] Do the make commands have a way of listing the options and possible values for them?

2015-03-31 Thread vfclists .
The ./configure command used by a lot of unix programs can list the options
and possible values for them. Do the make commands for Lazarus and FPC have
such an option?

-- 
Frank Church

===
http://devblog.brahmancreations.com
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Do the make commands have a way of listing the options and possible values for them?

2015-03-31 Thread vfclists .
On 31 March 2015 at 14:18, Jonas Maebe  wrote:

>
> vfclists . wrote on Tue, 31 Mar 2015:
>
>  The ./configure command used by a lot of unix programs can list the
>> options
>> and possible values for them.
>>
>
> Note that ./configure can only do this if someone explicitly added
> information about all of those options to the help text of a particular
> configure script.
>
>  Do the make commands for Lazarus and FPC have
>> such an option?
>>
>
> No, nobody has written such a help text for the FPC or Lazarus makefiles.
> There is some information in the documentation, but it hasn't been updated
> in a long time and is both incomplete and largely out of date.
>
>
>
Is it possible to work them out from studying the Makefile itself?

-- 
Frank Church

===
http://devblog.brahmancreations.com
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Do the make commands have a way of listing the options and possible values for them?

2015-03-31 Thread vfclists .
On 31 March 2015 at 15:28, vfclists .  wrote:

>
>
>
> On 31 March 2015 at 14:18, Jonas Maebe  wrote:
>
>>
>> vfclists . wrote on Tue, 31 Mar 2015:
>>
>>  The ./configure command used by a lot of unix programs can list the
>>> options
>>> and possible values for them.
>>>
>>
>> Note that ./configure can only do this if someone explicitly added
>> information about all of those options to the help text of a particular
>> configure script.
>>
>>  Do the make commands for Lazarus and FPC have
>>> such an option?
>>>
>>
>> No, nobody has written such a help text for the FPC or Lazarus makefiles.
>> There is some information in the documentation, but it hasn't been updated
>> in a long time and is both incomplete and largely out of date.
>>
>>
>>
> Is it possible to work them out from studying the Makefile itself?
>
>
A thought just occurred to me. Do some of the fpcup options correspond
exactly to the options used by the make commands?

-- 
Frank Church

===
http://devblog.brahmancreations.com
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Looking for JavaScript component on FPC

2015-04-01 Thread vfclists .
On 31 March 2015 at 22:06, Michael Van Canneyt 
wrote:

>
>
> On Tue, 31 Mar 2015, Andrew Brunner wrote:
>
>  I am trying to integrate javascript for back-end support of cloud apps.
>> I noticed the fcl-js package.  Does anyone have an idea when we can expect
>> to have a component suite much like the PascalScript?
>>
>
> If you want to integrate JS in a pascal app, you can use libsee in fpc
> apps.
> There is alse a native pascal script engine somewhere, as well as
> delphi-javascript on google code.
>
> Michael.
>
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
>


Consider https://github.com/BeRo1985/besen, https://code.google.com/p/fpcjs/
and the SynSM Spidermonkey library from the Synopse.info project. I got
Besen and fpcjs to run, but Besen gave me on error on one script and fpcjs
is rather dated. The SynSM project is probably the best choice, but you
will probably have to help the developers test it fully with Free Pascal

-- 
Frank Church

===
http://devblog.brahmancreations.com
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] Is there some reason why the linker cannot find crti.o, crtn.o etc?

2015-06-29 Thread vfclists .
These messages come up almost always when I compile a project:

Warning: "crti.o" not found, this will probably cause a linking failure
templateSys.lpr(39,1) Warning: "crtn.o" not found, this will probably cause
a linking failure.

On a 32bit system the files are located in /usr/lib/i386-gnu and
/usr/lib/gcc/i686-linux-gnu

find /usr/lib -type f -name crt*

/usr/lib/i386-linux-gnu/crti.o
/usr/lib/i386-linux-gnu/crtn.o
/usr/lib/gcc/i686-linux-gnu/4.X/crtbegin.o
/usr/lib/gcc/i686-linux-gnu/4.X/crtend.o

I don't know if some of them are debug builds which may have other
attributes which make them undetectable by the linker.

Some of the errors may also be related to the gnu tools and not be
FPC/Lazarus related.

This issue bit me when I was trying to cross compile some synopse libraries
(I have forgotten how I fixed it) and I want to know how it can be fixed
permanently in my installations.


-- 
Frank Church

===
http://devblog.brahmancreations.com
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Happy tickets benchmark

2016-03-01 Thread vfclists .
On 14 February 2016 at 10:06, Serguei TARASSOV  wrote:

> Hello,
>
> thank all for assistance!
>
> Sorry, I was not clear, the series should be ran with all tests _on the
> same computer_ regardless its hardware capacity and on the _same OS_.
> That's why I cannot compare with Delphi.
>
> So if you have modern Delphi, FPC and maybe .NET on your Windows computer
> please compare them with about 5-10 runs to get average time.
>
> Thank you for the Inc() hint, I added it to the comments, it gains about
> 10% for me.
> However, in Delphi Inc() is faster until you turn on the checking overflow.
>
> Another strange effect in FPC.
> Only longint shows correct result. With the integer type the optimizer
> seems to replace type with shortint (16-bits) and I see 31902 instead of
> 4816030.
>
>
>
Is there a reason for this, or is it a bug?


-- 
Frank Church

===
http://devblog.brahmancreations.com
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] FPC 3 regression: cannot use TStringList for UTF-8 data any more?

2016-04-24 Thread vfclists .
Isn't some formality in these Unicode discussions called for? Use of
everyday language to express things which can only be properly expressed
and tested through source code is very confusing.

Consider these few sentences by Mattias


It depends.
There are two codepages. The real one and the one you tell the
compiler.
If you tell the compiler that the string literal is 8-bit system
codepage, it will copy it without conversion to the binary.
Otherwise it converts it to UTF-16


How do you know what the "real" codepage is at runtime or compile time, as
opposed to "the one you tell the compiler"?
Is there some macro that can print out which codepages is active at some
stage in the compilation or at runtime?
Can codepages be switched around at various stages in the compilation?

Being an English speaker and writing software for English speakers only,
these are issues I have never had to deal with and hopefully, never will,
which is just wishful thinking, but I think that all these discussions must
be accompanied by code and use cases whch explain them better. I have been
looking in these Unicode discussion threads and I am none the wiser after
all these years.

There must be some test suites in FPC and Lazarus which cover the issues
being raised in these discussions. Wouldn't those be a better starting
point?

Unicode discussions are leading me to appreciate Edsger Dijkstra more and
more. ;)

-- 
Frank Church

===
http://devblog.brahmancreations.com
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] can the compiler zero any out parameter of procedure/function automatically?

2016-07-12 Thread vfclists .
On 11 July 2016 at 18:35, Dennis Poon  wrote:

>
>
> Jonas Maebe wrote:
>
>> Dennis wrote:
>>
>>> I know it is my responsibility to initialize out parameters, but I think
>>> the compiler could help us by initializing all out parameters.
>>>
>> The compiler will fill out-parameters with garbage if you use the -gt
>> command line parameter, which can help you detect such problems more
>> easily.
>>
>> If you forget to assign a value to an out-parameter in a particular
>> case, having it return nil by default could easily be just as wrong as
>> it returning any other random value. For that reason, there is no
>> support for automatically initialising out-parameters.
>>
>> How about issue a compiler warning if one forgets to zero any out
> parameter?
>
> Dennis
>
>
The compiler might warn you about it, but it shouldn't initialize them out
for you.

Computers/compilers derive their power from being idiot savants and it is
wrong to make them anything other than that.

The compiler is supposed to implement what you say in the code, not what
you mean. You are the one who has the responsibility of expressing the
required states in as much detail as is possible.

-- 
Frank Church

===
http://devblog.brahmancreations.com
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal