<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>You all make good points. It's why I didn't suggest changing
SetLength because of the well-defined and safe behaviour, and yes,
the System unit is already crowded with intrinsics, and will
become even more crowded once the naming format of the assembly
intrinsics are finalised. The optional parameter (or a new
intrinsic) wouldn't change anything that already exists, and can
be documented.<br>
</p>
<p>I'm willing to settle with SetLength(array, len, ... len, NoInit:
Boolean = False), but of course it depends on the overall support
for it, which isn't looking too promising currently!</p>
<p>Gareth aka. Kit<br>
</p>
<div class="moz-cite-prefix">On 15/09/2020 10:11, Sven Barth wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAFMUeB9nuc+O3ubqhKg_fc7Wg-GfAQ3pBB_95W2o+w-aWm8PKw@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="auto">
<div>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">J. Gareth Moreton via
fpc-devel <<a
href="mailto:fpc-devel@lists.freepascal.org"
moz-do-not-send="true">fpc-devel@lists.freepascal.org</a>>
schrieb am Mo., 14. Sep. 2020, 19:00:<br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">With all
this in mind, would there be support for an intrinsic such
as <br>
"SetLengthNoInit" or "SetLengthNoClear" or some similar
name that has <br>
all the benefits of SetLength (especially the reference
counting) but <br>
doesn't initialise new elements to zero? If I'm learning
one thing, Free <br>
Pascal is finding a niche in some scientific applications,
and speed can <br>
be essential sometimes.<br>
</blockquote>
</div>
</div>
<div dir="auto"><br>
</div>
<div dir="auto">I'm against adding support for this. Dynamic
arrays have guaranteed behavior. If users find that this
behavior is not appropriate for their use case then they
should not use them (or as you already suggested, preallocate
them).</div>
<div dir="auto"><br>
</div>
<div dir="auto">Regards, </div>
<div dir="auto">Sven </div>
<div dir="auto">
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote>
</div>
</div>
</div>
</blockquote>
<div id="DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2"><br />
<table style="border-top: 1px solid #D3D4DE;">
<tr>
<td style="width: 55px; padding-top: 13px;"><a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient" target="_blank"><img src="https://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif" alt="" width="46" height="29" style="width: 46px; height: 29px;" /></a></td>
<td style="width: 470px; padding-top: 12px; color: #41424e; font-size: 13px; font-family: Arial, Helvetica, sans-serif; line-height: 18px;">Virus-free. <a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient" target="_blank" style="color: #4453ea;">www.avast.com</a>
</td>
</tr>
</table><a href="#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2" width="1" height="1"> </a></div></body>
</html>