This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/vm/moar/ops/container.c b/src/vm/moar/ops/container.c | |
index aaa7e63..b925ad6 100644 | |
--- a/src/vm/moar/ops/container.c | |
+++ b/src/vm/moar/ops/container.c | |
@@ -85,13 +85,15 @@ static void rakudo_scalar_store(MVMThreadContext *tc, MVMObject *cont, MVMObject | |
if (!obj) { | |
MVM_exception_throw_adhoc(tc, "Cannot assign a null value to a Perl 6 scalar"); | |
} | |
- else if (STABLE(obj)->WHAT == get_nil()) { | |
- obj = rcd->the_default; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/core/Signature.pm b/src/core/Signature.pm | |
index 129b4e9..0cbe262 100644 | |
--- a/src/core/Signature.pm | |
+++ b/src/core/Signature.pm | |
@@ -138,16 +138,26 @@ my class Signature { # declared in BOOTSTRAP | |
multi sub infix:<eqv>(Signature $a, Signature $b) { $a.perl eq $b.perl } | |
Perl6::Metamodel::Configuration.set_multi_sig_comparator( | |
- -> \a, \b { my $sa = a.signature.^find_private_method('gistperl')( | |
- a.signature, True, :where(-> $ { Nil })); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ time perl6 -e 'my %sw := SetHash.new; my $size = 5000000; for (0..^$size).pick xx 200000 -> $s is copy, $e is copy { ($s,$e) = $e, $s if $e < $s; %sw{+$s} +^= 1; %sw{+$e + 1} +^= 1 if $e < $size - 1; }; my $accum; my $o = 0; for %sw.keys.sort.rotor(2 => -1) -> ($s, $e) { $o +^= 1; $accum += $e - $s if $o; LAST { $accum += $size - $e unless $o }}; $accum.say' | |
2495015 | |
real 1m25.943s | |
user 1m25.832s | |
sys 0m0.076s | |
# Just need two orders of magnitude improvement :-) | |
# Algorithm note: decompose each run of switch throws into throwing all the switches right (inclusive) of the leftmost switch, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use nqp; | |
use QAST:from<NQP>; | |
sub EXPORT(|) { | |
role Control::Never { | |
rule statement_control:sym<never> { | |
<sym><.kok> <xblock> | |
} | |
} | |
role Control::Never::Actions { | |
method statement_control:sym<never>(|c) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
So this is why I get lost in NQP/MoarVM. | |
Objective: figure out how to create a non-resumable subclass of Exception | |
Step 1: Look at Exception, notice "method resumable" checks $!ex at key 'resume' and "method resume" just calls nqp::resume | |
Step 2: Well, I could just override those, but what if the nqp op is called directly somewhere. Better investigate | |
Step 3: OK $!ex is made by calling "nqp::newexception". rgrep nqp tree for it | |
step 4: OK that's mapped to MoarVM "newexeception" op. Resist the urge to say "this goes to VM level too?!?" | |
since exceptions are pretty low level VM things. and I knew that would happen in this case. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
There's a similar problem when using inline doc style: declarative POD cannot be easily nested inside a section, if that is what you want. For example if you are following manpage conventions, you'd want to start a DESCRIPTION block, then drop out of POD and put declaratives around your module, then end the DESCRIPTION block (explicitly, or implicitly by starting, say, a SEE ALSO block. | |
There's actually a way to get part of the way (=alias directives) but it is NYI. Having the ability to =alias before a declarative pod directive and populate the alias with the rendered pod would be nice. e.g. | |
=alias DOCSFORFOO | |
#| does foo things | |
sub foo { | |
} | |
=begin DECRIPTION |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
So, after saying yesterday on IRC that a bottom-up design shoud come first for packish things | |
I somehow came over with a case of hypocrisy and thought a bit about top-downish stuff. | |
Suppose we had a role-like MOP construct (bikeshedding welcome on names): | |
packing foo { | |
template bar { | |
# pack template bottom level constructs | |
# templates can nest, and can come from mixing other packings |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Definitely not a complete list of modules with while/loop in last statement of sub or whatnot. | |
Many are likely harmless but might bear correcting just for sake of sane return value. | |
Mostly I just did directories of authors whos names I remembered seeing a lot. | |
awwaiid/p6-lrep | |
azawawi/perl6-electron | |
colomon/mandelbrot | |
colomon/io-prompter | |
colomon/Test-Junkie | |
hoelzro/p6-priorityqueue |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
regex ℙ_production { | |
( <ℙ_new-lexical-item-name> ) <ℙ_lexical_separator> | |
'::=' <ℙ_lexical_separator> | |
# This next bit should be producing a prestructured lol-ish thing. | |
# Two things NYI|buggy prevent that: | |
# 1) @<alternatives>=(...)* | |
# 2) /(...) :my $f = $0; ($f)/ | |
# So though it may appear the below several lines would be simpler | |
# put as [ $<a>=a | $<b>=b | $<c>=c ]* % <sep> | |
# they are kept in a future-looking form. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A consideration of ‹ and › as quasi injection delimiters, or part thereof. | |
The compose-key (and thus texas mappings) are .< and .> | |
Advantage #0: easy to type | |
Disadvantage #1: texas not really symmetrical | |
Advantage #2: .> is not syntax for anything, I think (?) | |
Disadvantage #3: .< is syntax for $_< | |
Disadvantage #4: visual confusion with < and > |