This channel is intended for people just starting with the Raku Programming Language (raku.org). Logs are available at irclogs.raku.org/raku-beginner/live.html Set by lizmat on 8 June 2022. |
|||
stevied | anyone got a clue on this problem I encountered? stackoverflow.com/questions/751904...irectory-e | 00:27 | |
maybe the name of my module, "Directory" is the problem? | 00:28 | ||
Nemokosch | that part you can easily try, I'd say. But let's check the mi6 sources first | 00:34 | |
okay, definitely a problem during the fez step | 00:37 | ||
stevied | yeah, tried running the fez step manually, same error | 00:39 | |
was just getting ready to go relax for the evening now I'm all uptight because this isn't working 🙂 | |||
Nemokosch | 😅 | 00:40 | |
so, do you do fez checkbuild in the folder where your META6.json is to be found? | 00:42 | ||
stevied | no, not familiar with that | 00:44 | |
``` | |||
> $ fez checkbuild [±main ✓] | |||
>>= Inspecting ./META6.json | |||
>>= meta<provides> looks OK | |||
>>= meta<resources> looks OK | |||
>>= Directory:ver<0.0.1>:auth<zef:sdondley> looks OK | |||
``` | |||
Nemokosch | and you run mi6 release in the same folder? | 00:45 | |
stevied | yes sir | ||
or ma'am | |||
Nemokosch | I wonder if you can run `pax`? | 00:50 | |
stevied | never heard of it | 00:51 | |
Nemokosch | me neither but doesn't matter | 00:52 | |
stevied | here's where the error is generated: github.com/tony-o/raku-fez/blob/8d...kumod#L241 | 00:57 | |
Nemokosch | yeah yeah | 00:59 | |
that's why I'm asking if you can do this pax | |||
this is where the tarball is created github.com/skaji/mi6/blob/965ecfee...akumod#L31 | 01:10 | ||
this is the first ls candidate github.com/tony-o/raku-fez/blob/64...akumod#L27 | 01:12 | ||
stevied | what can that tell me? | 01:13 | |
Nemokosch | hm? | ||
stevied | looks like I have a /bin/pax command | 01:14 | |
Nemokosch | it would be good to know what it returns for the actual archive you get | 01:16 | |
stevied | I don't know how to run that command on the archive | ||
Nemokosch | well the example is right there in the code | ||
stevied | ``` | 01:17 | |
> $ pax -f Directory-0.0.1.tar.gz [±main ✓] | |||
pax: Cannot identify format. Searching... | |||
pax: Cpio file name length 29594 is out of range | |||
pax: Invalid header, starting valid header search. | |||
pax: End of archive volume 1 reached | |||
``` | |||
what does that tell me? anything useful? | 01:18 | ||
Nemokosch | is there any reason you aren't doing the kind of call zef does? | 01:19 | |
stevied | I don't follow you. | ||
i'm just doing `mi6 release` like I've done many times before. this is the first time I've ran into this problem. | 01:20 | ||
Nemokosch | anyway | 01:21 | |
stevied | paste.debian.net/1267994/ | 01:24 | |
ok, this looks interesting | 01:25 | ||
Nemokosch | are those pax: lines going to stderr? | 01:26 | |
stevied | see github.com/frithnanth/perl6-Archiv...1377385341 | 01:28 | |
I think I might have fucked something up | |||
Nemokosch | rip | ||
stevied | hmm, removing the symlink didn't help | 01:31 | |
ugh | |||
Nemokosch | anyway, what is the output if you do 2> /dev/null on the pax command? | ||
because it seems it should only take the stdout into account | |||
also you could do an echo $? after | 01:32 | ||
stevied | I get this: paste.debian.net/1267996/ | 01:33 | |
Nemokosch | I think the space is significant there | ||
stevied | `echo $?` is 0 | ||
Nemokosch | 2> as opposed to 2 > | ||
stevied | k | ||
Nemokosch | anyway, this pretty much spoiled it: the errors shouldn't matter | 01:34 | |
stevied | now I get: paste.debian.net/1267997/ | ||
Nemokosch | okay, this is getting nice, but also surprising | 01:35 | |
sadly Raku is nowhere near built on this shittopű | 01:36 | ||
sadly Raku is nowhere near built on this shittop | |||
stevied | what do you mean? | ||
Nemokosch | trynna play with glot.io then | ||
stevied | <@297037173541175296> so what are you thinking? any ideas? | 01:42 | |
oh wait | |||
Nemokosch | if only this crap wasn't this slow | 01:43 | |
stevied | damn, my idea didn't work | ||
01:46
jgaz left
|
|||
Nemokosch | idk, could you substitute this output into ^this snippet? | 01:47 | |
as the ls | |||
stevied | substitute what output? | 01:48 | |
Nemokosch | the output of that pax stuff | ||
the lines I guess | |||
okay, I think I have it | 01:49 | ||
._Directory-0.0.1 is the problem | |||
I don't know where this came from | 01:50 | ||
stevied | heh, i was just wondering about that myself | ||
Nemokosch | I suppose you don't have a file like that in your folder | ||
does it really exist in the tar? | |||
stevied | hmmm, nope | 01:53 | |
Nemokosch | well then maybe we could compare it with other distros that did work properly and see if that pax command reports fake files for those as well. But not now because it's really late and I'm falling asleep | 01:54 | |
stevied | ok, i'll try | 01:55 | |
thanks for your help. i'll keep working on it | 01:56 | ||
04:40
discord-raku-bot left,
discord-raku-bot joined
05:23
raku-discord joined
05:24
raku-discord left
05:25
raku-discord joined,
raku-discord left
05:26
raku-discord joined,
raku-discord left
05:33
Heptite left
|
|||
el gatito | <@853712446660673566> | 06:19 | |
m: ```raku | 06:23 | ||
echo('hello world'); | |||
``` | |||
m: ```raku | 06:24 | ||
say('hello world'); | |||
``` | |||
07:40
discord-raku-bot left,
discord-raku-bot joined
08:39
Heptite joined
08:40
discord-raku-bot left
08:41
discord-raku-bot joined
09:29
jack9 joined
|
|||
jack9 | hi | 09:30 | |
Nemokosch | 👋 | 09:46 | |
jack9 | why can't i create variable without `my` | 09:49 | |
Nemokosch | you can: there is also `our` and `state` 😛 | 09:50 | |
jack9 | m: $var = 0; | 09:51 | |
camelia | ===SORRY!=== Error while compiling <tmp> Variable '$var' is not declared. Did you mean '&VAR'? at <tmp>:1 ------> <BOL>⏏$var = 0; |
||
Nemokosch | well I can't see `our` or `state` in that example | 09:52 | |
09:57
NemokoschKiwi joined
|
|||
NemokoschKiwi | m: our $var = 0; | 09:57 | |
camelia | ( no output ) | ||
NemokoschKiwi | m: state $var = 42; | ||
camelia | ( no output ) | ||
NemokoschKiwi | now let me ask back: do you want to declare variables implicitly, and if so, why? | 09:58 | |
jack9 | so i don't have to type `my` | 10:00 | |
NemokoschKiwi | not gonna lie, I don't find that such a noble goal, it's fairly arbitrary | 10:01 | |
10:24
jack9 left
|
|||
lakmatiol | You get two implicit variables, `$_` and `$`. In general, implicit variables create some annoying ambiguities and complicate scope resolution, while providing minimal merit. | 10:39 | |
where $_ is block scoped, and `$` is state | |||
Nahita | there are more "implicit" variables than those | 10:56 | |
and you should add "in my opinion" or something to end of that sentence | |||
Nemokosch | 🚔 | 11:03 | |
11:07
NemokoschKiwi left
11:09
ab5tract joined
|
|||
Nahita | if you're replying to me, i don't see those garbage anymore, so might as well not bother | 11:27 | |
sour | hi, does raku work properly on windows (no WSL) ? I've had various issues in installing zef / installing packages using zef | 11:29 | |
lizmat | there are some known issues on Windows I believe | ||
sour | thx, is there a discussion I can follow somewhere? | 11:30 | |
el gatito | what is `state` declaration keyword? | 11:37 | |
ik that `my` is block scoped (like js `let`) and `our` is global but what is `state`? | |||
11:43
jack9 joined,
jack9 left
|
|||
Nemokosch | static variable: created per subroutine | 11:45 | |
<@265592945552392212> most useful experimenting is related to Coke's activity I think, he did try things ever now and then | 11:55 | ||
weird flex... no worries, your main activity was sabotage either way lmao | |||
sour | is there someplace i can follow their activity? | 11:56 | |
Nemokosch | for now I'd say, if you have a particular problem in mind, let's try to knock that down directly | 11:59 | |
he is definitely present in <#633753286209699870> - could be here as well but yeah, in either case, it's nighttime in the US now | 12:00 | ||
sour | there like 4 problems i encountered while trying to install zef & cro (using zef) | 12:14 | |
I eventually got it to work by skipping tests `--/test` and trying to install cro multiple times `--force-install`, and restarting the shell session (somehow this matters) | |||
there like 4 problems i encountered while trying to install zef & cro, App::Mi6 (using zef) | 12:15 | ||
12:17
jack9 joined
|
|||
Nemokosch | Not gonna lie: it seems like sheer luck if Cro can install with tests, I had failures there in WSL as well | 12:18 | |
I wish it got some priority for the devs | |||
sour | yeah, unfortunately there were other issues besides failing tests | 12:22 | |
jack9 | weak typing? | 12:23 | |
docs.raku.org/type/Str#(Cool)_routine_abs | |||
Nemokosch | OpenSSL stuff? | 12:24 | |
jack9: what do you mean by weak typing? | 12:25 | ||
jack9 | > Coerces the invocant (or in the sub form, the argument) to Numeric | ||
12:25
jack9 left
|
|||
Nemokosch | Mhm, if the type is suitable, it will | 12:26 | |
jack9 | a strongly typed lang will throw an error if a non numeric is passed | ||
Nemokosch | I'm not sure if that's what "strong typing" really means | 12:27 | |
but yes, by these terms, Raku isn't that | |||
in Raku, the general principle is that the operation defines the type of the operand, not the other way around | 12:28 | ||
jack9 | m: say(1 + 'hello') | 12:29 | |
m: say(1 . 'hello') | |||
Nemokosch | exactly. + is numeric addition, and 'hello' is not suitable for that | ||
this helped now, although I'm not sure I would keep that error after the big schism from Perl | 12:31 | ||
m: say(1 ~ 'hello') | 12:33 | ||
lizmat | 1 can be coerced to string | 12:35 | |
"hello" cannot be coerced to a number | 12:36 | ||
12:48
ab5tract left
12:50
ab5tract joined
|
|||
jack9 | my brain on php | 13:04 | |
13:05
Heptite left
|
|||
lizmat | so much better and less addictive than pcp | 13:09 | |
jack9 | anyways, how much does different sigils affect how the same data is treated? | 13:16 | |
as an example```raku | |||
my $coll = (1, 2, 3); | |||
my @coll = (1, 2, 3); | |||
``` `$coll` is a list while `@coll` is an array | |||
and my intuition is that `$coll` is treated as a single value while `@coll` is treated as a collection | |||
but what are the concrete differences between two of them | |||
`$coll` is not an iterable while `@coll` is? | |||
lizmat | @coll contains mutable elements, $coll does not | ||
$coll is also an Iterable, but inside a container | |||
jack9 | so `$coll` is like python tuple | 13:17 | |
lizmat | and that makes it itemized | ||
could be, don't know enough python for that :-) | |||
jack9 | and `%coll` would be invalid | 13:19 | |
Nahita | a List in Raku is like tuple of Python. In your both lines, the right hand side is a List | 13:24 | |
commas make a List | |||
in the second line, though, when you're assigning a List to a @-sigiled variable, that @-sigiled variable will be an Array | 13:25 | ||
which is... like the lists of Python | |||
so $coll is like a single thing as you say, puts/wraps that single thing in a container where that single thing is a List | 13:26 | ||
@coll is a collection of things and is an Array | |||
sorry if I resulted in confusion | 13:27 | ||
%coll would be invalid but only because there are odd number of elements so it cannot fully make pairs out of RHS | 13:28 | ||
to make the mapping | |||
Nemokosch | to be accurate: tuples in Python are deeply immutable, that's quite an important feature of them | 13:37 | |
Raku's lists are not deeply immutable, I like to put it as "they don't provide an interface for mutation" but that's it | 13:38 | ||
stevied | I got a CI test failing on Windows apparently because TAP won't install on it: github.com/sdondley/Directory/acti...6814622245 | ||
Nemokosch | did you succeed on uploading it, by the way? ^^ | 13:39 | |
stevied | I did, I used another machine. | ||
Nemokosch | tricky haha | ||
stevied | I think I somehow broke libarchive library when trying to get Archive::Libarchive module installed. I'm not sure, though. | 13:40 | |
Nemokosch | is there an issue at Raku/tap-harness6 or tap6-harness or whatever the name is? | 13:42 | |
I mean I wouldn't be surprised | |||
stevied | I just filed an issue. didn't see one there. | 13:47 | |
jack9 | m: | 13:48 | |
$lst = (1, 2, 3); | |||
$lst[1] = 4; | |||
say($lst); | |||
m: | |||
my $lst = (1, 2, 3); | |||
$lst[1] = 4; | |||
say($lst); | |||
13:50
jack9 joined
|
|||
Nemokosch | m: | 13:52 | |
jack9 | can custom objects (classes) define what happens when they are assigned to a @ or a % variable? | ||
Nemokosch | my $foo = 2; | ||
my $lst = (1, $foo, 3); | |||
$lst[1] = 4; | |||
say($lst); | |||
13:53
jack9 left
|
|||
pfff, good question | 13:54 | ||
jack9 | ono 😳 | ||
Nemokosch | that's what I mean by "just not providing mutation". the $-sigilled variable did | 13:56 | |
you know, by default, a @variable is created as an Array | 13:57 | ||
they are enforced to be Positional (which an Array obviously is) | |||
jack9 | `$foo` is a reference inside that list? | ||
Nemokosch | something like that. Instead of the reference terminology, the interface that provides the mutation is called "container" | 13:59 | |
when you create a my $variable, you get a Scalar container and your symbol is bound to that | |||
jack9 | and `($i,)` is passing the container to the list | 14:01 | |
Nemokosch | yep | 14:02 | |
a way to see what you have underlying is to call .VAR on a value | |||
my $foo = 2; | 14:03 | ||
my $lst = (1, $foo, 3); | |||
say(.WHAT, .VAR.WHAT) given $lst[0]; | |||
say(.WHAT, .VAR.WHAT) given $lst[1]; | |||
ugh | |||
m: | 14:04 | ||
my $foo = 2; | |||
my $lst = (1, $foo, 3); | |||
say(.WHAT, .VAR.WHAT) given $lst[0]; | |||
say(.WHAT, .VAR.WHAT) given $lst[1]; | |||
jack9 | so how do i "dereference" a scalar var | 14:06 | |
Nemokosch | using decontainerisation, which is commonly achieved as a "fake indexing" | 14:07 | |
$foo[] or $foo<> | |||
if you meant to get the raw content | 14:08 | ||
jack9 | back to this question | 14:09 | |
14:10
ab5tract left
|
|||
Nemokosch | could you get a more concrete example? | 14:10 | |
I have the impression that the broad answer is no but many actually related and relevant things can be achieved | 14:11 | ||
jack9 | ```perl | 14:18 | |
class Person { | |||
has $.name; | |||
has $.age; | |||
has $.gender; | |||
} | |||
my $person = Person.new(name => 'John Smith', | |||
age => 30, | |||
gender => :male); | |||
# what will happen? | |||
my @person = Person.new(name => 'John Smith', | |||
age => 30, | |||
gender => :male); | |||
``` | |||
lizmat | the Person object will be in the first element of @person | ||
jack9 | and it will always be like that for whatever class it is? | 14:19 | |
or the class can change this behavior? | |||
and it will always be like that for whatever object it is? | 14:20 | ||
or the object can change this behavior? | |||
lizmat | whatever class it is | ||
the class can not change that behaviour | |||
Nemokosch | is it possible to create new sigils? | 14:22 | |
p6steve | jack9: fwiw raku is quite forgiving ... here you are assigning a single item to a list and this may prevent a lot of boilerplate in the case that you have a function that returns both a single item and a list ... but surely it would be clearer to a maintainer that you really mean ```my @person = [Person.new(...)];``` | 14:23 | |
or ```@person.push: Person.new(...);``` | 14:24 | ||
lizmat | it is currently not possible to create new sigils, afaik | ||
jack9 | you can call a function in that syntax? | 14:27 | |
is that equivalent `@person.push(Person.new(...))` | |||
p6steve | yes | ||
if you want the rhs of an "assignment" to change the behaviour, I would say (i) don't try this with an assignment "=" and (ii) take a look at the Store/Fetch proxy in the docs | 14:30 | ||
so a way to kind of do this is to make the lhs be a method of some kind of "role" and to give the rhs object a type | 14:31 | ||
something like | |||
jack9 | role? is that like a mixin? | 14:32 | |
p6steve | ``` | 14:34 | |
role R { | |||
has $.a; | |||
multimethod m(Str $x ) { $!a = $x xx 2 } | |||
multimethod m(Int $x ) { $!a = $x * 2 } | |||
} | |||
my $r = R.new; # here we punt the role to a class | |||
$r.m: 23; | |||
$r.m: 'xyz'; | |||
say $r.a; | |||
``` | |||
yes you can go ```class C does R { ... }``` | 14:35 | ||
with a store/fetch proxy you can do this ```$r.m = 23; $r.m = 'xyz';``` | 14:36 | ||
you can likely even use the FALLBACK method to avoid using the '.m' ... | 14:37 | ||
jack9 | glot.io has some problems with it``` | 14:38 | |
===SORRY!=== Error while compiling /home/glot/main.raku | |||
Unable to parse expression in argument list; couldn't find final ')' (corresponding starter was at line 3) | |||
at /home/glot/main.raku:3 | |||
------> multimethod m(Str⏏ $x ) { $!a = $x xx 2 } | |||
expecting any of: | |||
infix | |||
infix stopper | |||
``` | |||
you forgot to put spaces in between `multi` and `method` thats why | 14:44 | ||
Nemokosch | that's right | 14:47 | |
p6steve | ``` | ||
1 role R { | |||
2 has $.a; | |||
3 | |||
4 multi method m( Str $x ) { $!a = ($x xx 2) } | |||
5 multi method m( Int $x ) { $!a = ($x * 2) } | |||
6 } | |||
7 my $r = R.new; # here we punt the role to a class | |||
8 $r.m: 23; | |||
9 $r.m: 'xyz'; | |||
10 say $r.a; | |||
``` | |||
oh sugar | |||
stevied | <@297037173541175296> github.com/tony-o/raku-fez/issues/72 | 14:49 | |
i'm not sure if that's causing the issue I'm having on my intel mac | |||
i'm gonna try on an another, older intel mac | 14:50 | ||
running an older version of macos | |||
Nemokosch | macOS should be banned from development finally 😆 | 14:51 | |
stevied | raku would have problems being a linux only platform | 14:53 | |
p6steve | ^^^ both right! | ||
Nemokosch | I mean, not if people just agreed to avoid Mac once and for all | 14:54 | |
p6steve | or use vftools ;-) | 14:55 | |
Nemokosch | there are no similar problems for even BSD | ||
stevied | if only there were world peace | ||
p6steve | free beer | ||
stevied | if only i had a full head of hair again | 14:56 | |
Nemokosch | then everybody would use Minix | 15:05 | |
stevied | ok, uploaded a new version of my distro without issue on my older intel mac | 15:11 | |
huh | |||
so wtf is wrong with my main machine? I have no idea. | |||
jack9 | m: | ||
$a = [1, 2, 3]; | |||
m: | 15:12 | ||
my $a = [1, 2, 3]; | |||
say $a.WHAT; | |||
stevied | kind of a dumb error message | ||
jack9 | i can assign an array without `@` | ||
wil | 15:13 | ||
stevied | right | ||
jack9 | til | ||
stevied | you can also assign a hash to a scalar var | ||
jack9 | does people get angry if i do that | 15:15 | |
stevied | no | 15:16 | |
I won't, at least | |||
jack9 | nice, i will code using only `$`, no one will give a shit | ||
stevied | the @ and % can help you keep track of what the variable contains | 15:17 | |
but up to you | |||
also, the scalar variable will "box" the data structure. so it can behave differently under certain circumstances | 15:18 | ||
maybe this will help shed clarity on when to use what: stackoverflow.com/a/62142436/1641112 | 15:22 | ||
jack9 | ```raku | ||
sub char_count($str) { | |||
my %res = {}; | |||
my @chars = $str.comb; | |||
for @chars -> $c { | |||
if (%res.contains($c)) { | |||
%res[$c]++; | |||
} else { | |||
%res[$c] = 1; | |||
} | |||
} | |||
%res; | |||
} | |||
say char_count('The quick brown fox jumps over the lazy dog'); | |||
stevied | use `%res{$c}` | ||
curly instead of square brackets | 15:23 | ||
jack9 | and why?``` | 15:25 | |
Applying '.contains' to a Hash will look at its .Str representation. | |||
Did you mean 'Hash{needle}:exists'? | |||
``` | |||
stevied | why curly braces? because that's the syntax. | 15:26 | |
square brackets are for arrays | |||
jack9 | no i mean why is this warning | 15:27 | |
stevied | i've never seen a .contains method on hashes. Did you see that used somewhere else? | 15:28 | |
contains is a method for a string | 15:29 | ||
docs.raku.org/type/Str#method_contains | 15:30 | ||
all you need is `%res{$c}++` | 15:31 | ||
you don't need to check if it already exists | |||
jack9 | yes i assume there is a method with a same name for hashes | ||
stevied | it will autovivify | ||
lizmat | that will stringify the hash and call .contains on that | ||
jack9 | it will automatically add an entry in `%res` (like implicit `%res{$c} = 0`) before `++`ing it? | 15:34 | |
stevied | yeah | 15:35 | |
jack9 | raku be implicitly creating zeros | 15:38 | |
why does this script give a weird output``` | 15:42 | ||
sub char_count($str) { | |||
my %res; | |||
my @chars = $str.comb; | |||
for @chars -> $c { | |||
%res{$c}++; | |||
} | |||
%res; | |||
} | |||
my %char_count = char_count('The quick brown fox jumps over the lazy dog'); | |||
for %char_count -> $char, $count { | |||
say "$char: $count\n"; | |||
} | |||
```output here``` | |||
oh nah i need to call `.kv` | 15:43 | ||
15:46
Heptite joined
|
|||
``` | 15:53 | ||
my @char_count_sorted = char_count($str).kv.sort(sub($e) {$e.key}); | |||
```why does it say``` | |||
Variable '$e' is not declared | |||
```when it clearly is? | |||
lizmat | sub ($e) | ||
nameless subs need a space, otherwise it will be interpreted as a call on a sub called "sub" | 15:54 | ||
jack9 | 🤯 | ||
lizmat | foo() without space between foo and () is *always* interpreted as a call | 15:55 | |
Nemokosch | Smh whitespAce and parens 😛 | 16:02 | |
jack9 | how to sort in descending order | 16:04 | |
stevied | .reverse | 16:11 | |
jack9 | ok | 16:12 | |
phew | 16:13 | ||
glot.io/snippets/ghhuvpi7r9 | |||
this one better | 16:20 | ||
glot.io/snippets/ghhv2edlqy | |||
Nemokosch | By the way: consider visiting docs.raku.org if you suspect that a question has a straightforward documented answer | 16:25 | |
jack9 | ok | ||
is it far from idiomatic raku | 16:26 | ||
Nemokosch | Bags could help | 16:28 | |
You take the combed version and coerce it to Bag | 16:30 | ||
Nevertheless familiarizing with the syntax is also a noble goal 🙂 | 16:31 | ||
Nahita | - Bag exists for counting things (collections.Counter like thing) | 16:41 | |
- if you're sorting a hash-like, its the pairs that are sorted, as they yield pairs when iterated. so you can leave out .pairs | |||
- instead of an anonymous sub with `sub`, you can use "whatever" currying like `*.value` in sorting | |||
- then you can do `-*.value` to sort in descending order | |||
- you can do `my ($char, $count) = $pair.kv` or in the parameter of the loop as `for @char-count-sorted -> (:key($char), :value($count)) { ... }` to destructure there | |||
- you can do `my $display-char = $char eq " " ?? "<space>" !! $char` with ternary | |||
- you can do `%res{$_}++ for @chars` with statement modifier for instead of a "normal" loop; `$_` is aliased to elements of `@chars` in each turn | |||
jack9 | `Bag.new($mystring)` to coerce to `Bag`? | 16:44 | |
`Bag.new($mystring)` to coerce `Str` to `Bag`? | 16:45 | ||
m: say Bag.new 'aaabbbccc' | 16:46 | ||
Nahita | you need .comb | ||
Nemokosch | Not sure if that's a good idea that way | ||
jack9 | m: say Bag.new('aaabbbccc'.comb) | ||
Nemokosch | But $str.comb.Bag seems safe | ||
Nahita | strings don't yield their elements on iteration | ||
jack9 | `*.value`? | 16:51 | |
Nemokosch | Of what? | ||
This is a callable, kind of like a function | |||
jack9 | m: (*.value)(raku => 'ukra') | 16:52 | |
Nemokosch | double the parens | 16:54 | |
it's interpreted as a named argument | |||
jack9 | m: (*.value)((raku => 'ukra')) | ||
m: say (*.value)((raku => 'ukra')) | |||
its called whatever operator isn't it | 16:55 | ||
Nemokosch | whatever star, at least | ||
and iirc the result is a WhateverCallable | |||
jack9 | the amount of sugar provided by raku is insane | 16:56 | |
Nemokosch | it's mostly handy if you have something simple for a callback | ||
it might break on trickier things, either syntactically or semantically | |||
m: say(*.value); say(*.WHAT); say(*.VAR); | 16:57 | ||
discord ate the formatting, imagine the asterisks :DD | |||
but yeah - the first one whatever-curried, the other two simply acted upon the asterisk as a Whatever instance | 16:58 | ||
stevied | how do I get the equivalent of %*ENV<HOME> on windows machine? | 17:01 | |
Nahita | USERPROFILE | 17:04 | |
stevied | so %*USERPROFILE<HOME>? | 17:07 | |
says not found | 17:08 | ||
Nahita | %*ENV<USERPROFILE> | 17:09 | |
stevied | oh, looks like $*HOME | 17:10 | |
Nahita | way better | ||
jack9 | `$* %*`? | 17:22 | |
does `*` mark that a variable is special/reserved? | |||
oh nvm it means dynamically scoped vars | 17:24 | ||
Nemokosch | mhm | 17:36 | |
* is the dynamic twigil | 17:37 | ||
docs.raku.org/language/variables#Twigils | 17:38 | ||
good list | |||
jack9 | `$*` - dynamic scoped vars | 17:41 | |
`$?` - inlined compile time values | |||
`$!` - private attr | |||
`$.` - public attr | |||
`$^` - placeholder vars | |||
`$` - normal | |||
`$*` - dynamic scoped var | |||
`$?` - inlined compile time value | |||
`$!` - private attr | |||
`$.` - public attr | |||
`$^` - placeholder var | |||
`$` - normal | |||
Nahita | way better... | 17:43 | |
Nemokosch | $^ in a block/function is much like the whateverstar, except you can give it a name | 17:49 | |
jack9 | how do i refer to the receiver in a method? | 17:50 | |
`$this`? | |||
Nahita | self | 17:51 | |
jack9 | so like `self.do_something(:foo(42))`? | 17:52 | |
Nahita | yes self will be the invocant you can do whatever you want with it | ||
if you want another name you can do `method yes($this: $p1, $p2) { ... }` | 17:53 | ||
note the : | |||
then $this is the invocant | |||
but self is still available | |||
jack9 | so `do_something(self, :foo(42))` would be the same? | 17:55 | |
Nahita | no it would not | ||
jack9 | wdym by invocant? | 17:56 | |
like receiver? | |||
Nahita | for a class A, if you do `my $a = A.new(...); $a.some-method(...)` | ||
then that $a is the invocant i meant | |||
and it will be seen as `self` | 17:57 | ||
in the method's body | |||
in the `A.new(...)`'s case, `A` is the invocant, as another example | |||
jack9 | so `$a` is the receiver | ||
stevied | <@297037173541175296> so when I rollback to 2022.07 release, I have no problems releasing the module with `mi6` command. so it's probably a newer version of one of the plugins causing the problem. | ||
jack9 | and that is called invocant in raku | 17:58 | |
Nahita | i think invocant is a generic term | ||
but maybe not | |||
jack9 | java docs just refer to the invocant (`this`) as “current object” lol | 18:05 | |
docs.oracle.com/javase/tutorial/ja...iskey.html | |||
gfldex | m:``` | 18:06 | |
class C { | |||
method m(::?CLASS \self: $arg1, $arg2, *@rest) { } | |||
} | |||
``` | |||
18:16
discord-raku-bot left,
discord-raku-bot joined
|
|||
<@563790557831495691> fez can create a tarball for you. Not sure if you can stop it from uploading it, tho. | 18:18 | ||
Nahita | there was a discussion about \SELF in rakudo's source code | 18:19 | |
stevied | `zef build .` is throwing `!!!> Build failure: .` | 18:21 | |
Nahita | oh you mean literally the self sorry | ||
gfldex | <@563790557831495691> that's not very kind of zef. Does it say anything interesting when asked to be verbose? | 18:31 | |
Nemokosch | both zef and especially fez have kind of unfriendly messages in general, to be honest | 18:33 | |
this badly seems like something I have seen working before... | 18:34 | ||
or maybe it was with the $ sigil? | |||
🤔 | |||
stevied | tried that and it just gave me the full path, no more info | ||
reinstalling zef didn't help | 18:35 | ||
zef is broken on other distros as well. so it's not the module | 18:37 | ||
zef install works fine. what sense does that make? | 18:38 | ||
gfldex | any luck with `--debug` ? | 18:41 | |
stevied | wtf? I get the same thing on a different machine. this is nuts. i gotta be doing something wrong | ||
``` | 18:42 | ||
> $ zef --debug build . [±main ✓] | |||
===> # SKIP: No need to build Directory:ver<0.0.3>:auth<zef:sdondley> | |||
!!!> Build failure: . at /Users/steve/git_repos/raku/modules/steve/Directory | |||
``` | |||
--force didn't help either | 18:43 | ||
Nemokosch | what is build for, in the first place | ||
"run the build process" | |||
this wouldn't necessarily give me the same idea | 18:44 | ||
stevied | it's one of my distros | ||
Nemokosch | could be that this is kind of like running a makefile | ||
stevied | I don't have a makefile | ||
gfldex | Do you actually got a `Build.pm`? | 18:45 | |
stevied | no | ||
gfldex | then there is nothing to build, hence the `# SKIP` . | 18:46 | |
Nemokosch | the message itself is horrendous though, it would have been so simple to say that there is nothing to build... | ||
but yeah, makes me wonder still, how you ended up with this command anyway | 18:47 | ||
stevied | how do I generate a Build.pm? | ||
Nemokosch | any what for? | ||
and what for? | |||
what is your goal with that? | |||
gfldex | You don't, really. You only need a `Build.pm` if you want to run code-gen scripts (or other fancy stuff) on the target host when installing a distro. | 18:48 | |
stevied | <@297037173541175296> I want to generate a tarball and inspect it to troubleshoot the other problem I'm having | ||
Nemokosch | I suspect zef build is not for that. Do you have something that tells you otherwise? | 18:49 | |
stevied | no. but this is how things worked when I used to use Dist::Zilla with perl | ||
I just assume it uses the same design patter | 18:50 | ||
`mi6 build` doesn't generate a tarball for me either | |||
Nemokosch | so far, evidence suggests otherwise | ||
yep, mi6 release does | |||
stevied | when I try, I get an error that there are no changes to my Change file | 18:51 | |
I don't want to make changes. I just want a GD tarball | |||
Nemokosch | of course, it's not the primary use of mi6 release 😄 | ||
I'd rather check fez itself | 18:52 | ||
stevied | I looked at fez already. didn't see any commands for that | ||
gfldex | upload creates a distribution tarball and uploads | ||
stevied | there is `fez upload` but that uploads it according to help | 18:53 | |
Nemokosch | I'm not sure there is an official interface for just generating a tarball | ||
stevied | when I run that it just says it was uploaded. no tarball anywhere. | ||
Nemokosch | having said that, quite sure it's just a banal tar czf kind of call | ||
gfldex | did you `fez register`? | 18:54 | |
stevied | yeah | 18:55 | |
that all works | |||
maybe there's a way to configure dist.ini to tell mi6 not to check for changes | 18:57 | ||
Nemokosch | > my $proc = mi6run "tar", "czf", "$name.tar.gz", $name, :!out, :err, :%env; | 18:59 | |
really, that's all it does | 19:00 | ||
stevied | huh | 19:01 | |
does it tarball the lib directory? | 19:02 | ||
Nemokosch | it collects the files with git ls-files | 19:04 | |
github.com/skaji/mi6/blob/965ecfee...rakumod#L6 | 19:05 | ||
stevied | ok, so `tar czf Directory.tar.gz $(git ls-files) ` | ||
looks like it worked | |||
Nemokosch | oh right, I think you need to make a common root folder for those files | 19:06 | |
that's what the $name was for, that consisted of the distribution name plus the version | |||
stevied | ok, so I'm getting somewhere now: github.com/skaji/mi6/issues/166#is...1399303322 | 19:09 | |
lemme google that error | |||
Nemokosch | Masukomi seems to be right | 19:10 | |
stevied | about what? | 19:11 | |
superuser.com/questions/61185/why-...ll-on-os-x | 19:12 | ||
Nemokosch | github.com/tony-o/raku-fez/pull/74 | 19:13 | |
found this and actually provided a solution as well | 19:14 | ||
stevied | yeah, getting close | 19:16 | |
that solved that problem, but still getting these fucked up warnings: pax: `Unrecognized header keyword: LIBARCHIVE.xattr.com.apple.provenance` | |||
this is nuts | |||
Nemokosch | okay but that at least wouldn't keep your distro from being uploaded 😛 | 19:17 | |
stevied | you don't think? | ||
Nemokosch | I don't | ||
stevied | I wonder why my other mac not throw those errors | ||
Nemokosch | those go to stderr so it might be fine with them still | 19:18 | |
stevied | ok | ||
the other question is, why did downgrading to 2022.07 fix the issue? | 19:19 | ||
Nemokosch | that's a painfully accurate question | ||
stevied | something must have changed in the way mi6 generates those tarballs | 19:20 | |
or would it be fez? | |||
Nemokosch | could it not be because the 2022.07 version you had was simply cleaner in some way? | ||
stevied | i'm gonna switch back to 12 version and try uploading with fez. I think it might not work | 19:21 | |
ok, fez is just hanging. | 19:22 | ||
and it works just fine in 07 | 19:23 | ||
huh | |||
so it's gotta be fez | |||
and the way it generates the tarball | |||
Nemokosch | idk, in the case of mi6, it's mi6 that generates the tarball | ||
using this logic that it copies all the git ls-files to a common folder and tars it | 19:24 | ||
then fez extracts it with pax | |||
stevied | i got version 39 of fez on 12 and 07. huh | ||
wtf? | |||
Nemokosch | and fez finds multiple "root folders" | ||
thanks to these apple dubleur stuff | 19:25 | ||
xd | |||
stevied | this is bizarre, man | ||
Nemokosch | tbh it would be MUCH easier to understand if it consistently did NOT work | ||
stevied | could it be one of fez's dependencies? | ||
maybe there are two bugs happening | 19:26 | ||
Nemokosch | my last bet is really that the way mi6 copies the files | ||
something might have changed with file handling | |||
stevied | one with mi6 and one with fez | 19:27 | |
Nemokosch | and the copying itself might have changed | ||
stevied | ooh, I think I remember something in the 12 release notes. lemme look | ||
hmm, I see this: `Fix module installation writing precomp files into the wrong precomp store [cc7193d0]` | 19:29 | ||
what repo would I find that change in? | 19:32 | ||
good find at github.com/tony-o/raku-fez/pull/74 | 19:33 | ||
just getting around to clicking on it now | 19:34 | ||
i'll post this to my question on SO | |||
alright, well, mystery mostly solved. I can move on to other frustrating things with a clearer head now. Thanks for your help <@297037173541175296> | 19:49 | ||
anyone got any clues on how to fix this CI error on github? github.com/sdondley/Directory/acti...6816107067 | 19:56 | ||
p6steve | maybe need sigpipe first? | 20:02 | |
20:04
discord-raku-bot left,
discord-raku-bot joined
20:09
discord-raku-bot left,
discord-raku-bot joined
|
|||
stevied | Don’t know what that is but managed to get working for now. | 21:26 | |
github.com/Raku/tap-harness6/issue...1399328037 | 21:27 | ||
Nemokosch | yeah yeah, not the first occasion actually, that you add --verbose and the problem goes away mysteriously | 21:30 | |
I suspect there is something non-deterministic or downright broken in zef 🤔 | |||
22:08
rf joined
22:39
rf left
22:40
rf joined
23:07
rf left,
rf joined
23:16
discord-raku-bot left,
discord-raku-bot joined
|