On 31.03.2018 11:34, Anton Shepelev wrote:
Initialisation is a special and redundant way to assign a value to a
variable. Is this mixing of declaration and action a good idea? Why
not keep them separate?
LOL, I am not the one who wants to introduce initialisation of variables
to Pascal. For y
uses SysUtils; // inttostr
procedure blank(a: array of pointer);
var
i: longint;
begin
for i:=low(a) to high(a) do
// string(a[i]^):='';
string(a[i]^):='silly ~~~ '+IntToStr(i);
end;
var
s, i, l, {l,} y: string;
begin
blank([@s, @i, @l, {@l,} @y]);
writeln(s); writeln(i)
Hi!
I have bean read all of the emails in this topic and now I have to write
:) :
If multiple type declaration (A, B: Integer) are allowed then this new
feature would not make difficulty to learn. Especially if we compare it
to generics, what is already in the language and required/requires to
le
In our previous episode, Ondrej Pokorny said:
> var
> ? A: Integer = 0;
> begin
> end;
>
> Is it a whim as well?
Yes.
___
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
Florian Klaempfl to Ondrej Pokorny:
> > Anyway, my favorite example of non-pascalish
> > syntax within FPC are the +=, -= etc. operators.
> > I really don't understand how they made it into
> > FPC if so many FPC developers are stubbornly
> > against simple and helpful extensions :)
>
> T
Ondrej Pokorny:
> Is there a reason why multiple variable initial-
> ization is forbidden?
>
> program Test;
> var
>A:Integer = 0; // allowed
>B, C: Integer = 0; // not allowed
> begin
> end.
>
> Will a patch be applied that allows it?
That means another complication of the language
Pre pre-initialization, I do it as a compile option:
Modern Pascal v2.0.0 (LINUX,CPU64,X86_64,LITTLEENDIAN,1180323)
Copyright (c) 2000..2017 by Ozz Nixon (Modern Pascal
Solutions, LLC).
■ Produces Cross-Platform 32bit/64bit Encrypted Binaries.
/usr/bin/mp2 [options] sourcefile [mo
It sounds more like you're making a case for all integers to be
initialized to zero by default. I still fail to see any practical uses
other than wanting to not type "integer" twice.
Alex
On 03/24/2018 11:20 AM, Ondrej Pokorny wrote:
On 24.03.2018 15:46, Alexander Grotewohl wrote:
The patch
Am 24.03.2018 um 20:21 schrieb Ondrej Pokorny:
>
> Anyway, my favorite example of non-pascalish syntax within FPC are the
> +=, -= etc. operators. I really don't understand how they made it into
> FPC if so many FPC developers are stubbornly against simple and helpful
> extensions :)
The were add
On 24.03.2018 18:40, Jonas Maebe wrote:
The C-syntax is indeed consequent, and that is what I referred to: the
assignments work the same way as elsewhere in the program, so multiple
initialisations are just as clear as single initialisations there. In
Pascal, you have a special syntax for initi
On Sat, 24 Mar 2018, Ozz Nixon wrote:
As an extension, it makes sense - but I would make it a forced command line
switch and obscure $modeswitch.
Modeswitched and command-line options only go so far.
The problem with this approach is that, if I see someone elses code,
I still have the conf
As an extension, it makes sense - but I would make it a forced command line
switch and obscure $modeswitch. So the code can easily be ported to other
pascal compilers, or versions of FPC down the road. I spend 8 to 12 hours a
day porting Delphi (versions) of code to FPC. And the XE series really ma
On 3/24/2018 6:54 AM, Sven Barth via fpc-devel wrote:
Anthony Walter mailto:sys...@gmail.com>> schrieb am
Sa., 24. März 2018, 14:51:
If you were going to patch I'd also consider allowing:
program Test;
var
B, C: Integer = 0, 1; // sets B = 0, and C = 1
begin
end.
No,
On 24/03/18 17:54, Ondrej Pokorny wrote:
Yes, both examples are much easier to read. You cannot convince me they
are not.
Then there's not much point in discussing.
If you are talking about Ozz Nixon's post and the C-syntax:
I was.
int a, b, c;
int a=0, b=0, c=0;
What different syntax do
On 24.03.2018 16:51, Florian Klaempfl wrote:
Am 24.03.2018 um 11:46 schrieb Ondrej Pokorny:
Is there a reason why multiple variable initialization is forbidden?
program Test;
var
A: Integer = 0; // allowed
B, C: Integer = 0; // not allowed
begin
end.
Will a patch be applied that allow
On 24.03.2018 16:53, Jonas Maebe wrote:
> You'd also have to support it at least for record field initialisers
and default parameters.
Oh yes, I'd also love to write
procedure Test(const A, B, C, D: Integer = 0);
instead of
procedure Test(const A: Integer = 0; const B: Integer = 0; const C:
On Sat, Mar 24, 2018 at 10:53 AM, Jonas Maebe wrote:
> In the end, pretty much every extra language feature makes both the compiler
> and the language more complex. Therefore, I think the question for language
> extensions should never be "is there a good reason not to allow this", but
> "is it re
On 24/03/18 16:20, Ondrej Pokorny wrote:
On 24.03.2018 15:46, Alexander Grotewohl wrote:
The patch is to put them on separate lines. Preferably with meaningful
comments for each. If FPC was changed at the whim of every programmer
we'd end up with a huge mess that no longer resembles pascal.
P
Am 24.03.2018 um 11:46 schrieb Ondrej Pokorny:
> Is there a reason why multiple variable initialization is forbidden?
>
> program Test;
> var
> A: Integer = 0; // allowed
> B, C: Integer = 0; // not allowed
> begin
> end.
>
> Will a patch be applied that allows it?
As the first one is sup
On 24.03.2018 15:46, Alexander Grotewohl wrote:
The patch is to put them on separate lines. Preferably with meaningful
comments for each. If FPC was changed at the whim of every programmer
we'd end up with a huge mess that no longer resembles pascal.
Please tell me who decides about the border
Actually (for clarity) JavaScript does allow multi-initialization, however,
does not require type:
var a=0,b=0,c=0; // all are zero
// and if your presetting to zero due to Pascal not pre-initializing
variables, javascript does, so:
var a,b,c; // all are zero
var a=b=c=1; // C and most JavaScript
On 24.03.2018 15:41, Michael Van Canneyt wrote:
On Sat, 24 Mar 2018, Ondrej Pokorny wrote:
Is there a reason why multiple variable initialization is forbidden?
program Test;
var
A: Integer = 0; // allowed
B, C: Integer = 0; // not allowed
I think this is confusing to read. Are B and C
On Sat, 24 Mar 2018 15:41:15 +0100 (CET)
Michael Van Canneyt wrote:
> On Sat, 24 Mar 2018, Ondrej Pokorny wrote:
>
> > Is there a reason why multiple variable initialization is forbidden?
> >
> > program Test;
> > var
> > A: Integer = 0; // allowed
> > B, C: Integer = 0; // not allowed
On Sat, 24 Mar 2018, Ondrej Pokorny wrote:
Is there a reason why multiple variable initialization is forbidden?
program Test;
var
A: Integer = 0; // allowed
B, C: Integer = 0; // not allowed
I think this is confusing to read.
Are B and C both initialized, or only B ?
Javascript al
Anthony Walter schrieb am Sa., 24. März 2018, 14:51:
> If you were going to patch I'd also consider allowing:
>
> program Test;
> var
> B, C: Integer = 0, 1; // sets B = 0, and C = 1
> begin
> end.
>
No, that is only confusing.
Regards,
Sven
___
fp
If you were going to patch I'd also consider allowing:
program Test;
var
B, C: Integer = 0, 1; // sets B = 0, and C = 1
begin
end.
___
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
Is there a reason why multiple variable initialization is forbidden?
program Test;
var
A: Integer = 0; // allowed
B, C: Integer = 0; // not allowed
begin
end.
Will a patch be applied that allows it?
Ondrej
___
fpc-devel maillist - fpc-devel@
27 matches
Mail list logo