Skip to content

Instantly share code, notes, and snippets.

use v6;
unit module Math::Hessification;
#| why else do we have -0..?
my &sign = -> Numeric $x {
$x >= 0 ?? 1 !! -1
}
#| equally tempered
my $*TOLERANCE = (2**(1/12))/100e0;
$ ./perl6-jdb-server -e'my @a = 1, 1, * + * ... * < 20; use java::lang::System:from<JavaRuntime>; System.get_out.println(@a)'
Listening for transport dt_socket at address: 8000
Listening for transport dt_socket at address: 8000
java.lang.RuntimeException: This type does not support positional operations
in block <unit> at -e line 1
# Okay, great, let's debug this!
main[4] list
4,242
class A { };
A.^add_method('foo', my method () { "foo" });
A.^compose;
say A.foo;
use nqp;
use QRegex:from<NQP>;
BEGIN {
nqp::bindkey(
%*LANG, "MAIN", %*LANG<MAIN>.HOW.mixin(%*LANG<MAIN>, role {
token quote:sym<emote> {
"✌" ~ "✌"
{
my $shared := nqp::getattr(nqp::decont($/.CURSOR), Cursor, '$!shared');
$ ./perl6-j -e'use lib q[java#/home/psch/rakudo/javatests/]; use Foo:from<Java>'
path: file:/home/psch/rakudo/javatests/
name: Foo
urls in urlcl: file:/home/psch/rakudo/javatests/
===SORRY!===
java.lang.RuntimeException: java.lang.ClassNotFoundException: Foo
class CompUnit::Repository::Java does CompUnit::Repository does CompUnit::Repository::Locally {
has $!interop;
method need(
CompUnit::DependencySpecification $spec,
CompUnit::PrecompilationRepository $precomp = self.precomp-repository(),
)
returns CompUnit:D
{
if $spec.from eq 'Java' {
$ ./perl6-j -e'use lib q[java#/home/psch/rakudo/rakudo/install/bin]; .say for $*REPO.repo-chain'
CompUnit::Repository::Java.new(next-repo => CompUnit::Repository::FileSystem.new("/home/psch/rakudo/rakudo/install/bin"))
file#/home/psch/rakudo/rakudo/install/bin
file#/home/psch/rakudo/rakudo/install/share/perl6/runtime
file#/home/psch/rakudo/rakudo/install/share/perl6/lib
file#/home/psch/rakudo/rakudo/install/share/nqp/lib
inst#/home/psch/.perl6
inst#/home/psch/rakudo/rakudo/install/share/perl6/site
inst#/home/psch/rakudo/rakudo/install/share/perl6/vendor
inst#/home/psch/rakudo/rakudo/install/share/perl6
main[1] catch uncaught org.perl6.nqp.runtime.UnwindException
Deferring uncaught org.perl6.nqp.runtime.UnwindException.
It will be set after the class is loaded.
main[1] run
> Set deferred uncaught org.perl6.nqp.runtime.UnwindException
Exception occurred: org.perl6.nqp.runtime.UnwindException (uncaught)
Exception occurred: org.perl6.nqp.runtime.UnwindException (uncaught)"thread=main", org.perl6.nqp.runtime.Ops.invokeDirect(), line=2,374 bci=150
2,374 throw e;
$ ./perl6-j -e'return'
Unhandled exception; category = 65536
in return (gen/jvm/CORE.setting:632)
in <unit> (-e:1)
in <unit-outer> (-e:1)
in eval (gen/jvm/stage2/NQPHLL.nqp:1198)
in (gen/jvm/stage2/NQPHLL.nqp:1288)
in command_eval (gen/jvm/stage2/NQPHLL.nqp:1285)
in command_eval (src/Perl6/Compiler.nqp:27)
in command_line (gen/jvm/stage2/NQPHLL.nqp:1269)
$ ./perl6-m --target=parse -e'&0'
- statementlist: &0
- statement: 1 matches
- EXPR: &0
- variable: &0
- index: 0
- sigil: &