Skip to content

Instantly share code, notes, and snippets.

View Xliff's full-sized avatar
🏠
Working from home

Xliff Xliff

🏠
Working from home
View GitHub Profile

Is this a valid Perl6 script?

use v6.c;

my @a;
my $b;
my %c;

sub EXPORT(+@a) {

And, of course, there is something wrong.

Code:

use v6.c;

grammar XSLTFuncDef {
	TOP { 
 'XSLTPUBFUN' 

So now my code looks like this:

use v6.c;

use Grammar::Tracer;

grammar XSLTFuncDef {
	token TOP { 
		'XSLTPUBFUN' <ws>

This piece of code is acting like it is not in a heredoc... [ SOLVED! see, below ]

say qq:to/HERE/;
		sub $f<functionName>($argsList) {
			die 'Function requires XML::LibXML'
				unless \$XSLT_xml_support;

			sub _$f<functionName>($fullArgsList) 
@Xliff
Xliff / random_gist.md
Created November 18, 2016 17:57
RAKUDO_MODULE_DEBUG and missing IO::Socket::SSL

As requested, RAKUDO_MODULE_DEBUG of output from HTTP::UserAgent test script.

First, the script, for context:

use v6;
use HTTP::UserAgent;
use HTTP::Request;
use URI;

I have this thing I want to try, but it requires a bit of runtime smarts, since I don't know ahead of time what some of the inputs are. So I figured I would try to write a grammar capable of learning or...being dynamic.

However I've run into a bit of a snag.

Code:

use v6.c;

I've been trying to set up an enum that represents orders of magnitude in an easy to understand way.

Originally, I started out with:

enum Magnitude is export (
  'T'  => 1e12,
  'G'  => 1e9,
  'M'  => 1e6,
  'k'  => 1000,
@Xliff
Xliff / NativeOrNativeCall.md
Created August 25, 2017 15:08
Is This A Native Problem, or just NativeCall.md
==25187== Conditional jump or move depends on uninitialised value(s)
==25187==    at 0x492E8D9: set_int (in /home/cbwood/.rakudobrew/moar-nom/install/lib/libmoar.so)
==25187==    by 0x4916EF2: MVM_repr_set_int (in /home/cbwood/.rakudobrew/moar-nom/install/lib/libmoar.so)
==25187==    by 0x4916FEC: MVM_repr_box_int (in /home/cbwood/.rakudobrew/moar-nom/install/lib/libmoar.so)
==25187==    by 0x49184B7: native_ref_fetch (in /home/cbwood/.rakudobrew/moar-nom/install/lib/libmoar.so)
==25187==    by 0x722CB74: p6decontrv (in /home/cbwood/.rakudobrew/moar-nom/install/share/perl6/runtime/dynext/libperl6_ops_moar.so)
==25187==    by 0x48D2F2B: MVM_interp_run (in /home/cbwood/.rakudobrew/moar-nom/install/lib/libmoar.so)
==25187==    by 0x48F00F7: start_thread (in /home/cbwood/.rakudobrew/moar-nom/install/lib/libmoar.so)
==25187== by 0x49CF6F4: uv__thread_start (thread.c:49)
@Xliff
Xliff / EveSystems.pm6
Last active October 3, 2017 21:09
Perl 6 parsing data structures
use v6;
unit module Eve::Systems;
our %systems = (
30000001 => {
x => -8.85107925999806e+16,
solarSystemName => 'Tanoo',
security => 0.858324068848468,
z => -4.45135253464797e+16,