Skip to content

Instantly share code, notes, and snippets.

View hoelzro's full-sized avatar

Rob Hoelz hoelzro

View GitHub Profile
cpanm (App::cpanminus) 1.7001 on perl 5.008009 built for x86_64-linux
Work directory is /home/rob/.cpanm/work/1401678945.1495
You have make /usr/bin/make
You have /usr/bin/wget
You have /usr/bin/tar: tar (GNU tar) 1.27.1
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
let g:syntax_threshold = get(g:, 'syntax_threshold', pow(2, 20)) " one megabyte
function! ProtectMeFromBigFiles(filename)
let size = getfsize(a:filename)
if size > g:syntax_threshold
if input(a:filename . ' is pretty big; are you sure you want to highlight it? (y/n)') != 'y'
setlocal syntax=off
endif
endif
use Test;
plan 1;
my role TestRole {
}
my class TestObject does TestRole {
}
use Test;
plan 1;
my class Foo {
multi method test(Str $) {
}
multi method test(Str $) {
}
}
use v6;
use Test;
use App::Subcommander;
plan 1;
my $exception;
try {
my class CustomRoleHOW is Metamodel::ParametricRoleHOW {
}
my $role = Metamodel::ParametricRoleHOW.new_type(:name('MyRole'));
my class CustomRoleHOW is Metamodel::ParametricRoleHOW {
method parameterize($obj, *@pos-args, *%named-args) {
say '[1] called parameterize';
nextsame;
}
method compose($obj) {
say "[1] called compose (obj = {$obj.gist})";
nextsame;
}
use v6;
class Foo {
method bar(Str :$name) {
}
}
sub foo(Str :$name) {
}
my class MyTest {
method test(Str $name, Str :@names) {
}
}
my $pos-args = ['Hello'];
my $named-args = {names => ['hi', 'there']};
MyTest.test(|@($pos-args), |%($named-args));
sub test(Str $name, Str :@names) {}
test('Hello', :names([]));