[svn:parrot] r39749 - in trunk: examples/opengl runtime/parrot/library/OpenGL

japhb at svn.parrot.org japhb at svn.parrot.org
Tue Jun 23 21:31:53 UTC 2009


Author: japhb
Date: Tue Jun 23 21:31:52 2009
New Revision: 39749
URL: https://trac.parrot.org/parrot/changeset/39749

Log:
[OpenGL] Math.pir: more compact __dump output; math.pir: improve output spacing

Modified:
   trunk/examples/opengl/math.pir
   trunk/runtime/parrot/library/OpenGL/Math.pir

Modified: trunk/examples/opengl/math.pir
==============================================================================
--- trunk/examples/opengl/math.pir	Tue Jun 23 20:25:09 2009	(r39748)
+++ trunk/examples/opengl/math.pir	Tue Jun 23 21:31:52 2009	(r39749)
@@ -69,7 +69,7 @@
     .local pmc vec3
     vec3 = vec1.'mul'(vec2)
 
-    say "vec1 * vec2 => vec3"
+    say "\nvec1 * vec2 => vec3"
     _dumper(vec1, 'vec1')
     _dumper(vec2, 'vec2')
     _dumper(vec3, 'vec3')
@@ -77,7 +77,7 @@
     .local pmc scaled
     scaled = vec1.'mul_num'(3)
 
-    say "vector * 3 => scaled"
+    say "\nvector * 3 => scaled"
     _dumper(vec1,   'vector')
     _dumper(scaled, 'scaled')
 .end
@@ -88,7 +88,7 @@
     .local pmc normalized
     normalized = vector.'normalize'()
 
-    say "normalize(vector) => normalized"
+    say "\nnormalize(vector) => normalized"
     _dumper(vector,     'vector')
     _dumper(normalized, 'normalized')
 .end

Modified: trunk/runtime/parrot/library/OpenGL/Math.pir
==============================================================================
--- trunk/runtime/parrot/library/OpenGL/Math.pir	Tue Jun 23 20:25:09 2009	(r39748)
+++ trunk/runtime/parrot/library/OpenGL/Math.pir	Tue Jun 23 21:31:52 2009	(r39749)
@@ -505,15 +505,19 @@
     .param pmc    dumper
     .param string label
 
-    ($S1, $S0) = dumper.'newIndent'()
-    say '['
-    print $S1
-    print 'vals = '
     $P0 = getattribute self, 'vals'
-    dumper.'genericArray'('vals', $P0)
-    say ''
+
+    print '[ '
+    $I0 = 0
+  dump_loop:
+    $S0 = $P0[$I0]
     print $S0
-    say ']'
+    inc $I0
+    if $I0 >= 4 goto dump_loop_end
+    print ', '
+    goto dump_loop
+  dump_loop_end:
+    print ' ]'
 .end
 
 =back


More information about the parrot-commits mailing list