Skip to content

Instantly share code, notes, and snippets.

View ab5tract's full-sized avatar

ab5tract ab5tract

  • Amsterdam, Netherlands
View GitHub Profile
@ab5tract
ab5tract / pod.raku
Last active September 23, 2025 07:58
$=pod visibility
=for foo
zippo
say $=pod;
q:to/CODE/.EVAL;
say $=pod
CODE
1..20
# Subtest: Simple leading and trailing pod declarator test
ok 1 - Str: deparse
ok 2 - Raku: deparse
1..2
ok 1 - Simple leading and trailing pod declarator test
# Subtest: Simple block with leading and trailing pod test
ok 1 - deparse
ok 2 - AST: did we get a block
ok 3 - AST: can it run and return value
'UNIT', sub ($cur) {
my Mu $ctx := nqp::getattr(nqp::decont($cur), PseudoStash6c, '$!ctx');
nqp::say("Lookie here! ");
nqp::say(nqp::isnull($ctx));
until nqp::isnull($ctx) || nqp::existskey(nqp::ctxlexpad($ctx), '!UNIT_MARKER') {
nqp::say("going");
$ctx := nqp::ctxouter($ctx);
}
nqp::say(nqp::existskey(nqp::ctxlexpad($ctx), '!UNIT_MARKER')) unless nqp::isnull($ctx);
nqp::isnull($ctx)
@ab5tract
ab5tract / csv-split.raku
Created January 8, 2025 17:01
A small csv splitter that can do custom handling of values
# For a line that has two values, which may be missing but will always be in the order of Integer,String
class Line {
my @default-values = [ 42, Str ]; # purely theoretical
has @.values;
method new($line) {
my @values = $line.split(',');
for ^2 -> $idx {
@ab5tract
ab5tract / csv-example.raku
Last active January 1, 2025 21:28
A small example
diff --git a/lib/Cromponent.rakumod b/lib/Cromponent.rakumod
index 1bb5708..668d2de 100644
--- a/lib/Cromponent.rakumod
+++ b/lib/Cromponent.rakumod
@@ -234,8 +234,13 @@ sub cromponent-library($component) is export {
multi EXPORT(--> Map()) {
'&trait_mod:<is>' => &trait_mod:<is>,
- '&EXPORT' => sub {
- [|@components-sub, |@components-macro].map({ |cromponent-library $_ }).Map
@ab5tract
ab5tract / fix-favorite.diff
Last active January 1, 2025 22:01
Fix for Cromponent PR#9 (maybe?)
diff --git a/lib/Cromponent.rakumod b/lib/Cromponent.rakumod
index 1bb5708..339046d 100644
--- a/lib/Cromponent.rakumod
+++ b/lib/Cromponent.rakumod
@@ -234,8 +234,12 @@ sub cromponent-library($component) is export {
multi EXPORT(--> Map()) {
'&trait_mod:<is>' => &trait_mod:<is>,
- '&EXPORT' => sub {
- [|@components-sub, |@components-macro].map({ |cromponent-library $_ }).Map
@ab5tract
ab5tract / base-results.out
Last active November 23, 2024 17:59
vent-at-0
> ./rakudo-m ../rakudo-test-cases/vent-at-zero-base.raku
1
50
99
148
197
246
294
@ab5tract
ab5tract / fix-library.diff
Created November 11, 2024 03:51
Fixing `Math::Primesieve`
diff --git a/lib/Math/Primesieve.rakumod b/lib/Math/Primesieve.rakumod
index 311f95d..ffaca8e 100644
--- a/lib/Math/Primesieve.rakumod
+++ b/lib/Math/Primesieve.rakumod
@@ -1,16 +1,10 @@
-use NativeLibs:ver<0.0.8+>:auth<github:salortiz>;
-my $Lib;
+use MacOS::NativeLib 'primesieve';
@ab5tract
ab5tract / make-failure
Created November 2, 2024 18:26
Error while attempting to compile `dedicated_nursery_memory_area`
compiling src/platform/posix/mmap.o
src/platform/posix/mmap.c:56:62: error: use of undeclared identifier 'MAP_FIXED_NOREPLACE'
void *block = mmap(addr, size, prot_mode, MVM_MAP_ANON | MAP_FIXED_NOREPLACE | MAP_PRIVATE | MAP_NORESERVE, -1, 0);
@ab5tract
ab5tract / sad.txt
Created October 18, 2024 18:50
Terminal::LineEditor
[0] > Cannot locate native library '/var/folders/_9/q1z_t3015xs7l711cccg2pgr0000gn/T/.zef.1727705775.88011/1727705783.88011.6597.940608814053/resources/5342239100523A11F35C47F949A6974841869956.dylib': dlopen(/var/folders/_9/q1z_t3015xs7l711cccg2pgr0000gn/T/.zef.1727705775.88011/1727705783.88011.6597.940608814053/resources/5342239100523A11F35C47F949A6974841869956.dylib, 0x000A): tried: '/5342239100523A11F35C47F949A6974841869956.dylib' (no such file), '/var/folders/_9/q1z_t3015xs7l711cccg2pgr0000gn/T/.zef.1727705775.88011/1727705783.88011.6597.940608814053/resources/5342239100523A11F35C47F949A6974841869956.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/var/folders/_9/q1z_t3015xs7l711cccg2pgr0000gn/T/.zef.1727705775.88011/1727705783.88011.6597.940608814053/resources/5342239100523A11F35C47F949A6974841869956.dylib' (no such file), '/var/folders/_9/q1z_t3015xs7l711cccg2pgr0000gn/T/.zef.1727705775.88011/1727705783.88011.6597.940608814053/resources/5342239100523A11F35C47F949A6974841869956.dylib'