# New Ticket Created by "Carl Mäsak" # Please include the string: [perl #111914] # in the subject line of all future correspondence about this issue. # <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=111914 >
<moritz> on a completely different topic, S12 says that 'self' is always assumed to be in item context <moritz> why is that the case? that's the role of the $ sigil, which isn't there on 'self' <masak> the role of the $ sigil is forcing item context. <masak> 'self', by current spec, has that built-in. <moritz> yes, but why? <masak> I don't know. maybe because of some psychological expectation that 'self' is a single thing? <moritz> we've extra eliminiated the $ from (|$foo) variables, because it doesn't fit the "$ means item" philosphy <masak> do you have a use case where 'self' being in item context is cumbersome or unfortunate? <masak> can you *guarantee* that a lot of existing Perl 6 code (in CORE, for example) doesn't rely on the assumption that 'self' is in item context? :) <moritz> r: my @a = 1, 2; .say for @a.push: 3 <p6eval> rakudo 1a468d: OUTPUT«123» <moritz> push simply returns self. Very convenient, and only possible because rakudo doesn't enforce the contnext <masak> moritz: so you're saying that Rakudo isn't to spec in that regard? <moritz> masak: correct * masak submits rakudobug * masak grins <moritz> nom: class A is Array { method identity { self } }; my @a := A.new; @a = 3, 4, 5; .say for @a.identity <p6eval> rakudo 1a468d: OUTPUT«345» <moritz> there you go, without reference to any core thing <benabik> r: my @a = 1,2; .say for $(@a.push: 3) <p6eval> rakudo 1a468d: OUTPUT«1 2 3»