<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
nevermind.<BR>
<BR>
Index: Number.m3<BR>===================================================================<BR>RCS file: /usr/cvs/cm3/m3-sys/m3front/src/builtinOps/Number.m3,v<BR>retrieving revision 1.5<BR>diff -u -r1.5 Number.m3<BR>--- Number.m3 18 Feb 2010 02:33:09 -0000 1.5<BR>+++ Number.m3 7 Mar 2010 14:11:17 -0000<BR>@@ -102,8 +102,8 @@<BR> IF ArrayExpr.GetBounds (e, min, max)<BR> AND TInt.Subtract (max, min, tmp)<BR> AND TInt.Add (tmp, TInt.One, num)<BR>- AND NOT TInt.LT (num, Target.Integer.max)<BR>- AND NOT TInt.LT (Target.Integer.max, num)<BR>+ AND TInt.GE (num, Target.Integer.min)<BR>+ AND TInt.LE (num, Target.Integer.max)<BR> THEN RETURN IntegerExpr.New (Int.T, num);<BR> ELSE RETURN NIL;<BR> END;<BR><BR>
Notice how the full assortment of LE/GE/LT/GT/EQ/NE makes it<BR>easier to read and write the code and get it correct. :)<BR>
<BR>
Of course, the "double max" stands out as incorrect either way.<BR>
<BR>
- Jay<BR><BR><BR><BR><BR><BR> <BR>
<HR id=stopSpelling>
From: jay.krell@cornell.edu<BR>To: hosking@cs.purdue.edu; m3devel@elegosoft.com<BR>Date: Sun, 7 Mar 2010 13:37:28 +0000<BR>Subject: [M3devel] test p078 works in release but not head -- NUMBER(open array constant) not constant<BR><BR>
<STYLE>
.ExternalClass .ecxhmmessage P
{padding:0px;}
.ExternalClass body.ecxhmmessage
{font-size:10pt;font-family:Verdana;}
</STYLE>
C:\dev2\cm3.2\m3-sys\m3tests\src\p0\p078<BR> <BR> <BR>This compiles with release but not head.<BR> <BR> <BR>(* Copyright (C) 1994, Digital Equipment Corporation. *)<BR>(* All rights reserved. *)<BR>(* See the file COPYRIGHT for a full description. *)<BR> <BR>MODULE Main;<BR>FROM Test IMPORT done, checkI, checkB;<BR>CONST<BR> Numbers = ARRAY OF INTEGER {2, 3, 5, 7, 11};<BR> First = Numbers [FIRST (Numbers)];<BR> Last = Numbers [LAST (Numbers)];<BR><BR> Number = NUMBER (Numbers);<BR> Empty = ARRAY OF INTEGER {};<BR> EFirst = FIRST (Empty);<BR> ELast = LAST (Empty);<BR> ENumber = NUMBER (Empty);<BR> <BR>BEGIN<BR>checkI (First, 2);<BR>checkI (Last, 11);<BR>checkI (Number, 5);<BR>checkB (EFirst > ELast, TRUE);<BR>checkI (ENumber, 0);<BR>done ();<BR>END Main.<BR><BR> <BR>new source -> compiling Main.m3<BR>"..\Main.m3", line 14: value is not constant<BR>"..\Main.m3", line 19: value is not constant<BR>2 errors encountered<BR>compilation failed => not building program "pgm.exe"<BR>Fatal Error: package build failed<BR>C:\dev2\cm3.2\m3-sys\m3tests\src\p0\p078><BR> <BR> <BR>It is the lines with "NUMBER".<BR> <BR> <BR> - Jay<BR> </body>
</html>