develooper Front page | perl.cvs.parrot | Postings from December 2008

[svn:parrot] r33904 - in branches/assoc/languages/perl6/src: builtins classes

From:
pmichaud
Date:
December 14, 2008 14:23
Subject:
[svn:parrot] r33904 - in branches/assoc/languages/perl6/src: builtins classes
Message ID:
20081214222302.73B15CBA12@x12.develooper.com
Author: pmichaud
Date: Sun Dec 14 14:23:01 2008
New Revision: 33904

Modified:
   branches/assoc/languages/perl6/src/builtins/guts.pir
   branches/assoc/languages/perl6/src/classes/Protoobject.pir

Log:
[rakudo]: sync WHENCE handling from trunk.


Modified: branches/assoc/languages/perl6/src/builtins/guts.pir
==============================================================================
--- branches/assoc/languages/perl6/src/builtins/guts.pir	(original)
+++ branches/assoc/languages/perl6/src/builtins/guts.pir	Sun Dec 14 14:23:01 2008
@@ -568,16 +568,8 @@
     WHENCE = getprop '%!WHENCE', $P0
     if null WHENCE goto no_whence
 
-    # Attach the WHENCE property.
-    .local pmc props
-    props = getattribute proto, '%!properties'
-    unless null props goto have_props
-    props = new 'Hash'
-  have_props:
-    props['WHENCE'] = WHENCE
-    setattribute proto, '%!properties', props
+    setprop proto, '%!WHENCE', WHENCE
   no_whence:
-
     .return (proto)
 .end
 

Modified: branches/assoc/languages/perl6/src/classes/Protoobject.pir
==============================================================================
--- branches/assoc/languages/perl6/src/classes/Protoobject.pir	(original)
+++ branches/assoc/languages/perl6/src/classes/Protoobject.pir	Sun Dec 14 14:23:01 2008
@@ -40,14 +40,11 @@
 
 .namespace ['P6protoobject']
 .sub 'WHENCE' :method
-    .local pmc props, whence
-    props = getattribute self, '%!properties'
-    if null props goto ret_undef
-    whence = props['WHENCE']
-    if null whence goto ret_undef
-    .return (whence)
-  ret_undef:
+    .local pmc whence
+    whence = getprop '%!WHENCE', self
+    unless null whence goto done
     whence = new 'Undef'
+  done:
     .return (whence)
 .end
 
@@ -127,15 +124,7 @@
     .local pmc protoclass, res, props, tmp
     protoclass = class self
     res = new protoclass
-
-    # Attach the WHENCE property.
-    props = getattribute self, '%!properties'
-    unless null props goto have_props
-    props = new 'Hash'
-  have_props:
-    props['WHENCE'] = WHENCE
-    setattribute res, '%!properties', props
-
+    setprop res, '%!WHENCE', WHENCE
     .return (res)
 .end
 



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About