🦋 Welcome to the MAIN() IRC channel of the Raku Programming Language (raku.org). Log available at irclogs.raku.org/raku/live.html . If you're a beginner, you can also check out the #raku-beginner channel! Set by lizmat on 6 September 2022. |
|||
00:00
reportable6 left
00:01
reportable6 joined
|
|||
pingu | sprintf is multi sub sprintf(Cool:D $format, *@args) but how do I view the function block of sprintf ? | 00:11 | |
Nemokosch | by consulting the source of Rakudo | 00:12 | |
rf | pingu: github.com/rakudo/rakudo/blob/430d...r.pm6#L849 | 00:13 | |
pingu | cant I do it from my IDE | ||
rf | You might be able to from Comma | ||
pingu | cool im in comma | ||
rf | Ctrl + click the function | ||
or Command + click if on MAc | 00:14 | ||
pingu | 'my $line = sprintf($format, 1, 2, 3);' | 00:16 | |
rf | What does your format look like | 00:18 | |
m: sprintf('%d, %d, %d', 1, 2, 3).say; | 00:19 | ||
camelia | 1, 2, 3 | ||
00:24
deoac joined
|
|||
pingu | all it says is 'my $line = sprintf($format, 1, 2, 3);' | 00:26 | |
wait | |||
it says no usages found basically | |||
it wont let me copy and paste the message, its a tooltip | |||
rf | Yeah, then you'll just have to look up the sources in rakudo | 00:30 | |
pingu | holy crap thats a lot of code for one function (in the github) | 00:31 | |
C stdlib is like that too | 00:32 | ||
maybe I should just use sprintf rather than making my own function | |||
rf | That file is the file for all formatting | ||
pingu | I dont quite understand | 00:33 | |
rf | It's not really idiomatic Raku to use sprintf, I think its more common to just use interpolation | ||
m: my $a = 'world'; say "Hello $a"; | |||
camelia | Hello world | ||
Nemokosch | for what it's worth, Formatter is 6.e only and hence it's in a preview stage | 00:34 | |
github.com/rakudo/rakudo/blob/2022...l.pm6#L536 | |||
here's an implementation in 6.c | |||
rf | Was unaware of that, thanks Nemo | ||
pingu | well originally I did this but it wouldnt work: pastebin.com/pPaA0HL5 | ||
00:35
jpn joined
|
|||
rf | Seems you were trying to do printf | 00:35 | |
pingu | so I sort of was using interpolation | ||
[Coke] | (irssi) I hate irc but also use irssi for raku related chat. | ||
pingu | I used to use termux and irssi | 00:36 | |
on android | |||
rf | Does this proto actually do anything: proto sub sprintf($, |) {*} | 00:38 | |
Never really saw the need for protos outside of iheritance | |||
Nemokosch | protos are for holding the multi dispatch together in a single entry point | 00:39 | |
rf | I see | ||
Nemokosch | this one is declaring some big dummy signature and {*} (which is a special symbol) says "just execute the winning candidate bruh" | ||
00:39
jpn left
|
|||
rf | m: proto sub abc($a, *@bc) { say $a; samewith($a, |@bc); }; multi sub abc($a, *@bc) { say @bc.raku; }; abc(1,2,3,4,5); | 00:41 | |
Did I break it | |||
camelia | (timeout)1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1… |
||
rf | Oops | 00:42 | |
I thought samewith would hit the non proto | |||
pingu | ill see if I can do what I want without sprintf then | 01:00 | |
I assume sprintf is just merging the format string with the paramaters and then returning it as a string | 01:01 | ||
"%f %f %f", 1.1, 2.2, 3.3); return $RetStr; # "1.1 2.2 3.3" | 01:02 | ||
like that | |||
01:03
xinming left
01:04
xinming left
01:06
xinming joined,
snonux_ left,
snonux left
01:08
cfa left
01:16
Xliff left
01:24
pingu left,
pingu joined
|
|||
pingu | help sub foo(*@s){@s = "%s"; return @s;} | 01:34 | |
my $str = "hello"; say(foo($str)); | |||
it prints [%s] | 01:35 | ||
01:35
ispyhumanfly joined
01:37
NemokoschKiwi joined
|
|||
pingu | my function does more than printf /sprinf | 01:38 | |
sprintf* | |||
just not yet | |||
01:39
NemokoschKiwi left
01:40
ispyhumanfly left
01:44
AlexDaniel joined
02:23
jpn joined
02:27
jpn left
02:30
ispyhumanfly joined
02:46
ispyhumanfly left
02:48
ispyhumanfly joined
02:58
razetime joined
03:09
deoac left
03:27
AlexDaniel left
03:50
epony left
04:37
Guest94 left
04:47
pingu left
04:51
epony joined
|
|||
tonyo | m: proto sub abc($a, *@bc) { * }; multi sub abc($a, *@bc) { $a.say; try samewith(|@bc); }; abc(1,2,3,4,5,6); | 05:46 | |
camelia | 1 2 3 4 5 6 |
||
05:51
evalable6 left,
linkable6 left
05:52
linkable6 joined
05:54
evalable6 joined
06:00
reportable6 left
06:01
reportable6 joined
07:01
benchable6 left,
sourceable6 left,
nativecallable6 left,
quotable6 left,
unicodable6 left,
bloatable6 left,
reportable6 left,
greppable6 left,
coverable6 left,
tellable6 left,
shareable6 left,
notable6 left,
bisectable6 left,
releasable6 left,
evalable6 left,
committable6 left,
notable6 joined
07:02
shareable6 joined,
evalable6 joined,
committable6 joined,
coverable6 joined,
unicodable6 joined,
nativecallable6 joined,
bisectable6 joined
07:03
reportable6 joined,
tellable6 joined,
benchable6 joined,
bloatable6 joined,
greppable6 joined
07:04
quotable6 joined,
releasable6 joined,
sourceable6 joined
|
|||
nine | proto sub sprintf($, |) {*} actually does something: it declares that _all_ multi candidates will require at least one positional argument | 07:30 | |
Also in the setting (i.e. Rakudo core) protos do not get auto-generated, so you will find protos for all multis there. | |||
07:37
abraxxa joined
07:46
abraxxa left
07:47
abraxxa joined
08:10
Sgeo left
08:23
Geth left,
Geth joined
|
|||
tonyo | was pulling my hair out trying to find ARGS-TO-CAPTURE in setting a coupla days ago | 08:24 | |
08:25
razetime left
|
|||
:(**@rest, *%rest) | m: printf '%(x)s, %(y)s', x => 2, y => 1; | 08:35 | |
Raku eval | Exit code: 1 Directive (x)s, %(y)s is not valid in sprintf format '%(x)s, %(y)s' in block <unit> at main.raku line 1 | ||
:(**@rest, *%rest) | bruh | 08:36 | |
m: printf '%s %s %s', 1, 2, [3, 4, 5] | 08:42 | ||
Raku eval | Exit code: 1 Your printf-style directives specify 3 arguments, but 5 arguments were supplied to format '%s %s %s'. in block <unit> at main.raku line 1 | ||
:(**@rest, *%rest) | * doing its flattening shenanigans 😔 | 08:43 | |
m: printf '%s %s %s', 1, 2, $[3, 4, 5] | |||
Raku eval | 1 2 3 4 5 | ||
08:43
razetime joined
08:49
stevied_test left
08:50
stevied_test joined
09:02
snonux joined
09:03
snonux_ joined,
Manifest0 joined
09:25
jpn joined
09:34
ab5tract joined
|
|||
nine | m: use MONKEY-SEE-NO-EVAL; EVAL Q[my Int:D(Cool) $i = "1"].AST | 09:46 | |
camelia | Type check failed in assignment to $i; expected Int:D but got Str ("1") in block <unit> at <tmp> line 1 |
||
09:49
sena_kun joined
10:07
archenoth joined,
Oshawott left
10:19
snonux left
10:20
snonux_ left
|
|||
Nemokosch | Cool, the author of SpitSH showed up | 10:37 | |
10:37
razetime left
|
|||
And one cannot miss that Alexey Melezhik shows up to grant a helping hand with CI and compilation every time something starts coming alive | 10:38 | ||
10:55
abraxxa left,
abraxxa joined
11:41
abraxxa left
11:51
raschip joined
11:52
oodani left
11:53
oodani joined
12:00
reportable6 left
12:01
reportable6 joined
12:09
kjp left
12:10
kjp joined
13:10
evalable6 left
13:13
evalable6 joined
13:41
derpydoo joined
|
|||
[Coke] | didn't see this mentioned, but protos can also, if I recall correctly, have code that isn't just {*} if there is universal setup/teardown code. | 14:09 | |
14:17
derpydoo left
|
|||
Nemokosch | yes yes | 14:19 | |
{*} itself isn't even a function body, it's a placeholder that can appear inside a function body as well | |||
14:27
lichtkind joined
|
|||
rf | Is there an example of universal teardown somewhere? That sounds useful. | 14:27 | |
moritz | END { } blocks are run at the end of a program, is that what you're looking for? | 14:36 | |
El_Che | "This is not the block you're looking for" vibe | 14:37 | |
rf | moritz: Sorry I meant for proto subs | 14:44 | |
nine | rf: yes the proto can in fact wrap the multi candidates. proto foo(|) { say "before the multi"; {*} say "after the multi" } | 14:49 | |
{*} must appear like that with no spaces or anything | |||
I actually learned this when implementing support for this in RakuAST ) | |||
rf | Very neat, thanks! | 14:50 | |
SO whatever will be translated to the block contents of the non proto? | |||
[Coke] | that's not strcitly a whatever, I think, though it looks like one. | 14:54 | |
rf | Hmm, so {*} != * | 14:56 | |
Nemokosch | ha, I know it! | 14:57 | |
[Coke] | m: dd *.^name | 15:00 | |
camelia | WhateverCode.new | ||
[Coke] | m: dd {*}.^name | 15:01 | |
camelia | ===SORRY!=== Error while compiling <tmp> {*} may only appear in proto at <tmp>:1 ------> dd {*}⏏.^name expecting any of: argument list horizontal whitespace term |
||
15:01
eseyman left
15:16
eseyman joined
15:32
david_ joined
15:34
TieUpYourCamel left
15:35
Sgeo joined
15:39
pingu joined
|
|||
pingu | difference between pop and splice? | 15:39 | |
they seem the same | |||
15:40
cfa joined
|
|||
[Coke] | pop is very specific, splice is very generic. | 15:40 | |
you can do any of the array manipulation work with splice depending on args passed | 15:41 | ||
pingu | does splice return the items that are removed | ||
[Coke] | m: my @a=<a b c>; dd @a.pop; | ||
camelia | "c" | ||
[Coke] | m: my @a=<a b c>; dd @a.splice(0,2,<d>); dd @a; | 15:42 | |
camelia | Array @a = ["a", "b"] Array @a = ["d", "c"] |
||
pingu | cant you just do pop with a range | 15:43 | |
[Coke] | ^^ yes, it returns the removed ones. Docs cover this as well. | ||
no. pop doesn't take args. | |||
m: my @a = <a b c>; dd @a.tail(2); dd @a; | 15:44 | ||
camelia | ("b", "c").Seq Array @a = ["a", "b", "c"] |
||
[Coke] | tail lets you specify a count, but doesn't do the pop. | ||
pingu | m: my@format = <a b c>; @format[0..1] = pop(); | 15:46 | |
camelia | ===SORRY!=== Error while compiling <tmp> Calling pop() will never work with signature of the proto ($, *%) at <tmp>:1 ------> my@format = <a b c>; @format[0..1] = ⏏pop(); |
||
pingu | m: my @format = <a b c>; my @b = splice(@a[0..1]); | 15:47 | |
camelia | ===SORRY!=== Error while compiling <tmp> Variable '@a' is not declared. Perhaps you forgot a 'sub' if this was intended to be part of a signature? at <tmp>:1 ------> my @format = <a b c>; my @b = splice(⏏@a[0..1]); |
||
cfa | it sounds like you want this: | ||
m: my @a = <a b c d e>; my @removed = @a.splice(2, 2); say @a; say @removed; | |||
camelia | [a b e] [c d] |
||
pingu | ok yeah thx | ||
cfa | (remove 2 elements starting at index 2) | ||
pingu | is there a way to delete everything in the array in one go | 15:48 | |
maybe @a = (Empty); | 15:49 | ||
I still want 14 elements but they should all be set to Nil | |||
otherwise my loop () would be out of range | 15:50 | ||
15:50
AlexDaniel joined
|
|||
pingu | if two tokens get misaligned I made a condition to just wipe the array and do the loop again | 15:51 | |
Nemokosch | so do you mean the length should be preserved or not? | 15:52 | |
pingu | yeah | 15:54 | |
preserve the length | |||
hmm this dont work if (@format[0..1] == $spec[3..12] || @format[0..1] == $spec[13]) | |||
pastebin.com/uu6B1tAL | 15:55 | ||
Geth | ¦ doc: coke self-assigned Some targets in the Makefile do not work any more github.com/Raku/doc/issues/3035 | ||
pingu | im a bit mad that I had to do $1.0f too rather than just letting the presion be inherited by the data itself | 15:56 | |
$line will eventually contain tokens with decimal places | |||
so yeah padded 0 's on the left or right should all be treat as just being printed as an int | 15:59 | ||
because they dont change the value, non zeros however would change the value and therefore matter | |||
ah wait it should be line not spec but the problem will still exist | 16:03 | ||
i think it doesnt like the ranges | |||
being used in that way | |||
actually idk what im doing anymore | 16:05 | ||
because that is comparing the integers and they might be the same anyhow | |||
lets say I had 2 lines with slightly different data | 16:06 | ||
they would now therefore be treat as misalighned | |||
Geth | doc/main: da0dd763ae | (Will Coleda)++ | Makefile Remove any build related targets Part of #3035 |
16:07 | |
Nemokosch | me neither, good sir | 16:08 | |
pingu | I guess it isnt comparing 2 lines, its comparing a constant string called line to an array, as long as I dont compare $line1 and $line2 or @format1 with @format2 it should be fine | 16:09 | |
cfa | [Coke]: with those removed, github.com/Raku/doc#building-the-h...umentation is very out of date | 16:10 | |
presumably mention of building with `documentable start -a -v --highlight`, updating with `documentable update --highlight` is still worthwhile | |||
pingu | so I might as well just do: if(@Format ne $spec) { @format = (Empty); } | 16:11 | |
cfa | (or is the changeover to the new site imminent?) | ||
pingu | err @format ne $line | ||
Nemokosch | I don't know what imminent means | 16:12 | |
but if that's what you mean: the next time we'll be deploying, it will be the new site | |||
cfa | neat | ||
Nemokosch | and documentable basically enters the legacy state; not much needed for that because it's essentially broken already from what I know | ||
cfa | i guess i'll have to look into how to build the new doc site locally | 16:13 | |
Nemokosch | it's really simple tbh | ||
cfa | which repo is it? | ||
El_Che | (impending, Latin in- (towards) and minere (project)) | ||
Nemokosch | doc-website | ||
cfa | thanks | ||
El_Che | (there all my years of Latin finally useful after a few decades!) | 16:14 | |
Nemokosch | you clone the repo, make sure cro is installed in a way that suits you, and run bin_files/build_site | ||
El_Che: I learned Latin for 5 years myself but it wouldn't help for the life of me | |||
it has always been more a fun grammar exercize | |||
El_Che | Nemokosh: no regrets, here. It has been as useful as mathematics beyond what a calculator can do :) | 16:15 | |
cfa | attempting a build now, though cro might be an issue | ||
cfa understands why [Coke] was trying to build Archive::Libarchive::Raw now | 16:18 | ||
El_Che | Is there something raku related on FOSDEM this weekend? | 16:19 | |
Nemokosch | why, indeed? | 16:22 | |
Brian Duggan will talk about Termie, that's for sure | |||
El_Che | Nemokosch, I am considering dropping by :) | 16:23 | |
16:23
melezhik joined
|
|||
melezhik | 0/ | 16:24 | |
tellable6 | 2023-02-02T16:25:49Z #raku <rf> melezhik Can you try compiling with a newer version of GCC preferably 12+ | ||
2023-02-02T19:48:29Z #raku <rf> melezhik I figured it out. Very small bug causing all of the failures I pushed a new version of Distribution::Builder::Cmake 0.0.6 which solves this. | |||
Nemokosch | well FOSDEM is cheap... | 16:25 | |
pingu | sorted pastebin.com/cnFHcJGu | ||
melezhik | I advertise SparrowCI on Reddit devops channel once a month - www.reddit.com/r/devops/comments/1...t/j72fmv4/ please upvote or comment if you want , thanks )) | ||
pingu | idk why it cant just do if (@format ne $line) { } but oh well | ||
melezhik | rf: good to see distribution builder cmake bug is fuxedc | 16:26 | |
fixed | |||
Nemokosch | ngl this is not only for the Raku conference but I think it really feels that we have very different senses for prices | ||
pingu | probably because they are not just single strings | ||
they are lists or sequences of strings | |||
in C theres less stuff like scalar array list sequence hash bag mix graph set etc | 16:28 | ||
you just use const array for a list and array for a set | |||
err array for an array | 16:29 | ||
if you want a set you have to make code that checks for duplicates, C supports the range operator now but before that you had to write code for that too | |||
16:30
melezhik left
|
|||
pingu | hashes would probably be enums or arrays + pointers | 16:30 | |
mixes would be structs or arrays with typecasts | |||
I assume a mix is a homogenous type array | 16:31 | ||
Nemokosch | > idk why it cant just do if (@format ne $line) { } but oh well what would that do in your opinion? | ||
pingu | I was thinking they were both just one string but I was wrong | 16:32 | |
it would probably default to @format[0] and $line[0] | |||
if you removed the [0]['s | |||
16:33
melezhik joined
|
|||
pingu | so since its a list of strings I just did @format[$token] ne $line[$token] instead | 16:33 | |
btw is @_ special or is it just the same as making another reference | 16:34 | ||
or $_ | |||
i think thats for perl 5 backwards compat right | |||
16:36
melezhik left
|
|||
Nemokosch | $_ is "special", @_ not really | 16:37 | |
pingu | how so | ||
other than the fact that you dont need to declare it | |||
cfa | pingu: docs.raku.org/language/functions#i...-entry-@__ | 16:41 | |
Nemokosch | well $_ is set by many operations | 16:42 | |
and like @_, it can also stand for an auto-argument in a block/sub | |||
bartolin | Oh, that sadness when reading that Kaiepi has passed away. I'll miss him. | 16:47 | |
Nemokosch | also a prolific contributor to the JVM backend... | 16:51 | |
bartolin | yeah. I have a couple of old emails and open tabs with stuff that I wanted to discuss with him. Most related to BSD support or the JVM backend. He did many great things there (and elsewhere). | 16:57 | |
[Coke] | cfa - it's been out of date for some time, yes. Will update it. | 17:02 | |
cfa | thanks | 17:03 | |
pingu | so, how do I make the if into a function now pastebin.com/5KYLQm6w | 17:05 | |
I think I need @* and -> but dont know about how to use those yet | 17:06 | ||
Geth | doc/main: 87a0222246 | Coke++ | README.md Remove site build instructions |
17:08 | |
[Coke] | cfa: fixed. | ||
cfa: there is also #raku-docs if you want to join us there! | 17:09 | ||
cfa: we are moving towards getting raku/doc-website deployed in production, so any old build in the original raku/doc site is now obsolete. No one has run those commands to update the live site in months. | 17:10 | ||
Geth | doc/main: 8a4d2ab0e8 | Coke++ | README.md Remove reference to github.io site. The new raku/doc-website will be updated more frequently and has a different infrastructure setup. |
17:12 | |
doc/main: 8553df17eb | Coke++ | README.md Remove reference to jj's docker container. New container setup being done through raku/doc-website |
17:15 | ||
cfa | [Coke]: joined :) | 17:17 | |
oh, didn't realise the site was so stale | |||
i'm very out of the loop | 17:18 | ||
17:18
razetime joined
17:19
razetime left
|
|||
[Coke] | Current status: there's a new site; build and deployment steps will be different, we have the DevOps folks working on setting up CI for documentation updates; formal separate of web site (raku/doc-website) and docs (raku/doc) going forward; new site not live yet, but there's no point in keeping the old build info going in raku/doc | 17:21 | |
cfa | understood | 17:22 | |
18:00
reportable6 left,
evalable6 left
18:01
evalable6 joined
18:03
reportable6 joined
18:15
AlexDaniel left
18:16
AlexDaniel left
|
|||
pingu | yay pastebin.com/A5NbZzsJ | 18:22 | |
I was thinking lists are immutable so I used an array instead | 18:24 | ||
but it didnt like that so I made @tokens $tokens now it works | |||
I wonder if it will catch if I make $token and $line different | 18:25 | ||
it does not hmm | 18:27 | ||
18:35
snonux joined
18:36
snonux_ joined
18:45
jpn left
18:46
jpn joined
18:47
Abhoerschutz left
18:48
Kernspin left
|
|||
[Coke] | seen on the internet, any reason not to add Complex.sign? | 19:07 | |
www.reddit.com/r/rakulang/comments...x_numbers/ | |||
... (though if Complex.abs is defined as distance, how would sign ever be -1?) | 19:09 | ||
pingu | /j #c | 19:11 | |
cfa | hrm, i'm hitting 'raku is loading libcrypto in an unsafe way', i.e. github.com/jnthn/p6-io-socket-asyn.../issues/69 | 19:14 | |
[Coke] | (oh, because Complex.sign returns a Complex, not like Real.sign...) | 19:19 | |
cfa rebuilds OpenSSL, links to MacPorts' libraries | 19:22 | ||
now to retry bin_files/build-site | 19:23 | ||
oops, i linked to the wrong github issue but n/m | 19:24 | ||
pingu | ok this is what I need but as raku: if(value == (int)value) { fmt = PREFIX "%d" } else { fmt = PREFIX "%3.3f" }; snprintf(dest, SPACE, fmt, ..., value); | 19:25 | |
[Coke] tries a build adding Complex.sign to v6.e ... | 19:27 | ||
cfa | pingu: are you just trying to specify different format paramters depending on type? | 19:28 | |
pingu | sort of yes | ||
ldraw wouldnt mind if I read 1 but printed it to a new file as 1.0 | 19:29 | ||
but then if the tokens get misaligned , my function to check for the token misalignment is circumvented | |||
because hey you can just treat all tokens as either int or float which ldraw doesnt like | 19:30 | ||
tokens 0 and 1 must be int, 3 to 13 can be int or float | |||
pastebin.com/1aWtiS0Z | 19:34 | ||
[Coke] | if I add Complex to src/6.e, augment it, add a sign method, use v6.e.PREVIEW, it still complains about trying to convert to a Real (which the Cool helper does). am I missing something in the 6.e setup to make it available or just the existence of the file enough? | 19:35 | |
cfa | m: say +$_ ~~ Int ?? "%d" !! "%3.3f" for <-1.5 -1 0 1 1.5> | ||
camelia | %3.3f %d %d %d %3.3f |
||
cfa | pingu: ^ | ||
so for example: | 19:36 | ||
m: my $x = '1.5'; $x.fmt(+$x ~~ Int ?? "%d" !! "%3.3f") | |||
camelia | ( no output ) | ||
cfa | m: my $x = '1.5'; $x.fmt(+$x ~~ Int ?? "%d" !! "%3.3f").say | ||
camelia | 1.500 | ||
cfa | vs. | ||
[Coke] | ah, core_sources. | ||
cfa | m: my $x = '1'; $x.fmt(+$x ~~ Int ?? "%d" !! "%3.3f").say | ||
camelia | 1 | ||
cfa | there are other ways ofc | ||
pingu | thx ill try it | ||
cfa | here we just cast the string to a numeric; if we get an integer, use "%d", otherwise "%3.3f" | 19:37 | |
(if you pass in a non-numeric string this will fail) | |||
pingu | cool | 19:38 | |
cfa | you had SPACE in your example; you could just prepend that to your format string | 19:40 | |
pingu | but what about the string on the end | 19:41 | |
3024.dat | |||
[Coke] can't remember the last time he submitted code for rakudo and not some admin/docs stuff. | |||
pingu | and yes I'd like to put it inside of sprintf | ||
[Coke] | github.com/rakudo/rakudo/pull/5181 | 19:42 | |
cfa | [Coke]: nice one | ||
pingu: you didn't mention that -- what're you trying to do? | |||
output 1.5.dat ? | |||
er, 1.500.dat | 19:43 | ||
pingu | I made everything in line a string before but i got an error saying I cant modify it | ||
i only got that error if I made 1 0 0 into 1.1 0 0 | |||
cfa | sorry, i'm not following | ||
pingu | 1.0 0 0 would work and print 1 0 0 weirdly | ||
in my pastebin | 19:44 | ||
and before that I made format an array but I got: positional passed instead of "str" or something | 19:45 | ||
cfa | i don't have time to look at the paste right now but it might help if you just restate what you're trying to achieve and exactly where you're getting stuck | 19:46 | |
i'll try and check back later | |||
pingu | so, I want to tokenize this file format: www.ldraw.org/article/218.html | ||
19:48
Guest2085 joined
|
|||
Nemokosch | I hit pheix up and actually turned kind of optimistic regarding "port to Raku" kind of projects | 19:55 | |
pingu | my $x = '1.0'; $x.fmt(+$x ~~ Int ?? "%d" !! "%1.1f").say would either lose precision, or it would add too many trailing 0 's | ||
unless you got lucky and it matched the precision of the input | |||
by add too many zeros I mean just setting it to something big enough for everything like 8.8f | |||
Nemokosch | so... some of you may know the modules.raku.org site has been in a kind of abandoned state for a long time, partially because it's a Mojolicious web app and members don't really have interest in maintaining an old site written in Perl | 19:56 | |
19:57
snonux left,
snonux_ is now known as snonux
|
|||
I don't want to give up on it, however I know virtually no Perl, so the rework plan is destined to always fall behind other, more approachable Raku tasks | 19:57 | ||
19:58
rantanplan joined
|
|||
my question is, are there people around with good enough Perl knowledge who would be willing to help out with this? | 19:59 | ||
pingu | isnt lizmat the per5 to raku expert | ||
perl* | |||
Nemokosch | either she is or she isn't, I don't know these days, but frankly lizmat is overburdened with actually more important tasks | ||
pingu | oh | 20:00 | |
yeah I would probably imagine so | |||
Nemokosch | while in current days a modern and approachable modules.raku.org feels more like a "nice to have" than a crippling necessity, we can get along with raku.land and only sometimes checking the module site as it is now | 20:01 | |
my particular hope would be, is that we have some momentum with web stuff again, we don't need to immediately reach out to Cro stuff, the choices are more granular | 20:02 | ||
jdv | wow it got cold out fast | ||
Nemokosch | pheix also made a router and worked on templating solutions, rf also made a remarkable intro with Humming-Bird | ||
jdv | [Coke]: how is it up there? | 20:03 | |
Nemokosch | perhaps I could also mention jjatria but it feels weird because of his involvement in raku.land itself | 20:04 | |
jdv | Nemokosch: i think your "push to map" may be the biggest release blocker but i havent confirmed it yet | ||
tellable6 | jdv, I'll pass your message to Nemokosch | ||
Nemokosch | could you please elaborate? | 20:05 | |
jdv | i cant at the moment. the ladt blin run had many failures pointing at that change. | ||
probably monday i can show you | |||
Nemokosch | it would be good to know what blin does | 20:07 | |
you know, that particular change is, for all intents and purposes, a regression fix | 20:08 | ||
the regression happens to be fairly old, early 2016 | |||
jdv | its on github:) | ||
Nemokosch | what do "failures" mean, though | ||
jdv | doesnt mean a bunch of ecosystem depends on something related... | ||
the tests failed | 20:09 | ||
Nemokosch | well, what tests? | ||
jdv | the respective dist | 20:10 | |
blin isnt too fancy. it just tries to smoke the eco. | |||
iirc, im out and about at the moment, the common snippet is something about "cant find push to map in map" | 20:12 | ||
Nemokosch | anyway, once there are published results, I'll definitely take a look | ||
jdv | thanks | ||
Nemokosch | "cant find push to map in map" - hmm, this one kind of makes you think. I wouldn't know by heart on what type this dispatching was introduced but iirc it was on Hash only | 20:13 | |
jdv | i know:) | 20:14 | |
Nemokosch | yep, hash only | ||
what is not clear is 1. why would it be needed for non-Hashes, including a plain Map 2. if it is needed for some legitimate reason, why did the tests and spectests all pass | 20:15 | ||
so yeah for that it would be probably good to see the dists in question | |||
it could always happen (unfortunately) that there was a blind spot in the tests | 20:16 | ||
jdv | thats why blin exists, basically;) | 20:17 | |
i normally curate the results but i xant til monday. i can share the raw results sooner though if desired. | 20:18 | ||
Nemokosch | back in the days when this corner case I was trying to fix was still working, Map and Hash weren't separated into two files, this behavior was all defined on Maps | ||
jdv | just want to avoid goose chases and such | 20:20 | |
Nemokosch | tbh I might take another look at the code right now, I can really imagine that a call tries to redispatch after some looser check, so for example making sure the argument is a Map, and then calling this method; even though it really should only be called on Hashes (or should be defined for Maps) | 20:21 | |
no guarantee I will find anything but it made me curious honestly | 20:22 | ||
like looking at something like (nqp::istype($x,Map) && nqp::not_i(nqp::iscont($x))), $x.PUSH_FROM_MAP($temp), | 20:25 | ||
suspicious that this won't be enough, not if PUSH_FROM_MAP is defined on a Hash | |||
jdv | ill post the raw results (take with grains of salt) in a bit | 20:26 | |
Nemokosch | tbh no need, I could reproduce the failure in a simple snippet | 20:28 | |
my %sad is Map = :foo; (%sad,).hash # No such method 'PUSH_FROM_MAP' for invocant of type 'Map' | |||
jdv | looks familiar | 20:29 | |
sorry and thanks | |||
Nemokosch | Probably everything breaks where a list of Maps is assigned, or forced into hash context... | 20:30 | |
you know what is the absolute irony? | 20:35 | ||
Map.STORE probably did the right thing to store "object hashes", only Hash.STORE didn't... | 20:36 | ||
jdv | complex things be surprising? | ||
Nemokosch | and now it turned backwards xD | 20:37 | |
Hash can store Hashes well, but not Maps... | |||
jdv | no rush btw. the next release attempt will be 2/17. | 20:43 | |
in case anyone missed it todays release is not happening:) | 20:44 | ||
Nemokosch | Still, I think for now it might be better to fix it rather simple (e.g add a candidate onto Map that just redirects to STORE_MAP there), and later on I'd rather make a bigger redesign so that the logic is not duplicated all around | 20:46 | |
then it can be more thoroughly planned, benchmarked, whatever goes | |||
20:48
Guest2085 left
|
|||
jdv | im but the lowly release janitor:) that sort of duscussion is probably better had with betters like liz or nine or vurg, etc... | 20:48 | |
Nemokosch | sorry, it's partially also just thinking out loud 😛 | ||
jdv | im just the messenger of sorts | ||
ha | 20:49 | ||
Nemokosch | - e.g I'd rather get rid of handwritten nqp:: typechecks all dumped into sole methods, in favor of dispatching to methods doing one thing at a time. I don't know the costs of a method dispatch but I'd hope it's not tremendously more than the nqp check, like, say, 3 nqp ops instead of one, idk | ||
20:54
rantanplan left,
snonux left
21:00
raschip left
21:03
rantanplan joined
21:04
snonux joined
21:14
jpn left
21:19
jpn joined
21:24
jpn left
21:27
NemokoschKiwi joined
|
|||
jdv | Nemokosh: here's the unofficial results - gist.github.com/jdv/a3442f84ac7942...8712e8989b | 21:31 | |
uh, i think that's truncated. lovely. | |||
wow, even the gh wiki chops it | 21:36 | ||
Nemokosch | Cro ever installed without test errors??? Wow | 21:37 | |
21:40
snonux left,
rantanplan left
21:44
Guest2085 joined
|
|||
jdv | jdv.devuyst.com/blin_failures_202302.md is the whole file. render it as you wish. | 21:45 | |
you can paste it into gh gist or whatever... | 21:46 | ||
i gotta run. later. | |||
NemokoschKiwi | take care | 21:49 | |
lizmat | pingu Nemokosch not going to spend time on modules.raku.org | 21:56 | |
would rather see people work on raku.land getting missing features implemented | |||
Nemokosch | well I'm not against raku.land whatsoever but to be honest, I wouldn't be happy if it actually drained the people who could help resurrecting modules.raku.org so there's that | 21:57 | |
it's just not the same thing, both by design and position within the Raku macroverse | 21:58 | ||
21:58
jpn joined
21:59
ab5tract left
|
|||
pingu | omg this is so annoying | 21:59 | |
pastebin.com/BmXD2Uad | 22:00 | ||
Nemokosch | what's up this time, pingu? | ||
also, I expect the "resurrecting modules.raku.org" a one-time investment, this is an important point | 22:01 | ||
pingu | I just want to check if $toknum is 0 or 1 and that $tok is an integer | ||
Nemokosch | once it's a reasonable, accessible Raku project in its heart, it could have a position as any public Raku projects | ||
guifa | $foo %% 1 <-- integer check | ||
Nemokosch | or $foo.narrow ~~ Int | 22:02 | |
iirc | |||
frankly, part of the reason I'm hoping for people like pheix or rf to help out is because they have worked with/on non-Cro web projects in Raku, and this could give them a legitimate motive | 22:04 | ||
22:05
jpn left
|
|||
much more than "here is a Cro app, implement XYZ feature in it" | 22:05 | ||
pingu | thx | 22:09 | |
is elsif () {} the same as else { if () {} } | 22:11 | ||
i think so just wondering | |||
22:11
sena_kun left
|
|||
lizmat | yes | 22:12 | |
except that you don't need parens in Raku with the condition | |||
m: if 42 { say "the answer" } | |||
camelia | the answer | ||
pingu | yeah | 22:13 | |
guifa actually finds other languages harder to read nowadays because of those parentheses | 22:14 | ||
22:16
xinming left
|
|||
Nemokosch | I found myself using # comments in C code | 22:17 | |
newsflash: didn't work | |||
guifa | haha | ||
I had to write some JS today at work and it was painful | |||
Nemokosch | tbh I mostly like JS but not nearly as much as Raku | 22:18 | |
guifa | It was also painful because I was having to write it inside of Acrobat | ||
lol | |||
Nemokosch | I'd say JS does kinda feel like Raku, except many things Raku tries to solve the best are just unaddressed, "do whatever you want to achieve this" style | 22:19 | |
The only aspect where my heart cries out for the JS way that I can quickly think of is the concept of methods | 22:20 | ||
as in, they don't exist and I think that's really the clearest solution, by a mile | |||
regarding this I wish there had been a hacker around Perl 6 in 2005 whose favorite language had been JS 😂 | 22:22 | ||
22:23
jpn joined
22:32
NemokoschKiwi left
|
|||
pingu | k this is where im up to , lots of work to do pastebin.com/1DbZZLNd | 22:36 | |
brb | |||
even if this works the array of tokens are all strings anyhow until I can fix my problem where it isnt printing floats exactually how they are in the file / will print an int if the file is an int instead | 22:39 | ||
22:51
jpn left
23:00
ab5tract joined
|
|||
pingu | I clearly have a hell of a lot to learn | 23:11 | |
23:29
Guest2085 left
|
|||
pingu | wtf i do raku -I. parser.raku and it says that the function use ValidTokenChk is not declared but I did use use ValidTokenChk; | 23:39 | |
everything is spelled correctly case and file names + file extensions | |||
the code case is correct | 23:40 | ||
because ctrl+f finds them fine | |||
and so does query in cmd | |||
Nemokosch | where should ValidTokenChk come from? | 23:42 | |
pingu | in the same folder as parser.raku | 23:49 | |
from ValidTokenChk.rakumod | |||
Nemokosch | could you copy the exact error? | 23:51 | |
23:56
epony left
|
|||
pingu | ok | 23:59 | |
Error while compiling C:\Users\kris\Desktop\CommaProjects\test/parser.raku | |||
Undeclared name: ValidTokenChk used at lines 16, 17, 18, 19, 20, 21, 22 |