conversations listlengths 2 3 | source stringclasses 1 value | stack stringclasses 1 value |
|---|---|---|
[
{
"from": "system",
"value": "Add shared to the mapped supply so only evaluate once\n"
},
{
"from": "human",
"value": "#!perl6\n\n# This does the same as the \"printer.pl6\" but\n# uses the react construct\n\nuse v6;\n\nuse Net::AMQP;\n\nmy $n = Net::AMQP.new;\n\nmy $connection = $n.connect.resu... | perl6 | chosen |
[
{
"from": "system",
"value": "Set $*ARGFILES to $*IN if no arguments\n\nNot sure why it was made an IO::ArgFiles, copying over all relevant\nattributes. If there are no arguments, $*ARGFILES effectively reads\nfrom STDIN, so not sure why special wrapping would be needed in that\ncase. This is make spectes... | perl6 | chosen |
[
{
"from": "human",
"value": "Add sweet new sugar layer :)\n"
},
{
"from": "gpt",
"value": "\nunit module Inline::Ruby::Sweet;\n\nuse Inline::Ruby;\n\nsub postfix:<:rb>($code) is export {\n use MONKEY-SEE-NO-EVAL;\n EVAL $code, :lang<Ruby>;\n}\n\nmulti sub infix:<+>(Inline::Ruby::RbObject $left... | perl6 | chosen |
[
{
"from": "system",
"value": "Fix module on some Rakudos\n\nBug was addressed in https://github.com/rakudo/rakudo/issues/1738\r\nand introduced about a year prior. This fixes breakage in \r\nthat year worth of Rakudo versions."
},
{
"from": "human",
"value": "\nuse Net::FTP::Conn;\nuse Net::FTP:... | perl6 | chosen |
[
{
"from": "system",
"value": "Convert into a unit module\n"
},
{
"from": "human",
"value": "\nuse v6;\n\nuse File::Which::Unix;\nuse File::Which::MacOSX;\nuse File::Which::Win32;\n\n=begin pod\n File::Which finds the full or relative paths to an executable program on the\n system. This is norm... | perl6 | chosen |
[
{
"from": "system",
"value": "Write .cro.yml last, as template docs recommend\n"
},
{
"from": "human",
"value": "use Cro::Tools::CroFile;\nuse META6;\n\nrole Cro::Tools::Template::Common {\n method entrypoint-contents($id, %options, $links --> Str) { ... }\n\n method cro-file-object($id, $... | perl6 | chosen |
[
{
"from": "system",
"value": "Remove debugging print statement and clean up generating the array elements of a combination.\n"
},
{
"from": "human",
"value": "use v6;\n\nunit module List::Combinations;\n\nmulti sub combos(@array, Int $of --> Array) is export {\n\treturn [] if $of < 0;\n\tmy int ... | perl6 | chosen |
[
{
"from": "human",
"value": "Add a seperate frame demo\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env perl6\n\nuse v6;\n\nuse lib 'lib';\nuse GTK::Simple::App;\nuse GTK::Simple::Frame;\nuse GTK::Simple::TextView;\nuse GTK::Simple::VBox;\n\nmy $app = GTK::Simple::App.new(:title(\"Frame De... | perl6 | chosen |
[
{
"from": "human",
"value": "Add a small spec review tool\n\nFor faster opening of commits to review\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env perl6\n\nunit sub MAIN (\n Bool :$no-repo-check,\n Str :$start = '6.c-errata',\n UInt :$n = 10,\n UInt :$skip = 0,\n Str... | perl6 | chosen |
[
{
"from": "human",
"value": "Create FASTQ file of random length DNA sequences\n\nDefaults to ten sequences with a minimum length of 16 and maximum length of 50."
},
{
"from": "gpt",
"value": "#!/bin/env perl6\n\nmy %create_record = (\n fa => &fasta_record,\n fq => &fastq_record,\n);\n\nsub... | perl6 | chosen |
[
{
"from": "system",
"value": "Test that « and » may be used as bracketing characters for :sym\n"
},
{
"from": "human",
"value": "token pod_formatting_code {\n $<code>=<[A..Z]>\n '<' { $*POD_IN_FORMATTINGCODE := 1 }\n $<content>=[ <!before '>'> <pod_string_character> ]+\n '>' { $*POD_... | perl6 | chosen |
[
{
"from": "system",
"value": "Fix the error of using on\n"
},
{
"from": "human",
"value": "role Perl6::Metamodel::MROBasedTypeChecking {\n method isa($obj, $type) {\n my $decont := nqp::decont($type);\n for self.mro($obj) {\n if nqp::decont($_) =:= $decont { return 1... | perl6 | chosen |
[
{
"from": "system",
"value": "Use promises to output in parallel.\n"
},
{
"from": "human",
"value": "use v6;\n\nmy %json = \n\t'file1.txt'=> {\n\t\t'test1'=> 1,\n\t\t'test2'=> 2,\n\t\t'test3'=> 3,\n\t}, 'file2.txt' => {\n\t\t'test1'=> 3,\n\t\t'test2'=> 2,\n\t\t'test3'=> 1,\n\t}, 'file3.txt' => {... | perl6 | chosen |
[
{
"from": "system",
"value": "Add a comment explaining why the BUILD method is necessary.\n"
},
{
"from": "human",
"value": "class Tree::Optimizer;\n\nINIT {\n pir::load_bytecode('Tree/Optimizer/Pass.pbc');\n}\n\nhas @!passes;\n\nmethod new () {\n my $self := pir::new__PP(self.HOW.get_parr... | perl6 | chosen |
[
{
"from": "human",
"value": "Add functional, but slow solution to E618.\n\nBased on\nhttps://github.com/shlomif/project-euler/tree/master/project-euler/618 .\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env perl6\n\n# The Expat License\n#\n# Copyright (c) 2018, Shlomi Fish\n#\n# Permission is her... | perl6 | chosen |
[
{
"from": "system",
"value": "Allow clients to define their own \"name\" / \"version\" logic\n\nThis fixes $*KERNEL.Str strangeness.\n"
},
{
"from": "human",
"value": "role Systemic {\n has Str $.name is built(:bind) = 'unknown';\n has Str $.auth is built(:bind) = 'unknown';\n has Versi... | perl6 | chosen |
[
{
"from": "system",
"value": "Use a different working UA\n"
},
{
"from": "human",
"value": "unit class Pastebin::Shadowcat:ver<2.001001>;\n\nuse HTTP::UserAgent;\nuse URI::Encode;\nuse HTML::Entity;\n\nhas $!pastebin_url = 'http://fpaste.scsys.co.uk/';\n\nmethod paste ($paste, $summary?) returns... | perl6 | chosen |
[
{
"from": "system",
"value": "Convert unitless module declaration into block form\n\nOtherwise, it would have required a `unit` declarator and the braces would\nhave to have been removed.\n\nThe reason for this change is, that as of Rakudo 2015.05, the `unit`\ndeclarator is required before using `module`, `... | perl6 | chosen |
[
{
"from": "system",
"value": "Make $*PERL.version report correct compiler version\n\nFixes rakudo/rakudo#2433.\n\nThe fix is incomplete without fixing EVAL which causes compiler to\nrecord last loaded language revision and preserve it after the EVAL is\ncomplete.\n"
},
{
"from": "human",
"value"... | perl6 | chosen |
[
{
"from": "system",
"value": "Fix the arguments of the both create-tagger and create-lattice methods\n"
},
{
"from": "human",
"value": "use v6;\nunit class MeCab::Model is repr('CPointer');\n\nuse NativeCall;\nuse MeCab::Tagger;\nuse MeCab::Lattice;\n\nmy constant $library = %?RESOURCES<librarie... | perl6 | chosen |
[
{
"from": "system",
"value": "Add a couple more thoughts for the future\n"
},
{
"from": "human",
"value": "module Math::Symbolic::Constants;\n\nour enum Representation is export <Tree Matrix>;\nour enum Expression is export <Relation Operation Symbol Value>;\nour enum Language is export <Math Pe... | perl6 | chosen |
[
{
"from": "human",
"value": ":art: Convert ruby tika script to Perl 6 for fun\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env perl6\n\nuse v6;\n\n# use 'net/http';\n# use 'rest-client'\n# use 'mime-types';\n\n#\n# A simple Tika server wrapper that provides the following methods:\n# - meta\n# - t... | perl6 | chosen |
[
{
"from": "system",
"value": "Support loading language-revision dependent symbols\n\nRemember the default parent by it's name and resolve back when\nrequested. This allows to define, say, `Grammar` as default parent in\n`CORE.c` but get `Grammar` from `CORE.e` if the client code requested\nthis revision.\n"... | perl6 | chosen |
[
{
"from": "human",
"value": "Add initial PLPlot Perl6 binding script\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env perl6\n\n#\n# To run:\n# sudo apt install libplplot-dev\n#\n# LGPL\n#\n\nuse v6;\n\nuse NativeCall;\n\nsub library {\n return \"libplplotd.so\";\n}\n\nsub plinit \n is symbo... | perl6 | chosen |
[
{
"from": "system",
"value": "Fix delta for pas new years\n"
},
{
"from": "human",
"value": "use IRC::Client;\nunit class IRC::Client::Plugin::HNY is IRC::Client::Plugin;\n\nmy \\term:<☃> = DateTime.new(year => .year + (1 if .month >= 6)).utc.Instant\n given DateTime.now.utc;\n\nuse WWW::Goog... | perl6 | chosen |
[
{
"from": "human",
"value": "Add an example file to test .mo files in a directory.\n"
},
{
"from": "gpt",
"value": "#!perl6\n\nuse v6;\nuse Test;\nuse lib '../lib';\nuse Grammar::Modelica;\n# use Grammar::Tracer;\n\n\nplan 305;\n\nsub light($file) {\n my $fh = open $file, :r;\n my $contents = ... | perl6 | chosen |
[
{
"from": "system",
"value": "Move disk output to its own thread\n"
},
{
"from": "human",
"value": "class Pray::Output::PPM;\n\nuse Pray::Scene::Color;\n\nhas Str $.filename;\nhas Int $.width;\nhas Int $.height;\nhas IO::Handle $.filehandle;\n\nmethod new ($filename, $width, $height) {\n my $... | perl6 | chosen |
[
{
"from": "system",
"value": "Exit early when lib is not found\n"
},
{
"from": "human",
"value": "#!/usr/bin/env perl6\n\n=begin pod\n\n=head1 NAME\n\ngenerate-pod.pl6 - A script to generate Perl 6 POD for a lib folder\n\n=head1 SYNPOSIS\n\n=begin code\n$ ./generate-pod.pl6\n=end code\n\n\n=end ... | perl6 | chosen |
[
{
"from": "system",
"value": "Add unit declarator to role declarations\n\nAs of Rakudo 2015.05, the `unit` declarator is required before using\n`module`, `class`, `role` or `grammar` declarations (unless it uses a\nblock). Code still using the old blockless semicolon form will throw a\nwarning. This commit... | perl6 | chosen |
[
{
"from": "system",
"value": "Use precompiled modules when available\n"
},
{
"from": "human",
"value": "#!/usr/bin/env perl6\n\nuse v6;\n\nuse lib $?FILE.IO.parent.parent.child('lib');\n\nuse Pray;\n\nsub MAIN (\n\tStr $scene = 'scene.json',\n\tStr $image? is copy,\n\tInt :$width,\n\tInt :$heigh... | perl6 | chosen |
[
{
"from": "system",
"value": "Save 2 Scalar allocations at each startup\n\nAnd make the version cache a little more optimised\n"
},
{
"from": "human",
"value": "class Perl does Systemic {\n has Compiler $.compiler;\n\n submethod BUILD(\n :$!name = 'Perl 6',\n :$!auth = ... | perl6 | chosen |
[
{
"from": "system",
"value": "Fix previous, and while here, split TEST_FILES on any whitespace\n\nthanks @coke!\n"
},
{
"from": "human",
"value": "unit class Test-Files;\n\nmethod files() {\n my @files;\n\n if @*ARGS {\n @files = @*ARGS;\n } else {\n if %*ENV<TEST_FILES> {... | perl6 | chosen |
[
{
"from": "system",
"value": "Add .panic back to lang\n\nAlthough I got rid of it before it's actually used a lot in p5regex\nand is a handy thing to have anyway.\n"
},
{
"from": "human",
"value": "need Spit::Exceptions;\n\ngrammar Spit::Lang {\n\n my %tweak-cache;\n\n method LANG($lang, $... | perl6 | chosen |
[
{
"from": "system",
"value": "Refactor UNIX which into its own implementation\n"
},
{
"from": "human",
"value": "\nuse v6;\n\nunit role File::Which::Unix;\n\nmethod which {\n ...\n}\n\n=begin pod\n\n=head1 NAME\n\nFile::Which::Unix - which implementation under Linux/Unix\n\n=end pod"
},
{
... | perl6 | chosen |
[
{
"from": "system",
"value": "Add unit declarator to module declarations\n\nAs of Rakudo 2015.05, the `unit` declarator is required before using\n`module`, `class` or `grammar` declarations (unless it uses a block). Code\nstill using the old blockless semicolon form will throw a warning. This\ncommit stops... | perl6 | chosen |
[
{
"from": "system",
"value": "Change query target to example.org\n\nIt serves HTTP without TLS and we got a correct response instead of 302."
},
{
"from": "human",
"value": "#!/usr/bin/env perl6\n\nuse v6;\n\n=begin pod\n\n=TITLE Writing a TCP Client\n\n=AUTHOR stmuk\n\nYou want to connect to a ... | perl6 | chosen |
[
{
"from": "human",
"value": "Add first part of day 3\n"
},
{
"from": "gpt",
"value": "#!perl6\nuse Test;\n\n# You come across an experimental new kind of memory stored on an infinite\n# two-dimensional grid.\n#\n# Each square on the grid is allocated in a spiral pattern starting at a\n# location... | perl6 | chosen |
[
{
"from": "system",
"value": "Revert \"Make .ver and .auth MetaModel methods available on Packages\"\n\nThis reverts commit 26817b3e355c663bd12a9e0c3e1b0728befb3934.\n\nAs per discussion on https://github.com/rakudo/rakudo/pull/818#issuecomment-231468771\npackages are stubs and must not have .ver/auth ident... | perl6 | chosen |
[
{
"from": "system",
"value": "Make alternative stand out a bit more.\n"
},
{
"from": "human",
"value": "proto sub undefine(Mu, *%) is raw {\n Rakudo::Deprecations.DEPRECATED:\n 'another way: assign a Nil; for Arrays/Hashes, assign Empty or ()',\n Nil, '6.e', :lang-vers, :what<undefi... | perl6 | chosen |
[
{
"from": "system",
"value": "Make sure we also make / create FatRats\n"
},
{
"from": "human",
"value": "# Provide full precision for all rational calculations by making all\n# Rat FatRats.\n\nmy constant Rat is export = FatRat;\n"
},
{
"from": "gpt",
"value": "# Provide full precisi... | perl6 | chosen |
[
{
"from": "system",
"value": "Make it possible to actually pass --optimize=0 to turn off the optimizer.\n"
},
{
"from": "human",
"value": "use Perl6::Grammar;\nuse Perl6::Actions;\nuse Perl6::Compiler;\n\nsub MAIN(@ARGS) {\n # Initialize dynops.\n pir::rakudo_dynop_setup__v();\n\n # Cre... | perl6 | chosen |
[
{
"from": "system",
"value": "Add --help attrib to exec\n"
},
{
"from": "human",
"value": "use v6;\nuse App::FizzBuzz;\n\nsub MAIN(Int :$end = 100, Int :$fizz = 3, Int :$buzz = 5)\n{\n my $app = App::FizzBuzz.new(\n end => $end,\n fizz => $fizz,\n buzz => $buzz\n );\n... | perl6 | chosen |
[
{
"from": "human",
"value": "Add a util for generating a stub doc for a new type\n"
},
{
"from": "gpt",
"value": "use v6;\n\nsub MAIN($typename, :$kind='class') {\n my @path-chunks = $typename.split('::');\n my $filename = @path-chunks.pop ~ '.pod';\n my $path = 'lib/Type';\n for @p... | perl6 | chosen |
[
{
"from": "system",
"value": "Replace temporary variable in sub call\n"
},
{
"from": "human",
"value": "#!/usr/bin/env perl6\n#\nuse v6;\nuse lib 'lib';\nuse Perl6::TypeGraph;\n\n=begin pod\n\n=head1 NAME\n\n missing-methods\n\n=head1 SYNOPSIS\n\n $ perl6 util/missing-methods.p6\n\n=head1 ... | perl6 | chosen |
[
{
"from": "system",
"value": "Remove another debugging output statement.\n\n\ngit-svn-id: 9e979cd1d8a5afe7d5b96591165ee66604ad4fe8@47843 d31e2699-5ff4-0310-a27c-f18f2fbe73fe\n"
},
{
"from": "human",
"value": "#!./parrot-nqp\n# Copyright (C) 2010, Parrot Foundation.\n# $Id$\n\nINIT {\n pir::lo... | perl6 | chosen |
[
{
"from": "system",
"value": "Fix interaction of ^methods with inheritance.\n"
},
{
"from": "human",
"value": "role Perl6::Metamodel::MetaMethodContainer {\n # Table of the methods.\n has %!meta_methods;\n\n # Add a meta-method.\n method add_meta_method($obj, $name, $code_obj) {\n ... | perl6 | chosen |
[
{
"from": "human",
"value": "Add a second example for image effects\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env perl6\n\nuse v6;\n\nuse lib 'lib';\nuse MagickWand;\n\nmy @images;\n\n# A new magic wand\nmy $original = MagickWand.new;\n\n# Read an image\n$original.read(\"examples/images/aero1.... | perl6 | chosen |
[
{
"from": "human",
"value": "[examples] Add user info fetching script\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env perl6\n\nuse lib <../lib lib>;\nuse WebService::Lastfm;\n\nsub MAIN(Str $api-key, Str $user='avuserow') {\n\tmy $lastfm = WebService::Lastfm.new(:$api-key);\n\tsay $lastfm.reques... | perl6 | chosen |
[
{
"from": "system",
"value": "Simplify helper script through the power of set operators\n"
},
{
"from": "human",
"value": "\n# Helper sub: for a line, return commit ID or Nil\nsub commit($line) { $line.starts-with('commit ') ?? $line.substr(7,8) !! Nil }\n\n# The commit that did the last VERSION... | perl6 | chosen |
[
{
"from": "system",
"value": "Remove debugging info from module.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env perl6\n\nuse Net::HTTP::POST;\nuse JSON::Fast;\n\n#Make the class.\nclass WebService::Slack::Webhook {\n #Make some vars.\n has Str $.url is required where {$_ ~~ regex {'http... | perl6 | chosen |
[
{
"from": "system",
"value": "Fix \"method ^foo(...) { ... }\" serialization issue\n"
},
{
"from": "human",
"value": "role Perl6::Metamodel::MetaMethodContainer {\n # Table of the methods.\n has %!meta_methods;\n\n # Add a meta-method.\n method add_meta_method($obj, $name, $code_obj)... | perl6 | chosen |
[
{
"from": "system",
"value": "Fix another MOP-related StrLexRef serialization bug\n\nPerl6::Metamodel::Naming's name and shortname attributes are expected to\nbe literal strings, but if, say, a Raku module uses any given new_type\nmethod on a Rakudo HOW with :name bound to a Scalar, this doesn't end\nup bei... | perl6 | chosen |
[
{
"from": "human",
"value": "Add a first cut at a program to find undocumented methods\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env perl6\n#\nuse v6;\nuse lib 'lib';\nuse Perl6::TypeGraph;\n\n=begin pod\n\n=head1 NAME\n\n missing-methods\n\n=head1 SYNOPSIS\n\n $ perl6 util/missing-metho... | perl6 | chosen |
[
{
"from": "system",
"value": "Add a way to mark types on QAST nodes if known.\n"
},
{
"from": "human",
"value": "class QAST::Node is NQPCapture {\n has str $!name;\n has $!node;\n\n method new(*@children, *%options) {\n my $new := self.CREATE();\n $new.BUILD();\n nq... | perl6 | chosen |
[
{
"from": "human",
"value": "Add sine/cosine waves animation example :)\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env perl6\n\nuse v6;\nuse lib 'lib';\nuse Terminal::Caca;\n\n# Initialize library\ngiven my $o = Terminal::Caca.new {\n\n # Set the window title\n .title(\"Sine/Cosine Wave A... | perl6 | chosen |
[
{
"from": "system",
"value": "Initialize lookup at setting compile time, instead of each startup\n"
},
{
"from": "human",
"value": "my class VM { ... }\n\nmy class IO::Spec {\n\n my %module = # only list the non-Unix ones in lowercase\n 'mswin32' => 'Win32',\n 'os... | perl6 | chosen |
[
{
"from": "system",
"value": "Fix one of the issues with attribute mix-ins; gets back another test.\n"
},
{
"from": "human",
"value": "=begin\n\n=head1 TITLE\n\nPerl6::Metamodel::RoleToInstanceApplier\n\n=head1 DESCRIPTION\n\nApplies roles to an instance.\n\n=head1 METHODS\n\n=over 4\n\n=item ap... | perl6 | chosen |
[
{
"from": "system",
"value": "Add a bit more documentation and curl_easy_version\n"
},
{
"from": "human",
"value": "\nuse v6;\n\nmodule Net::Curl;\n\nuse NativeCall;\n\nconstant LIB = 'libcurl.so';\n\nconstant CURLOPT_URL is export = 10002;\nconstant CURLE_OK is export = 0;\n\n\nsub curl_easy... | perl6 | chosen |
[
{
"from": "system",
"value": "Support part two of day one\n"
},
{
"from": "human",
"value": "#!perl6\nuse Test;\n\nsub uncaptcha(Str $s) returns Int {\n my @c = $s.split('', :skip-empty);\n my @i = @c.rotate(-1);\n return [+] map { $_[1] }, grep { @i[$^a] == $^b }, @c.kv;\n}\n\nis uncap... | perl6 | chosen |
[
{
"from": "system",
"value": "Make the regex more readable.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env perl6\n\nuse Net::HTTP::POST;\nuse JSON::Fast;\n\n#Make the class.\nclass WebService::Slack::Webhook {\n #Make some vars.\n has Str $.url is required where {$_ ~~ /https\\:\\/\\/ho... | perl6 | chosen |
[
{
"from": "system",
"value": "Remove superfluous use of file handle in svg-for-file\n"
},
{
"from": "human",
"value": "module Pod::Htmlify;\n\nuse URI::Escape;\n\nsub url-munge($_) is export {\n return $_ if m{^ <[a..z]>+ '://'};\n return \"/type/{uri_escape $_}\" if m/^<[A..Z]>/;\n ret... | perl6 | chosen |
[
{
"from": "system",
"value": "Add unit declarator to role declarations\n\nAs of Rakudo 2015.05, the `unit` declarator is required before using\n`module`, `class`, `role` or `grammar` declarations (unless it uses a\nblock). Code still using the old blockless semicolon form will throw a\nwarning. This commit... | perl6 | chosen |
[
{
"from": "system",
"value": "Revert \"Fix the error of using on\"\n\nThis reverts commit eb8c5f5cc2a674ed56fe248be24a48d8159ebb95.\n\nThis doesn't pass even make test\n"
},
{
"from": "human",
"value": "role Perl6::Metamodel::MROBasedTypeChecking {\n multi method isa($obj, $type) {\n ... | perl6 | chosen |
[
{
"from": "system",
"value": "Add POD to the module\n"
},
{
"from": "human",
"value": "# ft: perl6\n\nuse v6;\n\nrole EventEmitter::Node:ver<v0.0.1>:auth<github:jonathanstowe> {\n #| Per \"event\" hash of supplies\n has Supply %!supplies;\n\n method on( Str $event, &callback --> Tap ) {\n ... | perl6 | chosen |
[
{
"from": "human",
"value": "Add a little script to generate the doc page\n"
},
{
"from": "gpt",
"value": "use v6;\nuse Pygments;\n\nmy %*POD2HTML-CALLBACKS;\n%*POD2HTML-CALLBACKS<code> = sub (:$node, :&default) {\n Pygments.highlight($node.contents.join('\\n'), \"perl6\",\n ... | perl6 | chosen |
[
{
"from": "system",
"value": "Use the word \"label\" instead of the word \"top\" corresponding with the official format description\n"
},
{
"from": "human",
"value": "use v6;\nunit class Algorithm::LibSVM::Actions;\n\nmethod TOP($/) { make $<bodylist>.made }\nmethod bodylist($/) { make $<body>>>... | perl6 | chosen |
[
{
"from": "system",
"value": "Use concatenation instead of Buf.new\n"
},
{
"from": "human",
"value": "class Net::DNS::Message::Resource;\n\nhas Str @.name is rw;\nhas Int $.type is rw = 0;\nhas Int $.class is rw = 0;\nhas Int $.ttl is rw = 0;\nhas Buf $.rdata = Buf.new;\n\nmulti method new($data... | perl6 | chosen |
[
{
"from": "system",
"value": "[PROBES] Use modern hash iteration semantics properly in %hash.kv\n"
},
{
"from": "human",
"value": "###\n### hash-kv.nqp: CAN HAZ 'for %hash.kv -> $k, $v { ... }' ?\n###\n\n# TO USE:\n# $ nqp hash-kv.nqp\n\n# Hash.kv by pmichaud++ in http://nopaste.snit.ch/18559\... | perl6 | chosen |
[
{
"from": "human",
"value": "[PROBES] Add probe for numeric constant formats\n"
},
{
"from": "gpt",
"value": "say(Q:PIR{ %r = box 0o777 });\nsay(Q:PIR{ %r = box 0x1FF });\nsay(Q:PIR{ %r = box 511 });\n"
}
] | perl6 | chosen |
[
{
"from": "system",
"value": "Add vim modeline to template for new types\n"
},
{
"from": "human",
"value": "#!/usr/bin/env perl6\n\nuse v6;\n\nsub MAIN($typename, :$kind='class') {\n my @path-chunks = $typename.split('::');\n my $filename = @path-chunks.pop ~ '.pod';\n my $path = 'lib/... | perl6 | chosen |
[
{
"from": "human",
"value": "Add printer example with react\n"
},
{
"from": "gpt",
"value": "#!perl6\n\n# This does the same as the \"printer.pl6\" but\n# uses the react construct\n\nuse v6;\n\nuse Net::AMQP;\n\nmy $n = Net::AMQP.new;\n\nmy $connection = $n.connect.result;\n\nreact {\n whenev... | perl6 | chosen |
[
{
"from": "system",
"value": "Return the right thing when we don't find a method.\n\nThis way we get a proper X::Method::NotFound, instead of a low-level \"Can not\ninvoke this object.\"\n"
},
{
"from": "human",
"value": "class Perl6::Metamodel::JavaHOW\n does Perl6::Metamodel::Naming\n do... | perl6 | chosen |
[
{
"from": "system",
"value": "Add flag to descriptor pool"
},
{
"from": "human",
"value": "unit class Vulkan::Descriptor::Pool is repr('CPointer');\n# FIXME: figure out what \"non-dispatchable\" means and\n# why 32-bit platforms apparently need this to be\n# represented by a uint64 instead of a ... | perl6 | chosen |
[
{
"from": "system",
"value": "Sort hash by keys ASCIIbetical.\n"
},
{
"from": "human",
"value": "use v6;\n\nmy @args = @*ARGS;\n\nif @args.elems == 0 {\n\t\"no files passed in through \\@args\".say;\n\texit;\n}\n\n@args := @args.rotate((1 .. @args.elems.pick).pick);\n\nmy @file_handles;\n\nfor @... | perl6 | chosen |
[
{
"from": "system",
"value": "Fix breakage due to new slang interface\n\nFixes #7\n"
},
{
"from": "human",
"value": "use nqp;\nuse QAST:from<NQP>;\n \nsub BioInfo::seq(Str $sequence) is export {\n use BioInfo::Parser::FASTA::Grammar;\n use BioInfo::Parser::FASTA::Actions;\n BioInfo::Par... | perl6 | chosen |
[
{
"from": "system",
"value": "Use correct :ver adverb for version\n"
},
{
"from": "human",
"value": "unit class App::Nopaste:version<1.001001>;\n\nuse Pastebin::Gist;\nuse Pastebin::Shadowcat;\n\nsubset ValidPastebins of Str where any <gist shadow>;\nmethod paste ( @files ) returns Str {\n if... | perl6 | chosen |
[
{
"from": "system",
"value": "Fix the shell cmds\nAdded error messages when running the shell commands as well.\n"
},
{
"from": "human",
"value": "\nuse Hiker::Model;\nuse Git::Wrapper;\nuse Config::From 'repos.json';\n\n#Update one of the git repos.\nclass Model::Update does Hiker::Model {\n ... | perl6 | chosen |
[
{
"from": "human",
"value": "Add example to send a message\n\nAs requested in #12\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env perl6\nuse v6;\nuse lib 'lib';\nuse Matrix::Client;\n\nsub MAIN(:$room-id?, :$room-alias?, *@args) {\n unless $room-id.so || $room-alias.so {\n fail 'Missin... | perl6 | chosen |
[
{
"from": "system",
"value": "Add custom type i.e. Int-or-Str for header\nAdd attributes and their properties\n"
},
{
"from": "human",
"value": "use v6;\nunit class DataTable;\n\n\n=begin pod\n\n=head1 NAME\n\nDataTable - Convert your data files to data table\n\n=head1 SYNOPSIS\n\n use DataTabl... | perl6 | chosen |
[
{
"from": "system",
"value": "Remove useless code arg from escape.\n"
},
{
"from": "human",
"value": "use Grammar::RFC3986;\nuse v6;\n\nrole URI2::Escape {\n method escape (\n Str:D $unescaped_string,\n :$pattern = /<!Grammar::RFC3986::unreserved>./,\n :$code = { $_.Str.e... | perl6 | chosen |
[
{
"from": "system",
"value": "Make this work with NativeCall HEAD\n\nA bit hacky, but there is not yet a \"proper\" way to do this\n"
},
{
"from": "human",
"value": "module Auth::PAM::Simple;\n\nour sub authenticate(Str $service, Str $user, Str $pass --> Bool) is export {\n return !auth($serv... | perl6 | chosen |
[
{
"from": "system",
"value": "Add unit declarator to module declarations\n\nAs of Rakudo 2015.05, the `unit` declarator is required before using\n`module`, `class` or `grammar` declarations (unless it uses a block). Code\nstill using the old blockless semicolon form will throw a warning. This\ncommit stops... | perl6 | chosen |
[
{
"from": "system",
"value": "Delete HTTP_CONTENT_TYPE and HTTP_CONTENT_LENGTH keys if in %env\n"
},
{
"from": "human",
"value": "use v6;\r\n\r\nuse SCGI;\r\nuse IO::Blob;\r\n\r\nunit class Crust::Handler::SCGI;\r\n\r\nhas $!scgi;\r\n\r\nsubmethod BUILD(:$host, :$port) {\r\n $!scgi = SCGI.new... | perl6 | chosen |
[
{
"from": "system",
"value": "Add a flag to Descriptor::Set\n\nRemind me again why I'm creating these bitflags as enums rather than constants?"
},
{
"from": "human",
"value": "unit class Vulkan::Descriptor::Set::Layout is repr('CPointer');\n# FIXME: figure out what \"non-dispatchable\" means and... | perl6 | chosen |
[
{
"from": "human",
"value": "Add script to convert from VIM snippets to atom CSON format\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env perl6\n\nuse v6;\n\nsay \"Hello world\";\n\nmy $fh = \"output.cson\".IO.open(:w);\n$fh.say( q{'.source.perl6':} );\nmy $body;\nmy $snippet;\nfor \"snippets/per... | perl6 | chosen |
[
{
"from": "human",
"value": "Add test of Parrot's data_json JSON parser\n"
},
{
"from": "gpt",
"value": "###\n### json-test.nqp: Test behavior of the JSON parsing language (data_json)\n###\n\n# TO USE:\n# * Make sure parrot and parrot_config are in your path, then:\n# $ export NQP_PBC=$(par... | perl6 | chosen |
[
{
"from": "system",
"value": "Add unit declarator to module declarations\n\nAs of Rakudo 2015.05, the `unit` declarator is required before using\n`module`, `class` or `grammar` declarations (unless it uses a block). Code\nstill using the old blockless semicolon form will throw a warning. This\ncommit stops... | perl6 | chosen |
[
{
"from": "system",
"value": "Rewrite basic tick/tock interval example\n"
},
{
"from": "human",
"value": "my $ticker = Supply.interval(1);\nmy $ticktock = $ticker.map({ $_ % 2 ?? 'tock' !! 'tick' });\n$ticktock.tap(&say);\nsleep 5;\n"
},
{
"from": "gpt",
"value": "react {\n when... | perl6 | chosen |
[
{
"from": "human",
"value": "Create random DNA sequences in FASTQ or FASTA format"
},
{
"from": "gpt",
"value": "#!/bin/env perl6\n\nmulti MAIN ($length=50, $count=32000000, $filetype='fastq')\n{\n MAIN($filetype, $length, $count);\n}\n\nmulti MAIN('fastq', $length, $count)\n{\n my $fh = o... | perl6 | chosen |
[
{
"from": "human",
"value": "Create start of perl6 version of script. Rakudo is dog slow on it (~7 seconds to read file, ~10 minutes to create the Trie, for comparison perl5 is instantaneous). I'll see if niezca fares any better.\n"
},
{
"from": "gpt",
"value": "use v6;\n\nmy KeySet $seen .= new... | perl6 | chosen |
[
{
"from": "system",
"value": "Test that ? and ? may be used as bracketing characters for :sym\n"
},
{
"from": "human",
"value": "token pod_formatting_code {\n $<code>=<[A..Z]>\n '<' { $*POD_IN_FORMATTINGCODE := 1 }\n $<content>=[ <!before '>'> <pod_string_character> ]+\n '>' { $*POD_... | perl6 | chosen |
[
{
"from": "human",
"value": "Create six FASTA files, one for each reading frame\n\nInput: FASTA file (simple format with one-line sequences)\r\nOutput: Six FASTA files, one for each reading frame"
},
{
"from": "gpt",
"value": "#!/bin/env perl6\nsub MAIN ( $filename )\n{\n # Create file handle... | perl6 | chosen |
[
{
"from": "system",
"value": "Add type constraints for the failure variable\n"
},
{
"from": "human",
"value": "use v6;\nunit class Algorithm::AhoCorasick::Node;\n\nhas Set $.matched-string is rw;\nhas Algorithm::AhoCorasick::Node %.transitions is rw;\nhas $.failure is rw;\n"
},
{
"from":... | perl6 | chosen |
[
{
"from": "system",
"value": "Make Tree::Optimizer.new die on undefined transformation.\n"
},
{
"from": "human",
"value": "class Tree::Optimizer::Pass;\n\nhas $!name;\nhas $!transformation;\n\nour multi method name () { $!name; }\nour multi method name ($name) { $!name := $name; }\n\nour multi m... | perl6 | chosen |
[
{
"from": "human",
"value": "Add help index creation tool (Perl 6)\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env perl6\n\nuse v6;\n\n\nuse JSON::Fast;\n\nmy $json = \"data/perl6-help-index.json\".IO.slurp;\n\nmy $index-data = from-json($json);\n\nmy %help-index;\nfor @($index-data) -> $v {\n ... | perl6 | chosen |
[
{
"from": "human",
"value": "Add native win32 find example\n"
},
{
"from": "gpt",
"value": "use v6;\n\ndie \"This should be run only on windows\" unless $*DISTRO.is-win;\n\nuse lib 'lib';\nuse NativeCall;\nuse File::Which;\n\nconstant LIB = 'shlwapi';\n\nconstant ASSOCF_OPEN_BYEXENAME = 0x2... | perl6 | chosen |
[
{
"from": "human",
"value": "Add a minmaxheap-cmp infix subroutine\n"
},
{
"from": "gpt",
"value": "use v6;\n\nunit module Algorithm::MinMaxHeap::CmpOperator;\n\nuse Algorithm::MinMaxHeap::Comparable;\n\nmulti sub infix:<minmaxheap-cmp>(Cool $lhs, Cool $rhs) is export {\n return $lhs cmp $rhs... | perl6 | chosen |
[
{
"from": "system",
"value": "Fix the order of DESTROY invocation.\n\nMake it correspond to S12-construction/destruction.t, i.e. from subclass\nto parent classes; or, in other wosrds, reverse to (R)MRO.\n"
},
{
"from": "human",
"value": "role Perl6::Metamodel::Finalization {\n has @!destroyer... | perl6 | chosen |
[
{
"from": "system",
"value": "Fix warning on rakudo latest\n"
},
{
"from": "human",
"value": "\nuse v6;\n\nunit module MagickWand::NativeCall::Mogrify;\n\nuse NativeCall;\nuse MagickWand::NativeCall::Common;\n\n=begin pod\n=head1 MagickCommandGenesis\n=head2 C\n\n MagickBooleanType MagickComm... | perl6 | chosen |
[
{
"from": "human",
"value": "Add rosetta code initial parser\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env perl6\n\nuse v6;\n\n\n#my $html = slurp 'test_1.html';\n\n#=begin i\nmy $html = q:to/END/;\n<pre class=\"perl6 highlighted_source\">\n1\n1.1\n</pre>\n<pre>2</pre>\n<pre>3</pre>\n<pre>4</p... | perl6 | chosen |
End of preview. Expand
in Data Studio
README.md exists but content is empty.
- Downloads last month
- 7