Author: pmichaud
Date: Fri Nov 7 14:07:47 2008
New Revision: 32441
Added:
trunk/languages/perl6/build/gen_objectref_pmc.pl
- copied unchanged from r32439,
/branches/rakon/languages/perl6/build/gen_objectref_pmc.pl
trunk/languages/perl6/src/pmc/objectref_pmc.template
- copied unchanged from r32439,
/branches/rakon/languages/perl6/src/pmc/objectref_pmc.template
trunk/languages/perl6/t/pmc/objectref.t
- copied unchanged from r32439,
/branches/rakon/languages/perl6/t/pmc/objectref.t
Removed:
trunk/languages/perl6/build/gen_mutable_pmc.pl
trunk/languages/perl6/src/pmc/mutable_pmc.template
trunk/languages/perl6/t/pmc/mutable.t
Modified:
trunk/MANIFEST
trunk/MANIFEST.SKIP
trunk/languages/perl6/config/makefiles/root.in
trunk/languages/perl6/src/builtins/assign.pir
trunk/languages/perl6/src/builtins/named-unary.pir
trunk/languages/perl6/src/classes/Array.pir
trunk/languages/perl6/src/classes/Bool.pir
trunk/languages/perl6/src/classes/Capture.pir
trunk/languages/perl6/src/classes/Code.pir
trunk/languages/perl6/src/classes/Complex.pir
trunk/languages/perl6/src/classes/Hash.pir
trunk/languages/perl6/src/classes/IO.pir
trunk/languages/perl6/src/classes/Int.pir
trunk/languages/perl6/src/classes/Junction.pir
trunk/languages/perl6/src/classes/List.pir
trunk/languages/perl6/src/classes/Mapping.pir
trunk/languages/perl6/src/classes/Num.pir
trunk/languages/perl6/src/classes/Object.pir
trunk/languages/perl6/src/classes/Pair.pir
trunk/languages/perl6/src/classes/Range.pir
trunk/languages/perl6/src/classes/Scalar.pir
trunk/languages/perl6/src/classes/Str.pir
trunk/languages/perl6/src/classes/Whatever.pir
trunk/languages/perl6/src/ops/perl6.ops
trunk/languages/perl6/src/parser/actions.pm
trunk/languages/perl6/src/parser/grammar-oper.pg
trunk/languages/perl6/src/pmc/ (props changed)
trunk/languages/perl6/src/pmc/perl6scalar.pmc
trunk/languages/perl6/t/pmc/mutablevar.t
trunk/languages/perl6/t/spectest.data
Log:
[rakudo]: merge rakon branch to trunk
Modified: trunk/MANIFEST
==============================================================================
--- trunk/MANIFEST (original)
+++ trunk/MANIFEST Fri Nov 7 14:07:47 2008
@@ -1,7 +1,7 @@
# ex: set ro:
# $Id$
#
-# generated by tools/dev/mk_manifest_and_skip.pl Thu Nov 6 20:15:18 2008 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Fri Nov 7 21:44:29 2008 UT
#
# See tools/dev/install_files.pl for documentation on the
# format of this file.
@@ -2063,7 +2063,7 @@
languages/perl6/README [perl6]
languages/perl6/ROADMAP [perl6]
languages/perl6/Test.pm [perl6]
-languages/perl6/build/gen_mutable_pmc.pl [perl6]
+languages/perl6/build/gen_objectref_pmc.pl [perl6]
languages/perl6/config/makefiles/root.in [perl6]
languages/perl6/config/makefiles/utils.in [perl6]
languages/perl6/docs/STATUS [perl6]
@@ -2126,8 +2126,8 @@
languages/perl6/src/parser/grammar-oper.pg [perl6]
languages/perl6/src/parser/grammar.pg [perl6]
languages/perl6/src/parser/quote_expression.pir [perl6]
-languages/perl6/src/pmc/mutable_pmc.template [perl6]
languages/perl6/src/pmc/mutablevar.pmc [perl6]
+languages/perl6/src/pmc/objectref_pmc.template [perl6]
languages/perl6/src/pmc/perl6array.pmc [perl6]
languages/perl6/src/pmc/perl6hash.pmc [perl6]
languages/perl6/src/pmc/perl6multisub.pmc [perl6]
@@ -2165,8 +2165,8 @@
languages/perl6/t/01-sanity/08-say.t [perl6]
languages/perl6/t/01-sanity/09-types.t [perl6]
languages/perl6/t/harness [perl6]
-languages/perl6/t/pmc/mutable.t [perl6]
languages/perl6/t/pmc/mutablevar.t [perl6]
+languages/perl6/t/pmc/objectref.t [perl6]
languages/perl6/t/pmc/perl6multisub-arity.t [perl6]
languages/perl6/t/pmc/perl6multisub-basic.t [perl6]
languages/perl6/t/pmc/perl6multisub-tiebreak.t [perl6]
Modified: trunk/MANIFEST.SKIP
==============================================================================
--- trunk/MANIFEST.SKIP (original)
+++ trunk/MANIFEST.SKIP Fri Nov 7 14:07:47 2008
@@ -1,6 +1,6 @@
# ex: set ro:
# $Id$
-# generated by tools\dev\mk_manifest_and_skip.pl Thu Nov 6 15:21:06 2008 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Fri Nov 7 21:44:29 2008 UT
#
# This file should contain a transcript of the svn:ignore properties
# of the directories in the Parrot subversion repository. (Needed for
@@ -1086,8 +1086,8 @@
^languages/perl6/src/pmc/.*\.pdb/
^languages/perl6/src/pmc/.*\.so$
^languages/perl6/src/pmc/.*\.so/
-^languages/perl6/src/pmc/mutable\.pmc$
-^languages/perl6/src/pmc/mutable\.pmc/
+^languages/perl6/src/pmc/objectref\.pmc$
+^languages/perl6/src/pmc/objectref\.pmc/
# generated from svn:ignore of 'languages/perl6/src/utils/'
^languages/perl6/src/utils/Makefile$
^languages/perl6/src/utils/Makefile/
Modified: trunk/languages/perl6/config/makefiles/root.in
==============================================================================
--- trunk/languages/perl6/config/makefiles/root.in (original)
+++ trunk/languages/perl6/config/makefiles/root.in Fri Nov 7 14:07:47 2008
@@ -98,12 +98,12 @@
src/builtins/system.pir \
src/builtins/traits.pir \
-$(PMC_DIR)/mutable.pmc : $(PMC_DIR)/mutable_pmc.template
build/gen_mutable_pmc.pl
- $(PERL) build/gen_mutable_pmc.pl $(PMC_DIR)/mutable_pmc.template \
- $(PMC_DIR)/mutable.pmc
+$(PMC_DIR)/objectref.pmc : $(PMC_DIR)/objectref_pmc.template
build/gen_objectref_pmc.pl
+ $(PERL) build/gen_objectref_pmc.pl $(PMC_DIR)/objectref_pmc.template \
+ $(PMC_DIR)/objectref.pmc
-PMCS = perl6str mutable perl6scalar mutablevar perl6multisub
-PMC_SOURCES = $(PMC_DIR)/perl6str.pmc $(PMC_DIR)/mutable.pmc
$(PMC_DIR)/perl6scalar.pmc \
+PMCS = perl6str objectref perl6scalar mutablevar perl6multisub
+PMC_SOURCES = $(PMC_DIR)/perl6str.pmc $(PMC_DIR)/objectref.pmc
$(PMC_DIR)/perl6scalar.pmc \
$(PMC_DIR)/mutablevar.pmc $(PMC_DIR)/perl6multisub.pmc
PERL6_GROUP = $(PMC_DIR)/perl6_group$(LOAD_EXT)
@@ -253,7 +253,7 @@
$(PMC_DIR)/*.manifest \
$(PMC_DIR)/*.pdb \
$(PMC_DIR)/*.lib \
- $(PMC_DIR)/mutable.pmc \
+ $(PMC_DIR)/objectref.pmc \
$(OPSDIR)/*.h \
$(OPSDIR)/*.c \
$(OPSDIR)/*$(O) \
Modified: trunk/languages/perl6/src/builtins/assign.pir
==============================================================================
--- trunk/languages/perl6/src/builtins/assign.pir (original)
+++ trunk/languages/perl6/src/builtins/assign.pir Fri Nov 7 14:07:47 2008
@@ -17,6 +17,55 @@
## -- these will likely be handled by compiler translation --Pm
+.sub 'infix:='
+ .param pmc cont
+ .param pmc source
+
+ $I0 = isa cont, 'ObjectRef'
+ if $I0 goto object_ref
+ $I0 = isa cont, 'Perl6Array'
+ if $I0 goto array
+ $I0 = isa cont, 'Perl6Hash'
+ if $I0 goto hash
+
+ object_ref:
+ $I0 = can source, 'Scalar'
+ unless $I0 goto have_source
+ source = source.'Scalar'()
+ have_source:
+ .local pmc ro, type
+ getprop ro, 'readonly', cont
+ if null ro goto ro_ok
+ unless ro goto ro_ok
+ 'die'('Cannot assign to readonly variable.')
+ ro_ok:
+ $I0 = defined source
+ unless $I0 goto do_assign
+ getprop type, 'type', cont
+ if null type goto do_assign
+ $I0 = type.'ACCEPTS'(source)
+ if $I0 goto do_assign
+ 'die'("Type mismatch in assignment.")
+ do_assign:
+ eq_addr cont, source, skip_copy
+ copy cont, source
+ skip_copy:
+ .return (cont)
+
+ array:
+ $P0 = get_hll_global 'list'
+ $P0 = $P0(source)
+ $I0 = elements cont
+ splice cont, $P0, 0, $I0
+ .return (cont)
+
+ hash:
+ $P0 = source.'hash'()
+ copy cont, $P0
+ .return (cont)
+.end
+
+
.sub 'infix:~='
.param pmc a
.param pmc b
@@ -78,7 +127,7 @@
.param pmc a
.param pmc b
pow $P0, a, b
- a.'infix:='($P0)
+ 'infix:='(a, $P0)
.return (a)
.end
Modified: trunk/languages/perl6/src/builtins/named-unary.pir
==============================================================================
--- trunk/languages/perl6/src/builtins/named-unary.pir (original)
+++ trunk/languages/perl6/src/builtins/named-unary.pir Fri Nov 7 14:07:47 2008
@@ -54,7 +54,7 @@
.sub 'undefine'
.param pmc x
$P0 = new 'Undef'
- $I0 = isa x, 'Mutable'
+ $I0 = isa x, 'ObjectRef'
unless $I0 goto copy
assign x, $P0
.return ()
Modified: trunk/languages/perl6/src/classes/Array.pir
==============================================================================
--- trunk/languages/perl6/src/classes/Array.pir (original)
+++ trunk/languages/perl6/src/classes/Array.pir Fri Nov 7 14:07:47 2008
@@ -18,17 +18,6 @@
.end
-.namespace ['Perl6Array']
-.sub 'infix:=' :method
- .param pmc source
- $P0 = get_hll_global 'list'
- $P0 = $P0(source)
- $I0 = elements self
- splice self, $P0, 0, $I0
- .return (self)
-.end
-
-
.namespace []
.sub 'circumfix:[ ]'
.param pmc values :slurpy
@@ -36,8 +25,7 @@
$I0 = elements values
splice $P0, values, 0, $I0
$P0.'!flatten'()
- $P1 = new 'Perl6Scalar'
- assign $P1, $P0
+ $P1 = new 'ObjectRef', $P0
.return ($P1)
.end
@@ -46,16 +34,25 @@
=over 4
-=item delete(indices :slurpy)
+=item Scalar()
-Delete the elements specified by C<indices> from the array
-(i.e., replace them with null). We also shorten the array
-to the length of the last non-null (existing) element.
+Returns an ObjectRef referencing itself, unless it already is one in which
+case just returns as is.
=cut
.namespace ['Perl6Array']
+.sub 'Scalar' :method
+ $I0 = isa self, 'ObjectRef'
+ unless $I0 goto not_ref
+ .return (self)
+ not_ref:
+ $P0 = new 'ObjectRef', self
+ .return ($P0)
+.end
+
+
.sub 'delete' :method :multi(Perl6Array)
.param pmc indices :slurpy
.local pmc result
Modified: trunk/languages/perl6/src/classes/Bool.pir
==============================================================================
--- trunk/languages/perl6/src/classes/Bool.pir (original)
+++ trunk/languages/perl6/src/classes/Bool.pir Fri Nov 7 14:07:47 2008
@@ -29,6 +29,17 @@
.end
+=item Scalar
+
+This is a value type, so just returns itself.
+
+=cut
+
+.sub 'Scalar' :method
+ .return (self)
+.end
+
+
.sub 'ACCEPTS' :method
.param pmc topic
.return (self)
Modified: trunk/languages/perl6/src/classes/Capture.pir
==============================================================================
--- trunk/languages/perl6/src/classes/Capture.pir (original)
+++ trunk/languages/perl6/src/classes/Capture.pir Fri Nov 7 14:07:47 2008
@@ -19,6 +19,18 @@
captureproto = p6meta.'new_class'('Perl6Capture', 'parent'=>'Capture_PIR
Any', 'name'=>'Capture')
.end
+
+=item Scalar
+
+This is a value type, so just returns itself.
+
+=cut
+
+.sub 'Scalar' :method
+ .return (self)
+.end
+
+
=head2 Methods
=over 4
Modified: trunk/languages/perl6/src/classes/Code.pir
==============================================================================
--- trunk/languages/perl6/src/classes/Code.pir (original)
+++ trunk/languages/perl6/src/classes/Code.pir Fri Nov 7 14:07:47 2008
@@ -21,6 +21,18 @@
p6meta.'register'('Closure', 'parent'=>codeproto, 'protoobject'=>codeproto)
.end
+
+=item Scalar
+
+This is a value type, so just returns itself.
+
+=cut
+
+.sub 'Scalar' :method
+ .return (self)
+.end
+
+
=over 4
=item ACCEPTS(topic)
Modified: trunk/languages/perl6/src/classes/Complex.pir
==============================================================================
--- trunk/languages/perl6/src/classes/Complex.pir (original)
+++ trunk/languages/perl6/src/classes/Complex.pir Fri Nov 7 14:07:47 2008
@@ -29,6 +29,18 @@
'!EXPORT'('log polar', 'from'=>$P0)
.end
+
+=item Scalar
+
+This is a value type, so just returns itself.
+
+=cut
+
+.sub 'Scalar' :method
+ .return (self)
+.end
+
+
=item perl()
Returns a Perl representation of the Complex.
Modified: trunk/languages/perl6/src/classes/Hash.pir
==============================================================================
--- trunk/languages/perl6/src/classes/Hash.pir (original)
+++ trunk/languages/perl6/src/classes/Hash.pir Fri Nov 7 14:07:47 2008
@@ -35,17 +35,28 @@
.namespace ['Perl6Hash']
+=item Scalar()
+
+Returns an ObjectRef referencing itself, unless it already is one in which
+case just returns as is.
+
+=cut
+
+.sub 'Scalar' :method
+ $I0 = isa self, 'ObjectRef'
+ unless $I0 goto not_ref
+ .return (self)
+ not_ref:
+ $P0 = new 'ObjectRef', self
+ .return ($P0)
+.end
+
+
.sub 'ACCEPTS' :method
.param pmc topic
.return self.'contains'(topic)
.end
-.sub 'infix:=' :method
- .param pmc source
- $P0 = source.'hash'()
- copy self, $P0
- .return (self)
-.end
.sub 'delete' :method
.param pmc keys :slurpy
Modified: trunk/languages/perl6/src/classes/IO.pir
==============================================================================
--- trunk/languages/perl6/src/classes/IO.pir (original)
+++ trunk/languages/perl6/src/classes/IO.pir Fri Nov 7 14:07:47 2008
@@ -180,6 +180,17 @@
.return(1)
.end
+
+=item Scalar
+
+Return the value inside this container in item context.
+
+=cut
+
+.sub 'Scalar' :method
+ .tailcall self.'item'()
+.end
+
.sub 'item' :method :vtable('shift_pmc')
.local pmc pio
$P0 = getattribute self, "$!IO"
Modified: trunk/languages/perl6/src/classes/Int.pir
==============================================================================
--- trunk/languages/perl6/src/classes/Int.pir (original)
+++ trunk/languages/perl6/src/classes/Int.pir Fri Nov 7 14:07:47 2008
@@ -25,6 +25,17 @@
.end
+=item Scalar
+
+This is a value type, so just returns itself.
+
+=cut
+
+.sub 'Scalar' :method
+ .return (self)
+.end
+
+
=item ACCEPTS()
=cut
Modified: trunk/languages/perl6/src/classes/Junction.pir
==============================================================================
--- trunk/languages/perl6/src/classes/Junction.pir (original)
+++ trunk/languages/perl6/src/classes/Junction.pir Fri Nov 7 14:07:47 2008
@@ -25,6 +25,17 @@
.end
+=item Scalar
+
+This is a value type, so just returns itself.
+
+=cut
+
+.sub 'Scalar' :method
+ .return (self)
+.end
+
+
=item ACCEPTS
Implements smart-match for junctions.
Modified: trunk/languages/perl6/src/classes/List.pir
==============================================================================
--- trunk/languages/perl6/src/classes/List.pir (original)
+++ trunk/languages/perl6/src/classes/List.pir Fri Nov 7 14:07:47 2008
@@ -20,6 +20,22 @@
'!EXPORT'('first grep keys kv map pairs reduce values', $P0)
.end
+
+=item Scalar
+
+When we're going to be stored as an item, become an Array and then return
+ourself in a ObjectRef.
+
+=cut
+
+.namespace ['List']
+.sub 'Scalar' :method
+ # promote the list to an Array and return its VALUE
+ $P0 = self.'item'()
+ .tailcall $P0.'Scalar'()
+.end
+
+
=item clone() (vtable method)
Return a clone of this list. (Clones its elements also.)
@@ -108,6 +124,7 @@
=cut
+.namespace ['List']
.sub 'item' :method
$P0 = new 'Perl6Array'
splice $P0, self, 0, 0
@@ -196,7 +213,7 @@
elem = self[i]
$I0 = defined elem
unless $I0 goto flat_next
- $I0 = isa elem, 'Perl6Scalar'
+ $I0 = isa elem, 'ObjectRef'
if $I0 goto flat_next
$I0 = isa elem, 'Range'
unless $I0 goto not_range
Modified: trunk/languages/perl6/src/classes/Mapping.pir
==============================================================================
--- trunk/languages/perl6/src/classes/Mapping.pir (original)
+++ trunk/languages/perl6/src/classes/Mapping.pir Fri Nov 7 14:07:47 2008
@@ -22,6 +22,34 @@
.end
+=item Scalar
+
+When we're going to be stored as an item, become a Hash and then return
+ourself in a ObjectRef.
+
+=cut
+
+.sub 'Scalar' :method
+ # Create a hash with our values.
+ .local pmc hash, it
+ hash = get_hll_global "Hash"
+ hash = hash.'new'()
+ it = iter self
+ it_loop:
+ unless it goto it_loop_end
+ $P0 = shift it
+ $P1 = self[$P0]
+ hash[$P0] = $P1
+ goto it_loop
+ it_loop_end:
+
+ # Wrap it up in an object ref and return it.
+ .local pmc ref
+ ref = new 'ObjectRef', hash
+ .return (ref)
+.end
+
+
.sub 'get_string' :method :vtable
$S0 = ''
.local pmc iter
Modified: trunk/languages/perl6/src/classes/Num.pir
==============================================================================
--- trunk/languages/perl6/src/classes/Num.pir (original)
+++ trunk/languages/perl6/src/classes/Num.pir Fri Nov 7 14:07:47 2008
@@ -22,6 +22,17 @@
.end
+=item Scalar
+
+This is a value type, so just returns itself.
+
+=cut
+
+.sub 'Scalar' :method
+ .return (self)
+.end
+
+
=item ACCEPTS()
=cut
Modified: trunk/languages/perl6/src/classes/Object.pir
==============================================================================
--- trunk/languages/perl6/src/classes/Object.pir (original)
+++ trunk/languages/perl6/src/classes/Object.pir Fri Nov 7 14:07:47 2008
@@ -32,41 +32,8 @@
set_hll_global ['Perl6Object'], '$!P6META', p6meta
.end
-=item infix:=(source) (assignment method)
-
-Assigns C<source> to C<target>. We use the 'item' method to allow Lists
-and Mappings to be converted into Array(ref) and Hash(ref).
-
-=cut
.namespace ['Perl6Object']
-.sub 'infix:=' :method
- .param pmc source
- $I0 = can source, 'item'
- unless $I0 goto have_source
- source = source.'item'()
- have_source:
-
- $I0 = isa self, 'Mutable'
- unless $I0 goto copy
- assign self, source
- goto end
-
- copy:
- .local pmc type
- getprop type, 'type', self
- if null type goto do_assign
- $I0 = type.'ACCEPTS'(source)
- if $I0 goto do_assign
- die "Type mismatch in assignment."
-
- do_assign:
- eq_addr self, source, end
- copy self, source
- end:
- .return (self)
-.end
-
=back
@@ -82,6 +49,29 @@
.namespace ['Perl6Object']
+=item Scalar()
+
+Default implementation gives reference type semantics, and returns an object
+reference, unless the thing already is one.
+
+=cut
+
+.sub 'Scalar' :method
+ $I0 = isa self, 'ObjectRef'
+ unless $I0 goto not_ref
+ .return (self)
+ not_ref:
+ $P0 = new 'ObjectRef', self
+ .return ($P0)
+.end
+
+
+=item hash()
+
+Return a hash representation of ourself.
+
+=cut
+
.sub 'hash' :method
$P0 = self.'list'()
.return $P0.'hash'()
Modified: trunk/languages/perl6/src/classes/Pair.pir
==============================================================================
--- trunk/languages/perl6/src/classes/Pair.pir (original)
+++ trunk/languages/perl6/src/classes/Pair.pir Fri Nov 7 14:07:47 2008
@@ -18,6 +18,18 @@
p6meta.'new_class'('Perl6Pair', 'parent'=>'Any', 'attr'=>'$!key $!value',
'name'=>'Pair')
.end
+
+=item Scalar
+
+This is a value type, so just returns itself.
+
+=cut
+
+.sub 'Scalar' :method
+ .return (self)
+.end
+
+
=item ACCEPTS()
Called from smartmatches '$_ ~~ X'.
Modified: trunk/languages/perl6/src/classes/Range.pir
==============================================================================
--- trunk/languages/perl6/src/classes/Range.pir (original)
+++ trunk/languages/perl6/src/classes/Range.pir Fri Nov 7 14:07:47 2008
@@ -21,6 +21,17 @@
.end
+=item Scalar
+
+This is a value type, so just returns itself.
+
+=cut
+
+.sub 'Scalar' :method
+ .return (self)
+.end
+
+
=item VTABLE_get integer (vtable method)
=item VTABLE_get_number (vtable method)
Modified: trunk/languages/perl6/src/classes/Scalar.pir
==============================================================================
--- trunk/languages/perl6/src/classes/Scalar.pir (original)
+++ trunk/languages/perl6/src/classes/Scalar.pir Fri Nov 7 14:07:47 2008
@@ -15,14 +15,6 @@
# $P0 = subclass 'Mutable', 'Perl6Scalar'
#.end
-.namespace ['Perl6Scalar']
-.sub 'infix:=' :method
- .param pmc source
- $P0 = source.'item'()
- assign self, $P0
- .return (self)
-.end
-
# Local Variables:
# mode: pir
Modified: trunk/languages/perl6/src/classes/Str.pir
==============================================================================
--- trunk/languages/perl6/src/classes/Str.pir (original)
+++ trunk/languages/perl6/src/classes/Str.pir Fri Nov 7 14:07:47 2008
@@ -31,11 +31,23 @@
.end
+=item Scalar
+
+This is a value type, so just returns itself.
+
+=cut
+
+.sub 'Scalar' :method
+ .return (self)
+.end
+
+
.sub 'ACCEPTS' :method
.param string topic
.return 'infix:eq'(topic, self)
.end
+
.sub 'reverse' :method :multi('String')
.local pmc retv
Modified: trunk/languages/perl6/src/classes/Whatever.pir
==============================================================================
--- trunk/languages/perl6/src/classes/Whatever.pir (original)
+++ trunk/languages/perl6/src/classes/Whatever.pir Fri Nov 7 14:07:47 2008
@@ -18,6 +18,18 @@
p6meta.'new_class'('Whatever', 'parent'=>'Perl6Object')
.end
+
+=item Scalar
+
+This is a value type, so just returns itself.
+
+=cut
+
+.sub 'Scalar' :method
+ .return (self)
+.end
+
+
.sub 'ACCEPTS' :method
.param pmc topic
$P0 = get_hll_global ['Bool'], 'True'
Modified: trunk/languages/perl6/src/ops/perl6.ops
==============================================================================
--- trunk/languages/perl6/src/ops/perl6.ops (original)
+++ trunk/languages/perl6/src/ops/perl6.ops Fri Nov 7 14:07:47 2008
@@ -34,9 +34,9 @@
Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
"Attempt to use rebless_subclass where the new class was not a
subclass");
- /* Make sure we're operating on the real value, not a mutable. */
+ /* Make sure we're operating on the real value, not a ObjectRef. */
value = $1;
- while (VTABLE_isa(interp, value, const_string(interp, "Mutable")))
+ while (VTABLE_isa(interp, value, const_string(interp, "ObjectRef")))
value = VTABLE_get_pmc(interp, value);
/* Check what we're trying to bless into is a standard Parrot class. */
Modified: trunk/languages/perl6/src/parser/actions.pm
==============================================================================
--- trunk/languages/perl6/src/parser/actions.pm (original)
+++ trunk/languages/perl6/src/parser/actions.pm Fri Nov 7 14:07:47 2008
@@ -1172,7 +1172,7 @@
PAST::Op.new(
:inline(
' %r = new "Perl6Scalar"',
- ' %r."infix:="(%0)'
+ ' "infix:="(%r, %0)'
),
PAST::Var.new(
:name($parameter.name()),
@@ -2601,13 +2601,14 @@
);
}
elsif ($key eq 'variable') {
- $past := $( $<variable> );
+ $past := PAST::Op.new( $( $<variable> ), :name('prefix:~'),
:pasttype('call') );
}
elsif ($key eq 'circumfix') {
$past := $( $<circumfix> );
if $past.isa(PAST::Block) {
$past.blocktype('immediate');
}
+ $past := PAST::Op.new( $past, :name('prefix:~'), :pasttype('call') );
}
make $past;
}
@@ -2732,7 +2733,7 @@
# and assign result to target
my $past := PAST::Op.new(
- :inline(" %r = %1.'infix:='(%0)"),
+ :inline(" %r = 'infix:='(%1, %0)"),
:node($/),
$call,
$target
Modified: trunk/languages/perl6/src/parser/grammar-oper.pg
==============================================================================
--- trunk/languages/perl6/src/parser/grammar-oper.pg (original)
+++ trunk/languages/perl6/src/parser/grammar-oper.pg Fri Nov 7 14:07:47 2008
@@ -192,7 +192,7 @@
## list assignment
proto infix:<=> is precedence('e=')
# is pasttype('copy')
- is pasttype('callmethod')
+ is pasttype('call')
is assoc('right')
is lvalue(1)
{ ... }
Modified: trunk/languages/perl6/src/pmc/perl6scalar.pmc
==============================================================================
--- trunk/languages/perl6/src/pmc/perl6scalar.pmc (original)
+++ trunk/languages/perl6/src/pmc/perl6scalar.pmc Fri Nov 7 14:07:47 2008
@@ -8,7 +8,7 @@
=head1 DESCRIPTION
-Subclass of Mutable for Perl 6 scalars.
+Subclass of ObjectRef for Perl 6 scalars.
=head2 Methods
@@ -18,7 +18,7 @@
#include "parrot/parrot.h"
-pmclass Perl6Scalar extends Mutable need_ext dynpmc group perl6_group {
+pmclass Perl6Scalar extends ObjectRef need_ext dynpmc group perl6_group {
}
Modified: trunk/languages/perl6/t/pmc/mutablevar.t
==============================================================================
--- trunk/languages/perl6/t/pmc/mutablevar.t (original)
+++ trunk/languages/perl6/t/pmc/mutablevar.t Fri Nov 7 14:07:47 2008
@@ -43,7 +43,7 @@
.sub readonly_true
$P0 = new 'Boolean'
$P0 = 1
- $P1 = new 'Mutable'
+ $P1 = new 'ObjectRef'
setprop $P1, "readonly", $P0
$P2 = new 'MutableVAR', $P1
$I0 = $P2.'readonly'()
@@ -54,7 +54,7 @@
.sub readonly_false
$P0 = new 'Boolean'
$P0 = 0
- $P1 = new 'Mutable'
+ $P1 = new 'ObjectRef'
setprop $P1, "readonly", $P0
$P2 = new 'MutableVAR', $P1
$I0 = $P2.'readonly'()
Modified: trunk/languages/perl6/t/spectest.data
==============================================================================
--- trunk/languages/perl6/t/spectest.data (original)
+++ trunk/languages/perl6/t/spectest.data Fri Nov 7 14:07:47 2008
@@ -192,7 +192,6 @@
S29-num/log.t
S29-num/pi.t
S29-num/rand.t
-S29-num/rounders.t
S29-num/sign.t
S29-num/sqrt.t
S29-scalar/defined.t