🦋 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.
uzl[m] m: class IterStr does Iterable { has $.str; method new($str) { self.bless(:$str) }; method iterator { $!str.split('', :skip-empty).iterator }}; my $x := IterStr.new('hello'); .say for $x; 02:50
camelia h
e
l
l
o
uzl[m] m: class IterStr does Iterable { has $.str; method new($str) { self.bless(:$str) }; method iterator { $!str.split('', :skip-empty).iterator }}; my @x = IterStr.new('hello'); .say for @x;
camelia h
e
l
l
o
uzl[m] m: class IterStr does Iterable { has $.str; method new($str) { self.bless(:$str) }; method iterator { $!str.split('', :skip-empty).iterator }}; .say for IterStr.new('hello'); 02:51
camelia h
e
l
l
o
uzl[m] m: class IterStr does Iterable { has $.str; method new($str) { self.bless(:$str) }; method iterator { $!str.split('', :skip-empty).iterator }}; my $x = IterStr.new('hello'); .say for $x; 02:52
camelia IterStr.new(str => "hello")
uzl[m] m: class IterStr does Iterable { has $.str; method new($str) { self.bless(:$str) }; method iterator { $!str.split('', :skip-empty).iterator }}; my $x = IterStr.new('hello'); my $i = $x.iterator; say $i.pull-one;
camelia h
uzl[m] m: class IterStr does Iterable { has $.str; method new($str) { self.bless(:$str) }; method iterator { $!str.split('', :skip-empty).iterator }}; my $x = IterStr.new('hello'); my $i = $x.iterator; say $i.pull-one; say $i.pull-one; 02:53
camelia h
e
uzl[m] Why is it that assigning an iterable to a scalar variable prevents you from iterating it like you'd would do by binding it? 02:54
m: class IterStr does Iterable { has $.str; method new($str) { self.bless(:$str) }; method iterator { $!str.split('', :skip-empty).iterator }}; my $x = IterStr.new('hello'); my $i = $x.iterator; while True { my $item := $i.pull-one; last if $item =:= IterationEnd; say $item } 02:56
camelia h
e
l
l
o
vrurg_ uzl[m]: Because it gets itemized, I guess. 03:07
Xliff nqp: my @filechars = ('a'... 'z'); 05:02
camelia Assignment ("=") not supported in NQP, use ":=" instead at line 2, near " ('a'... '"
at gen/moar/stage2/NQPHLL.nqp:1026 (/home/camelia/rakudo-m-inst-2/share/nqp/lib/NQPHLL.moarvm:panic)
from <unknown>:1 (/home/camelia/rakudo-m-inst-2/share/nqp/lib/nqp.…
Xliff nqp: my @filechars := ('a'... 'z'); 05:03
camelia Malformed binding at line 2, near "('a'... 'z"
at gen/moar/stage2/NQPHLL.nqp:1026 (/home/camelia/rakudo-m-inst-2/share/nqp/lib/NQPHLL.moarvm:panic)
from <unknown>:1 (/home/camelia/rakudo-m-inst-2/share/nqp/lib/nqp.moarvm:initializer)
from gen/moar/s…
Xliff nqp: my @filechars := ('a'.. 'z');
camelia Malformed binding at line 2, near "('a'.. 'z'"
at gen/moar/stage2/NQPHLL.nqp:1026 (/home/camelia/rakudo-m-inst-2/share/nqp/lib/NQPHLL.moarvm:panic)
from <unknown>:1 (/home/camelia/rakudo-m-inst-2/share/nqp/lib/nqp.moarvm:initializer)
from gen/moar/s…
Xliff nqp: my @filechars := ('a'..'z');
camelia Malformed binding at line 2, near "('a'..'z')"
at gen/moar/stage2/NQPHLL.nqp:1026 (/home/camelia/rakudo-m-inst-2/share/nqp/lib/NQPHLL.moarvm:panic)
from <unknown>:1 (/home/camelia/rakudo-m-inst-2/share/nqp/lib/nqp.moarvm:initializer)
from gen/moar/s…
Xliff nqp: my @filechars := ('a', 'z'); 05:04
camelia ( no output )
Xliff nqp: my $filechars := 'abcdefghijklmnopqrstuvwxyz0123456789'; 05:05
camelia ( no output )
cpan-raku New module released to CPAN! Auth::SASL (0.0.1) by 03HANENKAMP 05:12
Xliff m: say 36 ** 20 07:06
camelia 13367494538843734067838845976576
Xliff m: «13367494538843734067838845976576».chars.say
camelia 32
Xliff m: say («13367494538843734067838845976576».chars - 6) / 3 07:07
camelia 8.666667
zln why do you separate perls 09:00
is there that big difference
moritz there is, yes 09:04
zln ah, I began learning perl. Maybe I should go on and begin learning Perl 6 instead ? 09:11
is it like c & c++?
the difference I mean
shred_alert zln, Perl 6 is called Raku now. :) 09:17
zln :-D
shred_alert You can write Raku code that looks a lot like C(++) 09:18
That one of the great things about it. It's flexible enough to fit around many styles and paradigms of coding.
epony there is no difference, there is familiarity 09:18
zln stranger things this is 09:20
epony en.wikipedia.org/wiki/Raku_(progra..._language) "Raku is a member of the Perl family of programming languages". 09:21
zln Should a person like me who began to learn perl switch to raku instead or keep going 09:23
epony how old are you? 09:24
shred_alert What do you want to do with the programming language?
zln eh, I am 29. Donno, maybe mostly sysadmin things and other data manipulation things. 09:26
epony keep going
zln In what situation should I not keep going? :)
shred_alert You won't lose out by switching to Raku in that case. 09:27
Unless you already have dependencies with Perl modules, I'd recommend learning Raku instead. 09:28
zln No I am not a maintainer or pro-programmer
It's just for enthusiasm only :)
shred_alert In that case, Raku is a great choice! 09:29
zln Is it as integrated as perl when it comes to sysadmin and data manipulation? 09:30
shred_alert No. It's still a new language in the sysadmin world.
zln And. What books would you recommend for learning Raku deeply and thorougly 09:31
shred_alert Uh. I'd just recommend learning Raku by looking up a basic syntax guide and building something. You'll get started a lot faster that way.
You can refer to docs and books when you want more depth
And share your code as well to get pointers
zln Alright 09:32
I think we got it covered :)
shred_alert (y)
zln Thanks for taking time
shred_alert You're welcome. :)
zln :-=
:-) :p
shred_alert zln, this link is very useful: docs.perl6.org/language/syntax 09:35
zln Will do, thanks :) 09:36
shred_alert Anyone know why there are two versions still floating around? docs.raku.org/language/syntax docs.perl6.org/language/syntax 09:37
sena_kun shred_alert, for backward compatibility for some time? 09:40
yesh, redirects, but
shred_alert Ah okay 09:48
Was just curious
sarna does raku have something like python’s virtualenv? 09:54
zln what is python's virtualenv maybe you could explein if there who have the answer on the raku side but cannot relate to python 10:18
I think maybe
shred_alert Basically you're decoupling the environment that your programming is running in from the base operating system. 10:20
Altai-man_ there is p6env, but not sure how "local" can it be 10:21
also I think rakudobrew can do things 10:22
shred_alert If you really want to decouple an app from the base system you can look into stuff like VMs, containers, and jails. 10:23
sarna yeah, but vms containers and jails are really heavyweight.. using them when I just want to have two different versions of libraries installed for two different projects would be.. suboptimal 10:26
or at least that’s my viewpoint
shred_alert Just listing options :) 10:27
Altai-man_ sarna, two versions of raku libraries? you can do that without any venvs. :) 10:30
just specify :ver<foo> and :ver<bar> in META6.json to install both, and then you can use Cool::Lib:ver<foo> and use Cool::Lib:ver<bar> and both will be available in this scope. 10:31
and if they are in a different projects, then no problem at all 10:35
sarna Altai-man_: oh wow that’s cool 10:37
Altai-man_ sarna, :)
Altai-man_ u: – AlwaysFail 10:45
unicodable6 Altai-man_, U+0020 SPACE [Zs] ( )
Altai-man_, U+2013 EN DASH [Pd] (–)
Altai-man_, 13 characters in total ( – AlwaysFail): gist.github.com/a0f60822e1ce45fc5d...34ea0cff0a
Altai-man_ hmmm
Kaiepi i'm writing a routine that takes another routine along with a capture of arguments and using that routine's signature, maps its parameters to corresponding values in the capture. the problem is atm i keep state for which named params have been seen and where in the list of positional params the routine is currently at because of slurpy parameters, but this is really annoying to write in such a way that it's 15:17
both testable and optimal. are there other ways to go about implementing this?
tellable6 2019-12-26T18:52:37Z #raku <jmerelo> Kaiepi OK :-)
Kaiepi in js i'd use something like a generator for something like this, which is similar to gather, but i want to be able to test how individual params get mapped, which i'm not sure if i can do with that 15:19
oh, looks like the Iterator class does what i'm looking for 15:32
SmokeMachine sarna: have you seen 6pm? 17:58
SmokeMachine sarna: modules.raku.org/dist/6pm:github:F...20Oliveira 18:07
dzedesfr i 21:27
Hi
could anyone tell GitHub to replace "Perl6" by "Raku" ??
cpan-raku New module released to CPAN! Object::Permission (0.0.4) by 03JSTOWE 21:46
Geth doc: cc2557c937 | (Stoned Elipot)++ | doc/Type/IO/Path.pod6
remove unnecessary calls to IO coercer in examples
22:05
sjn \o 22:11
Updated stickers for FOSDEM: www.dropbox.com/sh/x8yjm7s73idbjrf...TBHKa?dl=0 22:12
I've ordered 2000 of them. Come to FOSDEM if you want any of them! :-)
uzl[m] sjn++ 22:49
dzedesfr: What do you mean specifically? Repos? Language tag? 22:50
dzedesfr uzl[m] language tag 22:52
dzedesfr github.com/search/advanced 22:52
Replace "Perl6" by "Raku"
uzl[m] I guess that there must be some repo where an issue can be submitted if it hasn't. 22:53
Grinnz it should happen as soon as github.com/github/linguist/pull/4731 is deployed 22:54
uzl .tell vrurg_ Re: Iterators, Thanks. I ended up finding the following SO question (stackoverflow.com/q/50580476/10824322). I even asked a related question (stackoverflow.com/q/57121561/10824322) which I somehow forgot about it 😅. 23:00
tellable6 uzl, I'll pass your message to vrurg_
uzl I decided to talk myself through the concepts of iterables and iterators (especially those in Raku), and ended up assembling this: gitlab.com/snippets/1929111. It's a bit longish but if anyone could read it and offer some feedback, especially corrections and suggestion for improving it, I'd appreciate it. 23:02
dzedesfr openmortal.sourceforge.net/cgi-bin/...?fighter=8