Skip to content

Instantly share code, notes, and snippets.

View deoac's full-sized avatar
💭
I may be slow to respond.

Shimon Bollinger deoac

💭
I may be slow to respond.
View GitHub Profile
@deoac
deoac / ch-1.raku
Created October 1, 2023 03:40
Perl Weekly Challenge #236, Task 1
#! /usr/bin/env raku
# Perl Weekly Challenge #236 Task 1
# © 2023 Shimon Bollinger. All rights reserved.
# Last modified: Sat 30 Sep 2023 11:29:05 PM EDT
# Version 0.0.1
# always use the latest version of Raku
use v6.*;
@deoac
deoac / ch-2.raku
Created September 30, 2023 22:57
Perl Weekly Challenges 236, Task 2
#! /usr/bin/env raku
# Perl Weekly Challenge #236 Task 2
# © 2023 Shimon Bollinger. All rights reserved.
# Last modified: Sat 30 Sep 2023 06:51:22 PM EDT
# Version 0.0.1
# always use the latest version of Raku
use v6.*;
@deoac
deoac / callwith-test.trace
Created September 19, 2023 01:18
Trace output of callwith-test.raku
3 (callwith-test.raku line 6)
multi sub count (IO::Path $filehandle!) {
ENTER { say "begin count (IO::Path)" }
my $count = $filehandle.slurp.lines.elems;
say "{$filehandle.basename} has $count lines";
LEAVE { say "end count (IO::Path)"; }
} # end of multi sub count (IO::Path $filehandle!)
15 (callwith-test.raku line 13)
multi sub count (Str $filename!) {
ENTER { say "begin count (Str)" }
@deoac
deoac / Testing class variables
Created June 6, 2023 20:04
Trying to understand the difference between state, our, and my class variables.
#! /usr/bin/env raku
use v6.*;
multi MAIN ( ) {
my class A {
state $count = 0; say "Using a state variable";
# our $count = 0; say "Using an our variable";
# my $count = 0; say "Using a my variable";
submethod TWEAK { $count++; }
@deoac
deoac / perl-V.txt
Created April 9, 2023 19:26
[niner/Inline-Perl5] Problem using Smart::Comments:from<Perl5> in a Raku program (Issue #182)
Summary of my perl5 (revision 5 version 36 subversion 0) configuration:
Platform:
osname=darwin
osvers=22.1.0
archname=darwin-thread-multi-2level
uname='darwin ventura 22.1.0 darwin kernel version 22.1.0: sun oct 9 20:14:54 pdt 2022; root:xnu-8792.41.9~2release_x86_64 x86_64 '
config_args='-des -Dinstallstyle=lib/perl5 -Dinstallprefix=/usr/local/Cellar/perl/5.36.0 -Dprefix=/usr/local/opt/perl -Dprivlib=/usr/local/opt/perl/lib/perl5/5.36 -Dsitelib=/usr/local/opt/perl/lib/perl5/site_perl/5.36 -Dotherlibdirs=/usr/local/lib/perl5/site_perl/5.36 -Dperlpath=/usr/local/opt/perl/bin/perl -Dstartperl=#!/usr/local/opt/perl/bin/perl -Dman1dir=/usr/local/opt/perl/share/man/man1 -Dman3dir=/usr/local/opt/perl/share/man/man3 -Duseshrplib -Duselargefiles -Dusethreads'
hint=recommended
useposix=true