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
x@patience:~/data/projects/perl6/panda > rakudo/install/bin/perl6 -e 'my $*RESTRICTED; say EVAL "(:a(1):b(2))"' | |
a => 1 | |
x@patience:~/data/projects/perl6/panda > rakudo/install/bin/perl6 -e 'say EVAL "(:a(1):b(2))"' | |
a => 1 b => 2 | |
x@patience:~/data/projects/perl6/panda > rakudo/install/bin/perl6 -e 'my $*RESTRICTED; say do { (:a(1):b(2)) }' | |
a => 1 b => 2 | |
x@patience:~/data/projects/perl6/panda > rakudo/install/bin/perl6 -e 'my $*FOO; say do { (:a(1):b(2)) }' | |
a => 1 b => 2 |
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
declare_array line | |
for_input_lines | |
trim _ | |
split _ line ' ' | |
if line[0] 'declare_array' | |
print 'my $' | |
print_var line[1] | |
say ' = [];' | |
elsif line[0] 'for_input_lines' | |
say 'for $*IN.lines -> $_ is copy {' |
This file has been truncated, but you can view the full file.
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
<!DOCTYPE html> | |
<html lang="en" ng-app="moarProfApp" ng-controller="NavigationController"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>MoarVM Profiler Results</title> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css"> | |
<style> |
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
> examples/sum.p6 1e8 | |
lua... | |
5.00000005e+15 | |
perlint... | |
5000000050000000 | |
perlnum... | |
5.00000005e+15 | |
perlnum64... | |
5.00000005e+15 |
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
#!/usr/bin/env perl6 | |
use NativeCall; | |
class SDL_Window is repr('CStruct') {} | |
class SDL_Renderer is repr('CStruct') {} | |
class SDL_Point is repr('CStruct') { | |
has int32 $.x; | |
has int32 $.y; | |
method set($x, $y) { |
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
#!/usr/bin/env perl6 | |
my $bound = 100; | |
my @answers; | |
Pl: for 3..$bound -> $p { | |
my $pv = 1 / $p; | |
Ql: for $p..$bound -> $q { | |
my $qv = 1 / $q; |
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
#!/usr/bin/env perl6 | |
sub assuming ($r, |curried) { | |
if my @holes := (^curried).grep: { curried[$_] ~~ Whatever } { | |
my $last-hole = @holes[*-1]; | |
my @mixed; | |
@mixed[$_] := curried[$_] for 0 .. $last-hole; | |
my @curried := curried[$last-hole ^.. *]; | |
return sub CURRIED (|direct) { | |
@mixed[@holes[$_]] := direct[$_] for ^@holes; |
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
module ZMQ; | |
use NativeCall; | |
sub zmq_version (OpaquePointer, OpaquePointer, OpaquePointer) is native('zmq') {*}; | |
sub zmq_errno () returns int is native('zmq') {*}; | |
sub zmq_strerror (int) returns Str is native('zmq') {*}; | |
sub zmq_ctx_new () returns OpaquePointer is native('zmq') {*}; | |
sub zmq_ctx_term (OpaquePointer) returns int is native('zmq') {*}; | |
sub zmq_ctx_shutdown (OpaquePointer) returns int is native('zmq') {*}; |
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
#!/usr/bin/env perl6 | |
use lib $?FILE.IO.parent.child('lib'); | |
use C::Parser::Grammar; | |
class CFunction { | |
has $.name; | |
has $.return = Any; | |
has @.args = (); |
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
// parse fails | |
typedef __off64_t __loff_t; | |
typedef __quad_t *__qaddr_t; | |
struct _IO_FILE; | |
typedef struct { __off_t __pos; __mbstate_t __state; } _G_fpos_t; | |
typedef struct { __off64_t __pos; __mbstate_t __state; } _G_fpos64_t; | |
struct _IO_jump_t; | |
struct _IO_FILE; | |
struct _IO_FILE_plus; | |
typedef __ssize_t __io_read_fn (void *__cookie, char *__buf, size_t __nbytes); |
NewerOlder