[guru-lang] r525 committed - updated qwarray.g

0 views
Skip to first unread message

guru...@googlecode.com

unread,
Jul 27, 2011, 10:34:15 AM7/27/11
to guru...@googlegroups.com
Revision: 525
Author: kain.nomad
Date: Wed Jul 27 07:32:57 2011
Log: updated qwarray.g
http://code.google.com/p/guru-lang/source/detail?r=525

Modified:
/branches/1.0/lib/qwarray.g

=======================================
--- /branches/1.0/lib/qwarray.g Wed Jul 27 02:55:15 2011
+++ /branches/1.0/lib/qwarray.g Wed Jul 27 07:32:57 2011
@@ -12,13 +12,13 @@
END.

Define primitive qwarray_new
- : Fun(spec A:type)(n:word)(f:Fun(i:word).A).#unique <qwarray A n> :=
+ : Fun(spec A:type)(n:word)(f:Fun(i:word).#unique A).#unique <qwarray A
n> :=
fun(spec A:type)(n:word)(f:Fun(i:word).A). (mkvec A (f word0)
(word_to_nat n)) <<END
void *gqwarray_new(int n, void* (*f)(int), void *a) {
void **h = (void **)guru_malloc(sizeof(void *)*n);
int c;
for (c = 0; c < n; c++)
- h[c] = f(c); // f is a generator function.
+ h[c] = f(0); // f is a generator function.
return h;
}
END.

Reply all
Reply to author
Forward
0 new messages