comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: X : Real_Vector := Solve(A => A, X => B); -- Why X as argument name?
Date: Mon, 24 Dec 2012 11:50:11 +0000
Date: 2012-12-24T11:50:11+00:00	[thread overview]
Message-ID: <lylicny8i4.fsf@pushface.org> (raw)
In-Reply-To: ajqia9FfiahU1@mid.individual.net

Niklas Holsti <niklas.holsti@tidorum.invalid> writes:

> Or do you mean to ask if it was a mistake in the definition of
> Ada.Numerics.Real_Arrays.Solve to give the second formal parameter the
> name "X", given that "X" is a common name in client code?

This is certainly a style issue. The second parameter has been 'X' ever
since it was introduced in v4 of ai-00296 in June 2003[1]. I would
probably have chosen 'B', but there may well be mathematical texts that
would take the approach adopted in the ARM.

It's very common for mathematical code to adopt terse naming, in line
with the way mathematicians seem to work, and I find it hard to think of
sensible names for these parameters. But it ought to be possible for
client code to be more explicit (unless, of course, the algorithm to be
implemented was specified by one of the above-referenced mathematicians!)

[1] http://www.ada-auth.org/cgi-bin/cvsweb.cgi/ais/ai-00296.txt?diffbase=1.3&rev=1.4



  reply	other threads:[~2012-12-24 11:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-23 22:28 X : Real_Vector := Solve(A => A, X => B); -- Why X as argument name? Gustaf Thorslund
2012-12-24  8:33 ` Niklas Holsti
2012-12-24 11:50   ` Simon Wright [this message]
2012-12-24 12:58     ` Niklas Holsti
2012-12-24 21:25     ` Gustaf Thorslund
2012-12-24 20:42   ` Gustaf Thorslund
2012-12-24 20:10 ` jpwoodruff
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox