Re: [fpc-pascal] INSTALL_PREFIX, INSTALL_LIBDIR

2018-11-11 Thread Mattias Gaertner via fpc-pascal
On Fri, 19 Oct 2018 16:40:19 +0200 christo wrote: > On 2018/10/18 09:26, Mattias Gaertner via fpc-pascal wrote: > > How to control where 'make install' puts the libraries (e.g. > > libpas2js.so)? > > > > I tried "INSTALL_LIBDIR=~/tmp/lib64", but that moves everything > > *except* libraries to "~/

[fpc-pascal] Uniform initialization?

2018-11-11 Thread Ryan Joseph
Since I’ve got a little more free time I wanted to see if there was a simple solution to issue in Pascal that causes quite a bit of friction for me, i.e. constructor boiler plate. In c++ there is “uniform initialization” for structs which uses the {} syntax. It’s basically identically to record

Re: [fpc-pascal] Uniform initialization?

2018-11-11 Thread tobiasgiesen
Hello, Delphi 10.3 is going to support inline variable declarations like this: begin var i : Integer := 22; WriteLn(i); end; I would assume it can also be used with records. For details, please see http://blog.marcocantu.com/blog/2018-october-inline-variables-delphi.html So maybe that's th

Re: [fpc-pascal] Uniform initialization?

2018-11-11 Thread Ryan Joseph
> On Nov 11, 2018, at 10:03 PM, tobiasgie...@gmail.com wrote: > > Hello, > > Delphi 10.3 is going to support inline variable declarations like this: > begin > var i : Integer := 22; > WriteLn(i); > end; > > I would assume it can also be used with records. For details, please see > http://bl

Re: [fpc-pascal] Uniform initialization?

2018-11-11 Thread Sven Barth via fpc-pascal
Am 11.11.2018 um 16:03 schrieb tobiasgie...@gmail.com: Hello, Delphi 10.3 is going to support inline variable declarations like this: begin var i : Integer := 22; WriteLn(i); end; I would assume it can also be used with records. For details, please see http://blog.marcocantu.com/blog/2

Re: [fpc-pascal] Uniform initialization?

2018-11-11 Thread Sven Barth via fpc-pascal
Am 11.11.2018 um 12:59 schrieb Ryan Joseph: Since I’ve got a little more free time I wanted to see if there was a simple solution to issue in Pascal that causes quite a bit of friction for me, i.e. constructor boiler plate. In c++ there is “uniform initialization” for structs which uses the {}

[fpc-pascal] Running tests with FPC units only

2018-11-11 Thread luciano de souza
Hello hall, I am blind, so I don't use Lazarus. In pure Freepascal, I tried to run an example test: program tester; {$mode objfpc}{$H+} uses fpcunit, testregistry; type TMyTest = class(TTestCase) published procedure TestSomething; end; procedure TMyTest.TestSomething; begin AssertEquals(1, 1);

Re: [fpc-pascal] Uniform initialization?

2018-11-11 Thread leledumbo via fpc-pascal
> But *if* I had to decide I would pick #1, cause then there wouldn't be > the chance to break existing code if a user decides to add a constructor > to their record and some other code relies on there not being a > constructor. Also due to the syntax > TYPENAME(FIELDNAME:VALUE[;FIELDNAME:VALUE

Re: [fpc-pascal] Running tests with FPC units only

2018-11-11 Thread leledumbo via fpc-pascal
> acording example I found in FPC examples directory, Check the one here instead: $(fpcsrcdir)/packages/fcl-fpcunit/src/demo/consolerunner/testrunner.pp It depends only on FPC units. I guess you're looking at examples from Lazarus directory instead of FPC. -- Sent from: http://free-pascal-gene

Re: [fpc-pascal] Running tests with FPC units only

2018-11-11 Thread luciano de souza
What a shame! I shouldn't be so inattentive! Sorry, you are completely right! 2018-11-11 16:57 GMT-02:00, leledumbo via fpc-pascal : >> acording example I found in FPC examples directory, > > Check the one here instead: > $(fpcsrcdir)/packages/fcl-fpcunit/src/demo/consolerunner/testrunner.pp > It

Re: [fpc-pascal] Uniform initialization?

2018-11-11 Thread Sven Barth via fpc-pascal
Am 11.11.2018 um 19:29 schrieb leledumbo via fpc-pascal: But *if* I had to decide I would pick #1, cause then there wouldn't be the chance to break existing code if a user decides to add a constructor to their record and some other code relies on there not being a constructor. Also due to the syn

Re: [fpc-pascal] Default record const values

2018-11-11 Thread Sven Barth via fpc-pascal
Am 10.11.2018 um 09:35 schrieb Ryan Joseph: Should’t this work? This would be a good way to set default record values but it doesn’t seem to be supported. type TMyRecord = record public a: integer; b: string;

Re: [fpc-pascal] Uniform initialization?

2018-11-11 Thread Vojtěch Čihák
Very good.   V. __ Od: "Sven Barth via fpc-pascal" Komu: fpc-pascal@lists.freepascal.org Datum: 11.11.2018 18:22 Předmět: Re: [fpc-pascal] Uniform initialization? Am 11.11.2018 um 16:03 schrieb tobiasgie...@gmail.com: > Hello, > > Del

Re: [fpc-pascal] Default record const values

2018-11-11 Thread Ryan Joseph
> On Nov 12, 2018, at 5:06 AM, Sven Barth via fpc-pascal > wrote: > > The compiler now correctly rejects such declarations with a "Type is not > completely defined error". But this syntax worked if you assigned it within blocks. Why does it need to be removed? Since I discovered it I was pl

Re: [fpc-pascal] Default record const values

2018-11-11 Thread Ryan Joseph
> On Nov 12, 2018, at 8:08 AM, Ryan Joseph wrote: > > But this syntax worked if you assigned it within blocks. Why does it need to > be removed? Since I discovered it I was planning on using it instead of class > functions with default values which require an implementation and are much > lo

Re: [fpc-pascal] Uniform initialization?

2018-11-11 Thread Ryan Joseph
> On Nov 12, 2018, at 12:25 AM, Sven Barth via fpc-pascal > wrote: > > I'm not convinced that this feature is really needed, because one can simply > create a constant and assign that, would transport a clear name as well. This is for runtime though and necessarily for constants. It’s just a

Re: [fpc-pascal] Default record const values

2018-11-11 Thread Sven Barth via fpc-pascal
Am Mo., 12. Nov. 2018, 02:56 hat Ryan Joseph geschrieben: > > > > On Nov 12, 2018, at 8:08 AM, Ryan Joseph > wrote: > > > > But this syntax worked if you assigned it within blocks. Why does it > need to be removed? Since I discovered it I was planning on using it > instead of class functions wit

Re: [fpc-pascal] Uniform initialization?

2018-11-11 Thread Sven Barth via fpc-pascal
Am Mo., 12. Nov. 2018, 03:12 hat Ryan Joseph geschrieben: > > > > On Nov 12, 2018, at 12:25 AM, Sven Barth via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > > > > I'm not convinced that this feature is really needed, because one can > simply create a constant and assign that, would tra