Re: [q-lang-users] "listof" surprises
Brought to you by:
agraef
From: Marco M. <ma...@ma...> - 2007-05-17 10:23:06
|
On May 16, 2007, at 2:25 AM, Albert Graef wrote: > ma...@ma... wrote: >> I just got burned by this unexpected (for me, of course) behavior of >> list comprehension. Given the program >> >> delta X X = 1; >> delta _ _ = 0 otherwise; >> tabulate N M F = [[F I J : I in [1..N]] : J in [1..M]]; >> eye N = tabulate N N delta; >> >> then (eye 2) evaluates to [[0,0],[0,0]] instead of [[1,0],[0,1]] as I >> would have imagined. > > Ok, this bug is fixed in cvs now (qmfuns.c revision 1.62). > > ==> eye 2 > [[1,0],[0,1]] Thanks. Unfortunately, I found another obstacle (bug?). I really do not understand this: given the program special expr E; f (expr X) = expr X; g (expr 0) = expr 0; g (expr X) = expr X; I get ==> f (expr random) expr random ==> g (expr random) expr 2635609360 M. |