"Bill Page" <[EMAIL PROTECTED]> writes:
| On Tue, May 13, 2008 at 3:36 PM, Ralf Hemmecke wrote:
| > Forwarded with the permission of Stephen Watt.
|
| Thanks, Ralf. I am glad to see Stephen's reply.
|
| >
| > On 05/13/2008 05:30 PM, Stephen Watt wrote:
| >
| > > For does not introduce a new scope for its body for a few reasons:
| > >
| > > 1. In languages like C any compound statement is a new scope so
| > > we have new scopes for loop bodies, branches of if-s etc.
| > >
| > > This does not interact well with implicitly local variables.
|
| Are implicitly local variables really a good idea in a strongly typed
language?
They can simplify `typing' if you throw in dependent types.
|
| > > ...
| > > I admit that none of these are absolutely compelling. So I should
| > > add that we tried it the other way, and this way made coding the
| > > library easier.
| > >
|
| I think that the number of times that an additional declaration would
| be required is rather small (as Gaby's changes to the Axiom library
| code shows) and these cases are often good candidates for code review.
I should also that, in all cases I changed, it is was not clear to
me that the existing code was `good style'
for k in minIndex(r).. while i <= m and j <= n repeat
if f(qelt(a, i), qelt(b, j)) then
qsetelt_!(r, k, qelt(a, i))
i := i+1
else
qsetelt_!(r, k, qelt(b, j))
j := j+1
for k in k.. for i in i..m repeat qsetelt_!(r, k, elt(a, i))
for k in k.. for j in j..n repeat qsetelt_!(r, k, elt(b, j))
| For example, rather than:
|
| > > if foo? then a := 1 else { f(); a := 2 }
|
| I would rather see:
|
| a :=2; if foo? then a := 1 else f()
|
| or if you must then,
|
| a:Integer; if foo? then a:=1 else ( f(); a:=2 )
Indeed.
-- Gaby
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
open-axiom-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/open-axiom-devel