Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Parameters are being typed as float by default?



On Jul 7,  4:43pm, Bart Schaefer wrote:
} }
} }     let lines=$LINES-2
} } 
} } Why did $lines become float-typed?
} 
} It became float-typed because at math.c:644, MN_UNSET != MN_INTEGER
} 
} However, I don't know the right way to fix this.

After some further study, the following seems to be sufficient, because
`a' is never referenced again on `EQ'.  Peter?

--- zsh-forge/current/Src/math.c	Fri Jul  6 20:16:59 2001
+++ zsh-4.0/Src/math.c	Sat Jul  7 12:21:13 2001
@@ -641,7 +641,8 @@
 		b.type = MN_INTEGER;
 		b.u.l = (zlong)b.u.d;
 	    }
-	} else if (a.type != b.type && what != COMMA) {
+	} else if (a.type != b.type && what != COMMA &&
+		   (a.type != MN_UNSET || what != EQ)) {
 	    /*
 	     * Different types, so coerce to float.
 	     * It may happen during an assigment that the LHS

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   



Messages sorted by: Reverse Date, Date, Thread, Author