Skip to content

Instantly share code, notes, and snippets.

View ab5tract's full-sized avatar

ab5tract ab5tract

  • Amsterdam, Netherlands
View GitHub Profile
@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'
@ab5tract
ab5tract / depends.json
Created October 14, 2024 08:38
This is the kind of thing that makes parsing META6.json hard
{
"depends" : {
"build": {
"requires": [
"Distribution::Builder::MakeFromJSON",
{
"from" : "bin",
"name" : {
"by-distro.name" : {
"macosx" : "python2.7-config",
@ab5tract
ab5tract / gist:270cf5959df3db0dd13dbac76034a561
Created September 9, 2024 19:33
make install not working?
~/c/r/z/d/rakudo (main)
> make install
+++ Creating installation directories
+++ Removing old files
===SORRY!=== Error while compiling /Users/longwalker/code/raku/z.others/direct/rakudo/tools/build/clean-target-files.raku
A unit-scoped sub definition is not allowed in a subscope;
Please use the block form.
at /Users/longwalker/code/raku/z.others/direct/rakudo/tools/build/clean-target-files.raku:3
------> der, *@files where @files.so, Bool :$v);⏏<EOL>
make: *** [m-install-pre] Error 1
@ab5tract
ab5tract / gist:6bf842c703c1d2c8817561f4cbf5e601
Last active August 26, 2024 15:56
trait_mod:<is> weirdness
diff --git a/src/Perl6/Actions.nqp b/src/Perl6/Actions.nqp
index c80a941bb..f67a79888 100644
--- a/src/Perl6/Actions.nqp
+++ b/src/Perl6/Actions.nqp
@@ -6064,6 +6064,9 @@ class Perl6::Actions is HLL::Actions does STDActions {
}
method apply($declarand, *%additional) {
+ if $!match<longname> eq 'revision-gated' {
+ try dd($!trait_mod, $!match, $declarand);