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

[svn:parrot] r33906 - in branches/assoc/languages/perl6: src/classes t

From:
pmichaud
Date:
December 14, 2008 17:41
Subject:
[svn:parrot] r33906 - in branches/assoc/languages/perl6: src/classes t
Message ID:
20081215014108.59763CBA12@x12.develooper.com
Author: pmichaud
Date: Sun Dec 14 17:41:07 2008
New Revision: 33906

Modified:
   branches/assoc/languages/perl6/src/classes/Associative.pir
   branches/assoc/languages/perl6/src/classes/Protoobject.pir
   branches/assoc/languages/perl6/t/spectest.data

Log:
[rakudo]:  Update postcircumfix, remove unused get_pmc_keyed from Protoobject.


Modified: branches/assoc/languages/perl6/src/classes/Associative.pir
==============================================================================
--- branches/assoc/languages/perl6/src/classes/Associative.pir	(original)
+++ branches/assoc/languages/perl6/src/classes/Associative.pir	Sun Dec 14 17:41:07 2008
@@ -13,9 +13,6 @@
 .sub '' :anon :load :init
     .local pmc positional
     positional = '!keyword_role'('Associative')
-
-    $P0 = get_hll_namespace ['Associative']
-    '!EXPORT'('postcircumfix:{ }', $P0)
 .end
 
 =head2 Operators
@@ -29,7 +26,7 @@
 =cut
 
 .namespace ['Associative']
-.sub 'postcircumfix:{ }' :method :multi(_, _)
+.sub 'postcircumfix:{ }' :method
     .param pmc args            :slurpy
     .param pmc options         :slurpy :named
     .local pmc result
@@ -64,6 +61,19 @@
     .return (result)
 .end
 
+.namespace []
+.sub 'postcircumfix:{ }'
+    .param pmc invocant
+    .param pmc args    :slurpy
+    .param pmc options :slurpy :named
+    $I0 = can invocant, 'postcircumfix:{ }'
+    unless $I0 goto foreign
+    .tailcall invocant.'postcircumfix:{ }'(args :flat, options :flat :named)
+  foreign:
+    $P0 = get_hll_global ['Associative'], 'postcircumfix:{ }'
+    .tailcall $P0(invocant, args :flat, options :flat :named)
+.end
+
 =back
 
 =cut

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 17:41:07 2008
@@ -50,6 +50,29 @@
 
 =back
 
+=head2 Functions
+
+=over
+
+=item postcircumfix:<{ }>
+
+Return a clone of the protoobject with a new WHENCE property set.
+
+=cut
+
+.namespace ['P6protoobject']
+.sub 'postcircumfix:{ }' :method
+    .param pmc WHENCE :slurpy :named
+    .local pmc protoclass, proto
+    protoclass = typeof self
+    proto = new protoclass
+    setprop proto, '%!WHENCE', WHENCE
+    .return (proto)
+.end
+    
+
+=back
+
 =head2  Private methods
 
 =over
@@ -77,59 +100,6 @@
 
 =back
 
-=head2 Vtable functions
-
-=over
-
-=item get_pmc_keyed(key)    (vtable method)
-
-Returns a proto-object with an autovivification closure attached to it.
-
-=cut
-
-.sub get_pmc_keyed :vtable :method
-    .param pmc what
-
-    # We'll build auto-vivification hash of values.
-    .local pmc WHENCE, key, val
-    WHENCE = new 'Hash'
-
-    # What is it?
-    $S0 = what.'WHAT'()
-    if $S0 == 'Pair' goto from_pair
-    if $S0 == 'List' goto from_list
-    'die'("Auto-vivification closure did not contain a Pair")
-
-  from_pair:
-    # Just a pair.
-    key = what.'key'()
-    val = what.'value'()
-    WHENCE[key] = val
-    goto done_whence
-
-  from_list:
-    # List.
-    .local pmc list_iter, cur_pair
-    list_iter = iter what
-  list_iter_loop:
-    unless list_iter goto done_whence
-    cur_pair = shift list_iter
-    key = cur_pair.'key'()
-    val = cur_pair.'value'()
-    WHENCE[key] = val
-    goto list_iter_loop
-  done_whence:
-
-    # Now create a clone of the protoobject.
-    .local pmc protoclass, res, props, tmp
-    protoclass = class self
-    res = new protoclass
-    setprop res, '%!WHENCE', WHENCE
-    .return (res)
-.end
-
-=back
-
 =cut
 
 # Local Variables:

Modified: branches/assoc/languages/perl6/t/spectest.data
==============================================================================
--- branches/assoc/languages/perl6/t/spectest.data	(original)
+++ branches/assoc/languages/perl6/t/spectest.data	Sun Dec 14 17:41:07 2008
@@ -61,7 +61,6 @@
 S03-operators/autoincrement.t
 S03-operators/autovivification.t
 S03-operators/binding-closure.t
-S03-operators/binding-hashes.t
 S03-operators/binding-scalars.t
 S03-operators/bit.t
 S03-operators/chained-declarators.t



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