Skip to content

Instantly share code, notes, and snippets.

View zoffixznet's full-sized avatar
💭
😂

Zoffix Znet zoffixznet

💭
😂
View GitHub Profile
@zoffixznet
zoffixznet / IO-kills.md
Last active April 14, 2017 22:01
IO-kills.md

⚠️⚠️⚠️ IMPORTANT ⚠️⚠️⚠️

This document is kept for archival purposes only and does not necessarily describe implemented reality. Do NOT assume the behaviour described here is how things are meant to work. Use the Perl 6 Specification or consult with core developers for that purpose.

Summary of the changes to the original IO Action Plan

  1. Instead of using mutually-exclusive named arguments to .seek, split it into three methods instead: .seek-from-start, .seek-from-current, .seek-from-end. Discussion
  2. Add :joiner argument to .exension that defaults to empty string if $replacement is an empty string or to a . if $replacement is not an empty string. Usage examples and discussion
  3. Deprecate IO::Path.chdir in 6.d; remove it in 6.e. Discussion
  4. Deprecate $*SPEC in 6.d; remove it in 6.e. This depends on how successful the plan is when implemented in a module first. Details
constant N = 10000;
constant DIV = 5;
constant CORES = 32;
constant batch = N div CORES;
(0, batch … N, N).rotor(2 => -1).flat.map({$^a^..$^b}).race(:batch).map(*.grep(* %% DIV).sum).sum.say;
// ==UserScript==
// @name Remove GitHub dark bar
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://github.com/*
// @match https://gist.github.com/*
// @grant none
// ==/UserScript==
// ==UserScript==
// @name Remove GitHub dark bar
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://github.com/*
// @grant none
// ==/UserScript==
use Test;
subtest 'smartmatch against numeric range' => {
constant fr2 = FatRat.new: 2, 1;
constant fr3 = FatRat.new: 3, 1;
constant @true = 2..3, '2'..'3', 2/1..3/1, 2..3, 2.5..2.8, 1^..3,
'2'..^'3', '1'^..^3, -1/0..1/0, fr2..fr3, 2..fr3, 2e0..fr3;
constant @false = 1..3, '2'..'4', -2..5/1, -10..10, 2.5..6.5, 0^..3,
'2'..^'4', '1'^..^4, 0/0..0/0, fr3..10, -2e0..fr2, 3e0..fr3;
constant @variants = 2..3, 2..3e0, 2..3.0, 2..fr3,
2e0..3, 2e0..3e0, 2e0..3.0, 2e0..fr3,
When either an input or result is NaN, this standard does not interpret the sign of a NaN. Note, however,
that operations on bit strings — copy, negate, abs, copySign — specify the sign bit of a NaN result,
sometimes based upon the sign bit of a NaN operand. The logical predicate totalOrder is also affected by
the sign bit of a NaN operand. For all other operations, this standard does not specify the sign bit of a NaN
result, even when there is only one input NaN, or when the NaN is produced from an invalid operation.
cpan@perlbuild2~/CPANPRC/rakudo (nom)$ make t/spec/S03-smartmatch/range-range.t
rm -f -- perl6
cp -- perl6-m perl6
chmod -- 755 perl6
/home/cpan/perl5/perlbrew/perls/perl-5.24.0/bin/perl t/harness5 --fudge --moar --keep-exit-code --verbosity=1 t/spec/S03-smartmatch/range-range.t
ok 1 - proper inclusion +
ok 2 - proper inclusion -
ok 3 - inclusive vs inclusive right end
ok 4 - exclusive vs inclusive right end
Applying: first prototype of a per-line coverage reporter
Using index info to reconstruct a base tree...
M build/Makefile.in
M lib/MAST/Ops.nqp
M src/core/frame.c
M src/core/interp.c
M src/core/oplabels.h
M src/core/oplist
M src/core/ops.c
M src/core/ops.h