Skip to content

Instantly share code, notes, and snippets.

@moritz
Created August 10, 2012 18:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save moritz/3316379 to your computer and use it in GitHub Desktop.
Save moritz/3316379 to your computer and use it in GitHub Desktop.
get_integer vtable usage from List.gimme
# Perl 6 code:
my $eager = nqp::p6bool(nqp::istype($n, Whatever) || $n == $Inf);
while $!nextiter.defined && ($eager
?? !$!nextiter.infinite
!! ($count < $n)) {
# generate PIR:
nqp_get_sc_object $P509, "F86B277741A9A72C5FDE64CEE158DEF895454515", 7
type_check $I501, $P13, $P509
perl6_box_int $P515, $I501
set $P514, $P515
if $I501 goto unless1300_end4106
find_lex $P512, "$Inf"
find_lex $P511, "&infix:<==>"
perl6_multi_dispatch_thunk $P510, $P511
$P513 = $P510($P13, $P512)
set $P514, $P513
unless1300_end4106:
set $I502, $P514 # vtable call
perl6_booleanize $P508, $I502
perl6_container_store $P17, $P508
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment