History variables: Difference between revisions

→‎{{header|Perl 6}}: Fix broken example. Can't have a .STORE method on a scaler sigiled variable right now.
(→‎{{header|Perl 6}}: Mark as broken)
(→‎{{header|Perl 6}}: Fix broken example. Can't have a .STORE method on a scaler sigiled variable right now.)
Line 1,494:
$x is: a</lang>
=={{header|Perl 6}}==
{{broken|Perl 6}}
<lang perl6>class HistoryVar {
has @.history;
Line 1,504 ⟶ 1,503:
}
 
my $\foo := HistoryVar.new;
 
$foo = 1;
$foo = 2;
$foo += 3;
$foo = 42;
 
.say for $foo.history;
say "Current value: ${foo}";</lang>
{{out}}
<pre>[Instant:13876084361523396079.366940685629 (Any)]
[Instant:13876084361523396079.388883686844 1]
[Instant:13876084361523396079.402433687130 2]
[Instant:13876084361523396079.413677687302 5]
Current value: 42</pre>
</pre>
 
=={{header|PicoLisp}}==
10,333

edits