Re: A mess with GOOPS

2011-09-06 Thread Panicz Maciej Godek
2011/9/6, Panicz Maciej Godek :
> OK, you were right :)
> I made a small change -- instead of namiing my new class
> , I simply named it , so that the smob name
> overlaps with the class name. I don't know if it's a proper
> programming style, but it's simple and it works.
>
> There is, however, another problem that I've observed. I don't know if
> it is caused by my modification, but both array-shape and
> array-dimensions return the following error:
>
> While compiling expression:
> ERROR: In procedure vector-length: Wrong type argument in position 1
>

Oh, and I forgot to mention -- the error appears when I try
to apply these funtions to regular (non-typed) array with rank > 1.
It works for typed arrays, vectors and uvecs.

I'll try to look for the reason of this and let you know if I find
anything interesting.

Regards,
M.



Re: A mess with GOOPS

2011-09-06 Thread Panicz Maciej Godek
> Oh, and I forgot to mention -- the error appears when I try
> to apply these funtions to regular (non-typed) array with rank > 1.
> It works for typed arrays, vectors and uvecs.
>
I removed my modifications and the error still appears.
I've figured that the reason lies somewhere in the special
reader syntax for ordinary arrays: when I write
#2((1 2 3)(4 5 6)), I get the aforementioned error, but
when I use "make-array", everything works nicely. It does
not appear with uniform arrays, so #2f32((1 2 3)(4 5 6))
is fine as well.

I am using origin/stable-2.0 branch from the git repo, last
commited Wed Aug 31 2011



Re: A mess with GOOPS

2011-09-06 Thread Daniel Llorens

>> While compiling expression:
>> ERROR: In procedure vector-length: Wrong type argument in position 1
>> 
> 
> Oh, and I forgot to mention -- the error appears when I try
> to apply these funtions to regular (non-typed) array with rank > 1.
> It works for typed arrays, vectors and uvecs.
> 
> I'll try to look for the reason of this and let you know if I find
> anything interesting.
> 
> Regards,
> M.

Hi,

I posted a patch for precisely this error yesterday on bug-guile. It's a 
trivial bug in module/language/glil/compile-assembly.scm, but I don't know why 
array.test didn't catch it.

diff --git a/module/language/glil/compile-assembly.scm 
b/module/language/glil/compile-assembly.scm
index a081822..c76e412 100644
--- a/module/language/glil/compile-assembly.scm
+++ b/module/language/glil/compile-assembly.scm
@@ -856,7 +856,7 @@
   (vector-fold2 (lambda (x codes addr)
   (receive (subcode addr) (ref-or-dump x i addr)
 (values (cons subcode codes) addr)))
-  x '() addr)
+  contents '() addr)
 (receive (shape addr) (ref-or-dump (array-shape x) i addr)
   (values (fold append
 (let ((len (vector-length contents)))
-- 
1.7.1

Regards,

Daniel.