🦋 Welcome to Raku! raku.org/ | evalbot usage: 'p6: say 3;' or /msg camelia p6: ... | irclog: colabti.org/irclogger/irclogger_log/raku Set by ChanServ on 14 October 2019. |
|||
00:03
rindolf left
00:05
moon-child left
00:09
ensamvarg3 joined
|
|||
tony-o | .tell lizmat deathbyperl6.com/fez-zef-a-raku-ec...-and-auth/ | 00:22 | |
tellable6 | tony-o, I'll pass your message to lizmat | ||
00:26
mowcat left
00:46
moon-child joined
00:51
JRaspass left
01:26
pecastro left,
lucasb left
01:27
sno joined
02:11
guifa left
02:34
earnestly left
02:36
raku-bridge1 joined,
raku-bridge1 left,
raku-bridge1 joined
02:37
kvw_5 joined,
raku-bridge1 is now known as raku-bridge
02:38
MasterDuke left
|
|||
kawaii | Is there something other than '' I should be using at the end of my expression here to represent nothing? I tried Nil but it can't be used in a string context, or maybe I should just write this entirely differently? `my $description = (%member<name> || 'Unknown') ~ (%member<locale> ?? " :flag_{%member<locale>}:" !! '');` | 02:39 | |
02:40
kvw_5_ left
03:00
tejr left,
tejr joined
|
|||
kawaii | Also it seems that no matter what I try, I can't get Raku to `uniparse` any kind of flag, even when I construct them correctly with the regional indicator symbols, if your IRC client shows an EU flag in the paste preview (or browser) ignore it, it's lying >:( www.irccloud.com/pastebin/1wU6pxTT/ | 03:18 | |
flag emojis are constructed by two "Regional Indicator Symbol Letter" emotes, but Raku seems unaware they exist | 03:19 | ||
03:27
rindolf joined
|
|||
[Coke] | kawaii: works here | 03:56 | |
m: my $a = 'Regional Indicator Symbol Letter E'.uniparse ~ 'Regional Indicator Symbol Letter U'.uniparse; say $a; | |||
camelia | 🇪🇺 | ||
[Coke] | ^^ and there. | ||
what version of rakudo do you have? | |||
might pre-date the unicode update with flag info? | |||
kawaii | [Coke]: huh, I wonder if my shell was the issue all along? usercontent.irccloud-cdn.com/file/...-57-05.png | 03:57 | |
Odd, because this is Ubuntu from last year, and the flags were introduced in 2015 or so | 03:59 | ||
m: my %member = locale => 'EU'; my $flag = do for %member<locale>.split('',:skip-empty) { ('Regional Indicator Symbol Letter ' ~ $_).uniparse }; | 04:14 | ||
camelia | ( no output ) | ||
kawaii | 🤔 | ||
oh, no say, lol | |||
my %member = locale => 'EU'; my $flag = do for %member<locale>.split('',:skip-empty) { ('Regional Indicator Symbol Letter ' ~ $_).uniparse }; say $flag; | |||
evalable6 | (🇪 🇺) | ||
kawaii | m: my %member = locale => 'EU'; my $flag = do for %member<locale>.split('',:skip-empty) { ('Regional Indicator Symbol Letter ' ~ $_).uniparse.join }; say $flag; | 04:15 | |
camelia | (🇪 🇺) | ||
kawaii | my $flag = do for %member<locale>.split('',:skip-empty) { (('Regional Indicator Symbol Letter ' ~ $_).uniparse).join }; say $flag; | 04:16 | |
m: my $flag = do for %member<locale>.split('',:skip-empty) { (('Regional Indicator Symbol Letter ' ~ $_).uniparse).join }; say $flag; | |||
camelia | 5===SORRY!5=== Error while compiling <tmp> Variable '%member' is not declared at <tmp>:1 ------> 3my $flag = do for 7⏏5%member<locale>.split('',:skip-empty) { |
||
kawaii | my %member = locale => 'EU'; my $flag = do for %member<locale>.split('',:skip-empty) { (('Regional Indicator Symbol Letter ' ~ $_).uniparse).join }; say $flag; | 04:17 | |
evalable6 | (🇪 🇺) | ||
kawaii | That's probably highly unoptimal but I guess it works | ||
Ah wait no, $flag is actually a list | 04:18 | ||
I think I want `.values.join` here but doesn't seem to give me the string I'm looking for | 04:21 | ||
04:27
evalable6 left,
linkable6 left
04:30
evalable6 joined,
linkable6 joined
|
|||
[Coke] | m: my %member = locale => 'EU'; my $flag = %member<locale>.comb.map({uniparse("Regional Indicator Symbol Letter $_")}).join; say $flag; | 04:43 | |
camelia | 🇪🇺 | ||
[Coke] | not sure why you had the do/for there. | ||
kawaii | oh, that's way better, sorry I'm not very good with map yet, do for is my go-to way of looping in this way at the moment :( | 04:45 | |
04:46
ensamvarg3 left
|
|||
kawaii | [Coke]: thank you for your help this evening :) | 04:50 | |
[Coke] | ofc. | 05:02 | |
05:41
Black_Ribbon joined
05:44
brtastic joined
06:07
vike left
06:19
xelxebar left,
xelxebar joined
06:43
Altai-man joined
06:46
parabolize left
06:54
Altai-man left,
ensamvarg joined
06:56
wamba joined
06:57
jmerelo joined
|
|||
jmerelo | releasable6:status | 06:59 | |
releasable6 | jmerelo, Next release in ≈7 days and ≈12 hours. 1 blocker. Changelog for this release was not started yet | ||
tellable6 | 2021-01-15T18:11:15Z #raku <guifa> jmerelo are you just doing voiceover for your FOSDEM presentation or are you recording video of yourself talking as you’re giving it | ||
releasable6 | jmerelo, Details: gist.github.com/3cbea08f3084676c40...52b8a16da1 | ||
jmerelo | .tell guifa you have to record the voice. During the presentation, you can answer questions | ||
tellable6 | jmerelo, I'll pass your message to guifa | 07:00 | |
07:04
defaultxr left
07:07
defaultxr joined
07:10
Garbanzo left
07:54
aluaces joined
07:58
sno left
07:59
wamba left
08:08
sno joined
08:16
notandinus left,
notandinus joined
08:31
sjm_uk joined
08:45
vike joined
09:38
domidumont joined
09:42
JRaspass joined
10:10
jmerelo left
10:38
domidumont left
10:57
Black_Ribbon left
11:02
Sgeo left
11:06
earnestly joined
|
|||
notandinus | what is the "loop marker"c called? | 11:07 | |
m: marker: for 1..2 {.say} | 11:08 | ||
camelia | 1 2 |
||
notandinus | ^ "marker:" <-- is there a name for this? | ||
sortiz | A Label, see docs.raku.org/type/Label | 11:09 | |
m: marker: for 1..2 { last marker if $_ == 2; .say } | 11:14 | ||
camelia | 1 | ||
notandinus | ah i see | 11:17 | |
do other languages have this Label thing? apart from Perl and Raku, i don't seem to find it for python, nim | 11:26 | ||
gfldex | notandinus: C/C++ does, but with different semantics (read: you can mess up the stack). | 11:28 | |
sortiz | Javascript also, with semantics similar to Raku. | 11:30 | |
11:32
cpage_ joined
|
|||
El_Che | isn't label extremely commom to break out of the correct loop? | 11:32 | |
11:33
dpk left,
dpk joined,
moon-child left,
samcv left,
earenndil joined
|
|||
El_Che | Besides python, all other languages probably have it | 11:34 | |
11:34
samcv joined,
cpage left,
cpage_ is now known as cpage
|
|||
sortiz | But only in Raku they are also objects, like almost everything. | 11:34 | |
notandinus | is it being object better? | 11:35 | |
11:35
samebchase joined
|
|||
El_Che | more consistent with the rest, but I wouldn't know that to do with it as an object | 11:36 | |
11:36
wamba joined
|
|||
sortiz | m: marker: for 1..2 { marker.last if $_ == 2; .say } | 11:37 | |
camelia | 1 | ||
El_Che | is it better than marker: for 1..2 { break marker if $_ == 2; .say } | 11:38 | |
(it only makes sense of course ig there are several nested loops) | |||
sortiz | Indeed. | 11:39 | |
timotimo | (marker1, marker2, marker3).pick.last | 11:43 | |
sortiz | \o timotimo | 11:44 | |
notandinus | so i have this wordsearch project and want to put this word-search function in it's own module | 11:45 | |
El_Che | more fun to pick at random | 11:46 | |
notandinus | should i put it under ProjectName::wordsearch or just wordsearch ? | ||
hmm nvm ^, i was confused with module structure | 11:51 | ||
Missing serialize REPR function for REPR MVMContext (BOOTContext) | 11:56 | ||
i get this ^ at line 6, which is "use WordSearch" | |||
lizmat | notandinus: is this on a recent Rakudo ? | 11:57 | |
tellable6 | 2021-01-16T00:22:41Z #raku <tony-o> lizmat deathbyperl6.com/fez-zef-a-raku-ec...-and-auth/ | ||
notandinus | WordSearch (lib/WordSearch.rakumod) | ||
lizmat: tihs is on Raku 2020.11 | |||
2020.10, sorry | |||
lizmat | hmmm... I seem to recall nine fixing some issues with precomp that could be related to this since then | 11:58 | |
notandinus | i see, is upgrading the only fix? | ||
lizmat | I'm not saying upgrading would fix it, but it could | 11:59 | |
notandinus | gives the same error after removing .precomp | ||
i see, i'll try upgrading then | |||
can i upgrade with: rstar fetch && rstar install ? | 12:00 | ||
timotimo | you can often get that error to go away by resetting $! with Nil at the end of the mainline | ||
lizmat | yes, please, if it still errors, then we may have a system issue worthy of a ticket | ||
timotimo | which fwiw i think we could totally do for you automatically? | ||
lizmat | notandinus: could you try timotimo's suggestion first :-) | ||
notandinus | timotimo: by mainline you mean the module file? | ||
timotimo | yeah, just at the end of the file probably | 12:01 | |
notandinus | hmm timotimo that didn't work but something else worked | 12:03 | |
i had this module Neighbors (lib/Neighbors.rakumod) | |||
WordSearch had this line (use Neighbors) | |||
moving all Neighbors.rakumod functions to WordSearch file and removing that line made it work | 12:04 | ||
12:04
pecastro joined
|
|||
timotimo | it's possible that the fix needs to go into Neighbors instead | 12:04 | |
the $! = Nil one | |||
notandinus | it was Foo.raku -> (use WordSearch -> (use Neighbors)), it's now Foo.raku -> (use WordSearch) | 12:05 | |
timotimo: i put it in both files | |||
ok i tried putting it only in Neighbors and the error didnt go away | |||
btw what I'm doing is totally correct right? i can import Neighbors from WordSearch right? | 12:06 | ||
looks like rakudo star has not released the latest release, it's still at 2020.10 | 12:07 | ||
timotimo | yeah rakudo star is on a looser schedule compared to rakudo | 12:08 | |
12:12
sjm_uk left
|
|||
notandinus | so should i use try using rakubrew? | 12:14 | |
timotimo | whichever way of installing raku itself you prefer. there's also packages for a couple of distros, there's docker containers, there's even experimental AppImage | 12:17 | |
also have a look at LoneStar | |||
oh i think lonestar wasn't the one i was thinking of | 12:18 | ||
El_Che | notandinus: what os do you run? | ||
notandinus | openbsd | ||
ports has 2 year old raku | 12:19 | ||
i'm currently installig App::Rakubrew, i'll see if it works | 12:20 | ||
timotimo: can you link me to lonestar? i didnt find anything related to raku while searching | 12:21 | ||
timotimo | github.com/tyil/lonestar | ||
notandinus | timotimo: it says its a bash script to install the rakudo star distribution | 12:26 | |
but the star distribution is at 2020.10 | |||
i already have the star distribution | |||
timotimo | yeah i thought it was something else | 12:27 | |
notandinus | hmm looks like rakubrew doesn't build it | 12:28 | |
it says, no precomp release available for my system | 12:29 | ||
hmm it has build option, i'm trying to build 2020.12 | 12:32 | ||
El_Che | notandinus: I use a small bash script to build relocatable linux builds, it should work on openbsd: github.com/nxadm/rakudo-pkg/blob/m...able-build | 12:33 | |
(comment out the cp commands because it copies files from the repo) | 12:34 | ||
( I call it with /create-relocatable-build $RAKUDO_VERSION $ZEF_VERSION 64) | 12:35 | ||
12:36
xelxebar left
12:37
xelxebar joined
|
|||
notandinus | i see, i'll check it out | 12:44 | |
also looks like pkgsrc has 2020.12, i'll try building that way first | |||
12:54
sjm_uk joined
13:01
sortiz left
13:08
MasterDuke joined
13:42
MasterDuke left
13:57
maggotbrain left
13:58
maggotbrain joined
14:01
sena_kun joined,
oneeggeach joined
14:02
oneeggeach left
14:16
JRaspass left
14:20
jess joined
14:39
lucasb joined
14:46
wamba left
14:56
domidumont joined,
sjm_uk left
15:04
isacl___ left
15:05
isacl___ joined
15:08
wamba joined
15:12
sena_kun left,
sena_kun joined
15:15
sjm_uk joined
15:27
JRaspass joined
15:30
Altai-man joined
15:32
sena_kun left
15:39
guifa joined
|
|||
guifa | o/ | 15:39 | |
tellable6 | 2021-01-16T07:00:00Z #raku <jmerelo> guifa you have to record the voice. During the presentation, you can answer questions | ||
15:43
guifa left
15:49
sena_kun joined
15:56
parabolize joined
|
|||
notandinus | so i wasnt able to build the latest raku, will try again tomorrow | 16:29 | |
but i tested it with 2018.12 (from ports) and it gave the same error | |||
is what i'm doing supported? | |||
16:34
sena_kun left
16:38
dogbert17 joined
|
|||
Geth | ecosystem/finanalyst-patch-2: c1bbbc1531 | (Richard Hainsworth)++ (committed using GitHub Web editor) | META.list Add RakuConfig to ecosystem github.com/finanalyst/raku-config |
16:56 | |
ecosystem: finanalyst++ created pull request #576: Add RakuConfig to ecosystem |
16:57 | ||
17:10
PimDaniel joined
17:18
PimDaniel left
17:34
aindilis left
17:38
notagoodidea joined,
aindilis joined
|
|||
xinming | m: B0756KCKFN | 17:38 | |
camelia | 5===SORRY!5=== Error while compiling <tmp> Undeclared name: B0756KCKFN used at line 1 |
||
xinming | oops | ||
m: sub t (*@a) { @ = |@a; }; my $t = t(1,2); t(3,4); $t.raku.say; | 17:39 | ||
camelia | $[3, 4] | ||
notagoodidea | I am looking for ressources to use to catch heredocs strings and use them as a template if it is possible? | ||
timotimo | heredoc strings are like string literals, you'd directly assign them | ||
notagoodidea | I remeber seeing a qq/to/HTML doing something similar but I can't remember where. | ||
xinming | Today, This subtle bug bit me quite hard. :-) | ||
timotimo | qq:to/ENDOFTEXT/; | 17:40 | |
qq will give you interpolation like double quoted strings whereas q will give you the same as 'blah' | |||
in terms of what $blah and \t will do | |||
notagoodidea | oh, ok. I must have blurry memories. | ||
Ok, I found what I tought it was my bad. | 17:42 | ||
www.perl.com/article/observing-cor...with-raku/ They call using qq/to/HML a built-in templating engine where it is "just" the interpolation. | 17:43 | ||
timotimo | close enough :) :) | 17:52 | |
notagoodidea | Yep :) | 17:57 | |
I remerbered it as a slang or a way to meddle with qq string :) | |||
18:01
finsternis joined
18:21
sjm_uk left
18:31
PimDaniel joined
|
|||
PimDaniel | Hi | 18:32 | |
notandinus | hello PimDaniel o/ | ||
PimDaniel | my $str = 'interview' ; says $str./ ^inter //; Is it ok? | 18:33 | |
notagoodidea | You want to match against? You can use the smartmatch operator : ~~ | 18:35 | |
m: my $str = 'interview'; say $str ~~ /^inter/; | |||
camelia | 「inter」 | ||
notagoodidea | m: my $str = 'interview'; say $str ~~ /^inter.*/; | ||
camelia | 「interview」 | ||
PimDaniel | Thank's camelia but want to substitute. say $str ~~ /^inter//; ?? | 18:36 | |
timotimo | m: $_ = "interview"; s/^inter//; say $_ | 18:37 | |
camelia | view | ||
notandinus | PimDaniel: use s/ | ||
notagoodidea | You can use `$foo ~~ s/lalal/bar/` The form s// is for substitution. | ||
s/// | |||
PimDaniel | true i'v forgotten the 's' preceeding. | 18:38 | |
notandinus | docs.raku.org/syntax/s$SOLIDUS%20$...20$SOLIDUS | ||
notagoodidea | There is also the .subst methods but it won't do it in-place. | 18:39 | |
notandinus | and you could also use .match to match and .replace-with to replace the match | ||
PimDaniel | It's not fundamently different from Perl5. | ||
notandinus | m: say "interview".match("inter").replace-with("") | 18:40 | |
camelia | view | ||
PimDaniel | Does it behave like if the flax x should be enable by default? | ||
notandinus | what do you mean by 'flax x' ? | ||
18:42
notagoodidea left
|
|||
PimDaniel | notandinus : In the same idea probably use substr which should give better perfs on huge texte searches into loops for example. | 18:42 | |
Problably wrong in this case until we have an anchor. | 18:44 | ||
Hum, sorry : i must go! Thank you very mutch! | 18:45 | ||
perry | m: my $str = q@<^<()(?R){2}>\z|\1\Q^<()(?R){2}>\z|\1\Q>@; say $str ~~ /^<()(?R){2}>\z|\1\Q^<()(?R){2}>\z|\1\Q/; | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> Unable to parse regex; couldn't find final '/' at <tmp>:1 ------> 3Q^<()(?R){2}>\z|\1\Q>@; say $str ~~ /^<(7⏏5)(?R){2}>\z|\1\Q^<()(?R){2}>\z|\1\Q/; expecting any of: infix stop… |
||
perry | Oops. Meant to do that in PMs. | ||
PimDaniel | notandinus : sorry : *flag //x | 18:53 | |
18:57
PimDaniel left
19:09
dataangel left
19:12
b2gills left,
moon-child joined,
aindilis left,
leah2 left,
rba left,
tinita left
19:13
tinita joined,
rba joined,
JRaspass left,
b2gills joined,
sjm_uk joined,
aindilis joined,
leah2 joined,
earenndil left,
pecastro left,
rindolf left,
nine left,
nine joined,
Benett joined,
rindolf joined
19:18
pecastro joined
19:31
sena_kun joined
19:32
Altai-man left
19:33
dataangel joined,
Sgeo joined
19:39
wamba left
19:50
sjm_uk left,
kini left
19:54
kini joined,
PimDaniel joined
19:55
patrickb joined
|
|||
patrickb | El_Che: I looked at the shell script of yours. Are you sure it creates a relocatable build? Nowhere in that script is the `--relocatable` option used. | 19:56 | |
notandinus: Can you paste the error you get when building? (gist.github.com or a nopaste service can help) | 19:58 | ||
o/ | |||
19:58
patrickb left
|
|||
PimDaniel | Aïe! | 20:01 | |
Is there a way to directly report part of a matched constant : say CONTANT.rx/.+(group).+/; ???? | 20:05 | ||
should be match buildin sub : CONSTANT.match.rx/.*(group).*/; | 20:07 | ||
20:09
rindolf left
20:12
moony is now known as zoomy,
zoomy is now known as noomy
20:14
Black_Ribbon joined
|
|||
PimDaniel | I, Is there a way to enable word jump/insertion/history in raku interpretor to make it more convenient? | 20:14 | |
timotimo | there's the linenoise module as well as another readline one that you can install with zef, or you can run the repl wrapped inside rlwrap | 20:17 | |
20:18
b2gills left,
leah2 left
20:21
leah2 joined
|
|||
PimDaniel | @timotimo : thanks's ! But i would like a complete solution , tab completion, history, etcc. | 20:24 | |
20:26
wamba joined
|
|||
timotimo | sounds like maybe the jupyter kernel could be more to your liking | 20:27 | |
20:27
wamba left
|
|||
lizmat | .seen mst | 20:36 | |
tellable6 | lizmat, I saw mst 2021-01-04T20:34:24Z in #raku: <mst> nnn/w 409 | ||
20:37
b2gills joined
|
|||
PimDaniel | Is zef able to manage any dependencies? | 20:43 | |
lizmat | if the dependencies are properly declared in the META6.json file, yes | 20:44 | |
PimDaniel | Isn't this automatically done? | ||
My paste : pastebin.com/hYSVWZ65 | 20:45 | ||
20:46
Geth joined
|
|||
lizmat | Ah, you mean native dependencies... | 20:47 | |
no, these are not done (yet anyway) by zef | |||
PimDaniel | Well, for start, i just wanted to use a practical interactive raku CLI and now i've forgotten what i wanted to achieve, pffff | 20:48 | |
Probably falling back to inline shell would be better. Does anyone know what i must remove when zef crashed but started to install. | 20:50 | ||
well i'll use -e option : i loose my time! | 20:51 | ||
lizmat | PimDaniel: personally, I have an alias: alias r='raku -e' | 20:55 | |
which allows me to just say: r 'foo' in the shell :-) | 20:56 | ||
PimDaniel | lizmat: ok | 20:57 | |
lizmat | or small throwaway scripts to alpha test | ||
PimDaniel | this works : raku -e 'my $var = "interview"; say $var;' | 20:58 | |
I use to have aliases too : alias ll='ls -ltra --color=auto' | 20:59 | ||
lizmat | actually, my aliases are: | 21:00 | |
alias r='time raku -e' | |||
alias rl='raku --ll-exception -e' | |||
alias rp='raku --profile -e' | |||
PimDaniel | ok, thank's : i'll copy them : what's the price? | 21:03 | |
21:07
tib left
21:09
PimDaniel left
|
|||
RaycatWhoDat | raku-musings.com/palindromic-stack.html | 21:14 | |
Whoever runs this blog has the date bug | |||
2022 instead of 2021 | |||
timotimo | oh where does that come from? | ||
21:15
PimDaniel joined
|
|||
timotimo | it also says "{{COPYRIGHT}}" at the bottom, heh | 21:16 | |
RaycatWhoDat | I think it was something about how the date formatters do things | 21:17 | |
Something about "YYYY" over "yyyy" | |||
PimDaniel | say &[<=].name() => infix:«<=», but is there a way to just obtain : <= , without matching? | 21:19 | |
does .name() applies to any referenced sub? or only to infix? | 21:20 | ||
lizmat | PimDaniel: 0c | 21:21 | |
PimDaniel | lizmat: what? | 21:23 | |
lizmat | the price: zero cents :-) | 21:25 | |
PimDaniel | Ho sorry : thank's! I took it for the reply to my new question about infix. | 21:26 | |
21:26
Manifest0 left
21:29
Manifest0 joined
|
|||
lizmat | ah, to answer your questions | 21:29 | |
.name can be called on any Routine object | |||
m: dd &[+].name.substr(7,*-1) # works for most, I'd say | 21:31 | ||
camelia | "+" | ||
PimDaniel | lizmat: for those i tested, it does indeed! | 21:35 | |
21:40
PimDaniel left,
mowcat joined
|
|||
gfldex | m: BABEL: Nil; BABEL.HOW.mixin(BABEL, role :: { method super { "secret" }}); BABEL.super; | 21:41 | |
camelia | ( no output ) | ||
gfldex | notandinus: ^^^ labels being objects allows us to hide stuff in them. :-> | ||
m: BABEL: Nil; BABEL.HOW.mixin(BABEL, role :: { method super { "secret" }}); BABEL.super.say; | |||
camelia | secret | ||
21:46
domidumont left,
PimDaniel joined
|
|||
PimDaniel | Is this to compact and elegant enought? : pastebin.com/4THwJAEH | 21:47 | |
gfldex | m: BABEL: Nil; BABEL.HOW.mixin(BABEL, role :: { method line { $?LINE }; method file { $?FILE } }); BABEL.&{ .file ~ ':' ~ .line }».say; | 21:48 | |
camelia | <tmp>:1 | ||
gfldex | notandinus: ^^^ it might even be useful | 21:49 | |
lizmat | PimDaniel: you could do: die "assertion $x &op.name.substr(7,*-1) $y failed..." | ||
PimDaniel: and for ease of use, you could have "assert" take a string for the operator | 21:50 | ||
PimDaniel | lizmat: No no no! The problem is : i need to have variable names to indicate what i'm checking... probablay a caller() solution? | 21:51 | |
This is important for me to have variables's names. | |||
lizmat | m: my $a = 42; sub b($b is raw) { dd $b.VAR.name }; b $a | 21:52 | |
camelia | "\$a" | ||
PimDaniel | OK! | ||
I'm quite new to Raku : didn't know it was so simple! | |||
lizmat | :-) | 21:53 | |
with regards specifying the op as a string | |||
m: my $op = "+"; dd ::("&infix:<$op>").name | 21:54 | ||
camelia | "infix:<+>" | ||
lizmat | this will do a runtime-lookup of the operator name | ||
this will be expensive, so YMMV | |||
PimDaniel | Beware i'll have man calls and if it says value variables instead of names : a message like : assertion failed because 3 < 100 is un-usefull at all! I need to have : assertion failed : ($x) = 3 < ($y) 100 | 21:57 | |
Not sure that you gave me the goot answer! | |||
need to have names of variable from caller!!! | 21:58 | ||
lizmat | m: my $a = 42; sub b($b is raw) { say $_ ~~ Scalar ?? .name !! $b given $b.VAR }; b $a; b 42 | 22:00 | |
camelia | $a 42 |
||
lizmat | that's the name of the caller, no ? | ||
gfldex | PimDaniel: see: gfldex.wordpress.com/2020/12/01/nomen-est-omen/ | ||
PimDaniel | lizmat: YES! sorry I must try before to deny you! | 22:01 | |
lizmat | PimDaniel: no worries, just wanted to make sure we were on the same page | ||
PimDaniel | gfldex: thank's! | ||
22:05
sena_kun left
22:12
PimDaniel left
22:13
PimDaniel joined
22:14
moon-child left
22:18
PimDaniel left,
PimDaniel joined
22:27
moon-child joined
22:29
PimDaniel left
22:31
PimDaniel joined
22:37
Hexeratops joined,
Hexeratops left
22:40
oneeggeach joined
|
|||
PimDaniel | I'm coming back! | 22:45 | |
22:45
moon-child left
|
|||
PimDaniel | It does not work because my variable are numbers : not string! | 22:46 | |
But i need numbers, and i do not want to pass strings to the sub! | |||
lizmat | m: my $a = 42; sub b($b is raw) { say $_ ~~ Scalar ?? .name !! $b given $b.VAR }; b $a; b 42 # that seems to work ? | 22:47 | |
camelia | $a 42 |
||
PimDaniel | lizmat: i do understand anymore at all! | 22:48 | |
what has $_ to do with that? | 22:49 | ||
timotimo | "given" sets $_ for you | ||
lizmat | that's set by the "given $b.VAR | ||
so you don't have to repeat that | |||
m: my $a = 42; sub b($b is raw) { say $b.VAR ~~ Scalar ?? $b.VAR.name !! $b }; b $a; b 42 # version without $_ or given | 22:50 | ||
camelia | $a 42 |
||
PimDaniel | hooo ok i think i see! | ||
perl5 was orrible in presentation : you make perl6 more horrible! | |||
Sorry but a program MUST be understook for people who read you! | 22:51 | ||
22:51
moon-child joined
|
|||
lizmat | sorry if I was using too advanced features :-) | 22:51 | |
22:51
moon-child left
|
|||
lizmat | so is the version without $_ more understandable ? | 22:51 | |
PimDaniel | for me newbie : yess | ||
lizmat | good :-) | 22:52 | |
22:52
moon-child joined
|
|||
lizmat | note to self: write simpler examples :-) | 22:52 | |
22:53
moon-child left
|
|||
PimDaniel | ok i think i need to work again! i did not understand given in fact! | 22:54 | |
what are ?? and !! ? | |||
timotimo | it's like ? : in other languages | ||
PimDaniel | There are too many things i do not know in the exemple and it's why i don't understand. | 22:55 | |
lizmat is off to catch some shuteye | 22:56 | ||
22:56
oneeggeach left
|
|||
timotimo | shoe-tie | 22:59 | |
23:00
wamba joined
|
|||
PimDaniel | this works : my $varname;my Int $afdsl = 42; sub b($b is raw) { $varname=$b.VAR.name }; b $afdsl; say $varname, even if afdsl is typed Int, ok? | 23:03 | |
but in my script it complains with : No such method 'name' for invocant of type 'Int'. Did you mean any of ... | 23:04 | ||
lizmat | did you bind to the variable by any chance? | 23:05 | |
PimDaniel | bind? | ||
lizmat | ok, so you didn't | ||
PimDaniel | I'm French, sorry! | 23:06 | |
lizmat | no worries | ||
PimDaniel | bind : atteindre | ||
lizmat | m: my $a := 42; sub b($b is raw) { say $b.VAR ~~ Scalar ?? $b.VAR.name !! $b }; b $a; b 42 | ||
camelia | 42 42 |
||
lizmat | version with binding ^^ | ||
:= instead of = | |||
otherwise I have no idea why it doesn't work in your script | 23:07 | ||
will backlog tomorrow | |||
really sleep& | |||
PimDaniel | You'r true! See you tomorrow. | ||
Thank's for your help! | 23:08 | ||
23:08
notagoodidea joined,
PimDaniel left
23:09
moon-child joined
|
|||
notagoodidea | Is it normal that "file".IO.changed does not provide the DateTime in the right timezone? | 23:09 | |
timotimo | does the filesystem save the timezone along with the date? | ||
notagoodidea | ie, I created a file at 00:10, and ls reports it correctly at 00:10. | 23:10 | |
timotimo | otherwise i would expect it to use $*TZ i guess? | ||
notagoodidea | But in raku, I got 23:10, I am at GMT+1 | ||
timotimo | m: dd "/".IO.changed | ||
camelia | Instant.from-posix(<1178447450309/764>) | ||
timotimo | m: dd "/".IO.changed.DateTime | ||
camelia | DateTime.new(2018,11,17,16,1,24.697644) | ||
timotimo | m: say qx,ls -l /, | 23:11 | |
camelia | total 0 drwxr-xr-x 1 root root 1788 Dec 20 11:00 bin drwxr-xr-x 1 root root 1214 Sep 4 17:06 boot drwxr-xr-x 17 root root 3700 Jan 11 11:00 dev drwxr-xr-x 1 root root 3936 Jan 15 11:00 etc drwxr-xr-x 1 root root 72 Mar … |
||
timotimo | *shrug* | 23:12 | |
gotta run | |||
notagoodidea | $*TZ is at 3600 so UTC+1, weird | 23:13 | |
m: say "/bin/".IO.changed.DateTime.timezone; | 23:15 | ||
camelia | 0 | ||
notagoodidea | m: say $*TZ; | ||
camelia | 3600 | ||
23:20
wamba left
|
|||
notagoodidea | m: dd "/bin".IO.changed.DateTime | 23:34 | |
camelia | DateTime.new(2020,12,20,10,0,23.154922) | ||
notagoodidea | m: say qx,ls -l /bin, | ||
camelia | total 2132 lrwxrwxrwx 1 root root 13 May 16 2020 arch -> /usr/bin/arch lrwxrwxrwx 1 root root 21 Jun 8 2020 awk -> /etc/alternatives/awk lrwxrwxrwx 1 root root 17 May 16 2020 basename -> /usr/bin/basename -rwxr-xr-x 1 root r… |
||
23:36
kini left
23:37
kini joined
|