🦋 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:22
mowcat left,
xi left
00:23
xi joined
00:41
pecastro joined
01:00
Henri left
01:09
Doc_Holliwood left
01:21
pecastro left
|
|||
warriors | why is my $x = ^5 ; for $x {} different from for ^5 {} | 01:44 | |
timotimo | putting stuff into a scalar container (my $foo) makes them have item semantics | 01:45 | |
you can decont it to have `for $x<> { }`, you can contextualize it as a list with `for @$x {}` or `for $x.list { }` | |||
if you use binding instead of =, i.e. `my $x := ^5` then you'll not have a scalar container, and the item semantics go away too | 01:46 | ||
warriors | thanks | 01:47 | |
|$x also works | 01:54 | ||
flattens object | |||
timotimo | true, that'll be what you need if you have some extra items from another list you want to iterate over individually as well | 01:56 | |
02:18
jmchael left
02:42
cpan-raku left
02:43
cpan-raku joined,
cpan-raku left,
cpan-raku joined
02:55
RaycatWhoDat joined
02:58
xinming left,
xinming joined
03:04
Manifest0 left
03:06
Manifest0 joined
03:07
maggotbrain joined
04:07
coverable6 left,
benchable6 left,
quotable6 left,
releasable6 left,
tellable6 left,
squashable6 left,
bloatable6 left,
nativecallable6 left,
unicodable6 left,
greppable6 left,
notable6 left,
xinming left,
bisectable6 left,
shareable6 left,
sourceable6 left,
committable6 left,
statisfiable6 left,
committable6 joined,
xinming joined,
bloatable6 joined,
benchable6 joined,
quotable6 joined
04:08
wamba joined,
tellable6 joined,
statisfiable6 joined,
releasable6 joined,
shareable6 joined,
bisectable6 joined,
nativecallable6 joined
04:09
notable6 joined,
unicodable6 joined,
sourceable6 joined,
squashable6 joined,
greppable6 joined
04:10
coverable6 joined
04:13
RaycatWhoDat left,
RaycatWhoDat joined
04:42
wamba left
05:03
xinming left,
xinming joined
05:21
xinming left,
xinming joined
05:35
RaycatWhoDat left
06:00
rindolf joined
06:08
gordonfish left
06:24
brtastic joined
06:43
dotdotdot left,
dotdotdot joined
06:46
parabolize left
07:13
Doc_Holliwood joined
07:21
gordonfish joined
|
|||
Geth | ecosystem: a1aa5910ba | (Henri Schmidt)++ | META.list Add new Bio module. See github.com/schmidt73/Bio. |
07:29 | |
ecosystem: fd9d71bc3c | (Juan Julián Merelo Guervós)++ (committed using GitHub Web editor) | META.list Merge pull request #572 from schmidt73/add-bio-module Add new Bio module. See github.com/schmidt73/Bio. |
|||
doc: 52ad12dabd | (Stoned Elipot)++ (committed by Juan Julián Merelo Guervós) | doc/Type/Test.pod6 Document Test.done-testing's return value ref #3580 |
07:45 | ||
linkable6 | Link: docs.raku.org/type/Test | ||
DOC#3580 [open]: github.com/Raku/doc/issues/3580 [checklist][docs] Checklist for 2020.08 | |||
07:51
wamba joined
08:03
aborazmeh joined,
aborazmeh left,
aborazmeh joined
08:13
brtastic left
08:19
Doc_Holliwood left
08:27
Doc_Holliwood joined
08:52
ex_nihilo joined
08:55
wamba left
09:23
ToddAndMargo joined
|
|||
ToddAndMargo | Anyone on newbie duty tonight? | 09:24 | |
I am having trouble declaring a method inside a class. Anyone available to look at my code on vpaste.net? | 09:28 | ||
coldpress | ToddAndMargo: why not post the URL? | 09:30 | |
ToddAndMargo | I wanted to make sure someone was home first: vpaste.net/m6JZt | ||
coldpress | pretty sure methods belong to an object, so `Angle.new.AngleCosine` should work | 09:32 | |
ToddAndMargo | I was trying to get around that. I am trying to do a `say 1.cos` style method, only angle instead of radians | 09:34 | |
09:34
wamba joined
|
|||
ToddAndMargo | I am writing myself instructions on how to do methods and this wold make a good example | 09:35 | |
09:37
cpan-raku left
09:38
cpan-raku joined,
cpan-raku left,
cpan-raku joined
|
|||
coldpress | I don't know if it's possible to extend native types like that | 09:39 | |
I think `Angle(1).cos` would work, though | 09:40 | ||
09:40
sena_kun joined
|
|||
ToddAndMargo | How would I alter this code to get `(45.0).AngleCosine` to work? | 09:41 | |
Angle(1).cosCannot find method 'Angle' on object of type Int in block <unit> at <unknown file> line 1 | |||
coldpress | sorry, forgot Raku has weird object initialization syntax | 09:43 | |
I meant Angle.new(1).cos | |||
but that's not what you want | |||
tyil | coldpress: you can `augment class Int` I'm sure | 09:48 | |
it works with Hash in one of my modules | |||
but requires MONKEY-TYPING | |||
and it'll cost you on performance | 09:49 | ||
ToddAndMargo | I am told to stay away from the monkey! | ||
tyil | and you should | ||
I'm not saying you *should*, I'm saying you *can* do something | |||
coldpress | cool, thanks for the tip | 09:51 | |
ToddAndMargo | I an even get this to work: class PrintString2 { method PrintStr( Str:D: ) { print "self = <" ~ self ~ ">\n"; } } | ||
say "abc".PrintStrNo such method 'PrintStr' for invocant of type 'Str' | |||
I thought the `Str:D:` took care of that | 09:52 | ||
tyil | why | ||
coldpress | is there an easy way to make the lists in a set of lists unique? (easy means: without declaring a custom class that overrides WHICH) | ||
tyil | "abc" is a Str, and Str doesn't have your method | ||
coldpress | m: Set([[1],[1]]) | ||
camelia | ( no output ) | ||
coldpress | m: say Set([[1],[1]]) | ||
camelia | Set([1] [1]) | ||
coldpress | here there are two "identical" [1]'s, but Set considers them to be different | 09:53 | |
lizmat | Arrays are not value types | ||
coldpress | yes I understand why Set considers them to be different | 09:54 | |
is there an easy way to make Arrays value types? | |||
ToddAndMargo | Now I am confused. All values that are "Str" have to be in core.c Str.pm6? | ||
tyil | what | 09:55 | |
is Raku your first object oriented language, ToddAndMargo? | |||
ToddAndMargo | yes | 09:56 | |
tyil | (or your first programming language in general) | ||
I would strongly recommend learning about object oriented programming before trying remotely advanced tricks | |||
ToddAndMargo | not by any shake of the stick. Never used OO though | ||
tyil | otherwise you're just going to come in here every day being confused about rather simple things | 09:57 | |
and it's really frustrating for others to then realize they have to walk you through the absolute basics of OO | |||
ToddAndMargo | I used Perl5 a lot before switching to Raku and that uses OO a lot. | ||
I do know that each implementation of OO is specific to the language it is used in. Do you know of a paper that explains how Raku is using OO and what the specific OO rules are for Raku? | 09:59 | ||
I am writing my own instructions with examples, so once I get it once, I should not have to come back here. | |||
tyil | well, I've seen you return with very simple questions time and time again, and proper explanations being waved away | 10:00 | |
ToddAndMargo | Can you tell me what I did wrong in the code I posted? | ||
tyil | 10:53 <tyil> "abc" is a Str, and Str doesn't have your method | ||
ToddAndMargo | So back to the question, I can not use a type Str unless it is in code.c Str.pm6? github.com/rakudo/rakudo/blob/mast....c/Str.pm6 | 10:01 | |
tyil | I'm really not eveen sure what you're trying to say here | 10:02 | |
ToddAndMargo | sorry core.c, not code.c | ||
tyil | you're missing the core of OO too much here, and I don't have the patience to walk you through the bare basics | ||
ToddAndMargo | Would you mind correcting the code I posted so I can pick it up by example? | 10:03 | |
"when do I wave away" things? Sometimes I do not understand, but I always state such. | 10:04 | ||
tyil | what you're trying to do doesn't really work (though yes, you *can* do this in Raku specifically, it would introduce things that you've already been told to stay away from when possible) | ||
well, you're waving away my advice to learn the basics before trying to dive into the deep end | |||
ToddAndMargo | Oh, the monkey thing? | 10:05 | |
I am not waving anything away. I asked about a paper on the specific implementation of OO in Raku. You never answered me. Each language has its own implementation rules. Where are Raku's? | 10:06 | ||
tyil | I answered you to learn the basics of OO | ||
not how Raku has implemented the ideas of OO | |||
10:07
ToddAndMargo left,
pecastro joined,
ToddAndMargo joined
|
|||
ToddAndMargo | Sorry. I got kicked off for some reason. | 10:08 | |
Where are Raku implementation rules for OO? | |||
tyil | pretty sure those are on the docs | 10:09 | |
docs.raku.org/language/classtut | |||
but again, you're completely missing what I'm *actually* saying | |||
stop trying to make huge leaps without prior knowledge | |||
ToddAndMargo | I found that one already. It says it is a tutorial, but it does not define what a class or an object is. It is badly written. This is my definition: | 10:10 | |
"class" is a "container for methods (functions) and properties (variables), and you can create multiple instances [objects] from a single template. The rest (implementation) is language dependant. Also, a class can have *internal* (private) variables that you can only access by way of a method - which means that those | 10:11 | ||
internal variables are not properties (that you can read from and/or write to)." | |||
tyil | it is badly written for someone who doesn't know anything about OO, perhaps | ||
when I started Raku years ago, docs.perl6.org had all the info I needed to do some object oriented programming with it | |||
it has only improved since then | |||
ToddAndMargo | And without link to or explaining how OO is implemented in Raku, it is pretty much useless to anyone that does not already know what they are doing and does not need it. | 10:12 | |
Had you programmed in OO before? | |||
tyil | yes | 10:13 | |
10:13
aborazmeh left
|
|||
ToddAndMargo | Are you religiously opposed to correcting the code I posted? | 10:13 | |
tyil | which goes to show that it doesn't matter how Raku implements OO, you just need to know what OO is and how the concepts work | ||
no, I'm opposed to your mindset | 10:14 | ||
it prohibits you from understanding what you're doing | |||
and in the long term, prohibits you from learning properly | |||
you're trying to sprint a marathon before being able to walk | |||
ToddAndMargo | we all learn in different manners. Reading wikipedia's OO page would not help in with this issue | 10:15 | |
tyil | and then when you fall over, all you say is "no, I want to SPRINT, not WALK" | ||
ToddAndMargo | The only way learn is to dive in. Others learn differently than me. And yes, I do admit I am weird. | ||
tyil | well, if you keep blaming everyone who's trying to help you, and actively ignore what they're saying, I can't help you | 10:16 | |
I don't think anyone here can | |||
ToddAndMargo | Whose it blaming anyone? I sincerely appreciate the help. Even yours | ||
tyil | if you did appreciate it, you would do something with it | 10:17 | |
but you're still just telling me you don't want to learn the basics | |||
ToddAndMargo | how about you posting a link to a good OO tutorial that you think will help with the code I posted? Or you can continue insulting my skill level. Where did you learn OO? | 10:18 | |
Where are the basics? | |||
tyil | www.tutorialspoint.com/What-is-obj...amming-OOP | 10:19 | |
developer.mozilla.org/en-US/docs/L...riented_JS | |||
www.codeproject.com/articles/18610...s-tutorial | |||
10:19
sjm_uk joined
|
|||
tyil | tutorials.supunkavinda.blog/php/oop-intro | 10:19 | |
ToddAndMargo | Thank you. I have some reading to do | 10:20 | |
tyil | just 4 from the top of duck duck go | ||
when searching "object oriented tutorial" | |||
there's books on this | |||
there's talks on this | |||
there's decades of work poured into this | |||
ToddAndMargo | Do you have a favorite link? | ||
tyil | no | ||
tadzik | also, it's notoriously not taught properly :) | ||
tyil | tadzik: that's certainly true | 10:21 | |
the "best" OO info I got was at university | |||
tadzik | I always had it explained to me as "classes are like structs, but they also have functions in them", since it was a logical consequence of complexity after learning C, I suppose | ||
and what taught me the most about it was hanging around then-Perl6 people who actually understood what it's for, rather than what it's made of :P | 10:22 | ||
tyil | tadzik: a struct with function references is the most basic way you can do it in C iirc | ||
10:22
warriors left
|
|||
ToddAndMargo | We were doing machine coding on 8080's when I was at university. Fortran was the go to language | 10:22 | |
tadzik | tyil: or just have similarly named functions operating on plain structs, which is like Gtk does this afaik | ||
tyil | but the language-specific implementation is mostly irrelevant here | ||
tadzik | indeed | ||
the fun part is the idea that makes you think of objects in your program as sets of operations that abstract away some data, so that the data structures themselves become mostly irrelevant | 10:23 | ||
it's the switch from "what is it made of" to "what does it do, somehow" | |||
for me anyway | |||
and then you have Perl and Raku that hit it off with "your attributes and your interface are two sides of the same coin and we're making it as easy as possible to disregard the difference" and argh, but I've ranted about that before :P | 10:24 | ||
tyil | coming from (mostly) php, Raku is not all that different in how I'd do things | 10:25 | |
when it comes to OO design, at least | |||
it still adheres to the methodology pretty well, so if you know that, all you need to read is the class tutorial on docs.raku.org | 10:26 | ||
10:27
stoned75 left
10:31
Sgeo left
|
|||
tyil | ToddAndMargo: www.youtube.com/results?search_que...rogramming there's a bunch more potential things here, even a 40 minute talk from MIT | 10:32 | |
ToddAndMargo | thank you | 10:33 | |
Thank you all for the tips! I am calling it a night. | 10:45 | ||
10:45
ToddAndMargo left
|
|||
El_Che | rakudo-pkg: all distro's look ok, except FPM on ubuntu 20.04. I'll release the packages whem I fix that | 10:55 | |
lizmat | El_Che++ | 10:56 | |
10:59
Black_Ribbon left
11:09
leont joined
11:12
Doc_Holliwood left
11:22
brtastic joined
11:50
brtastic left,
brtastic joined
12:46
jmchael joined
12:56
sjm_uk left
12:57
domidumont joined
13:08
Altai-man joined
13:11
sena_kun left
13:19
MasterDuke left
13:43
sjm_uk joined
14:12
domidumont left
14:14
simcop2387 left
14:31
domidumont joined
14:32
camelCaser left
14:37
camelCaser joined
14:42
rindolf left
14:49
mowcat joined
14:50
sjm_uk left
14:52
simcop2387 joined
15:03
parabolize joined
15:22
domidumont left
15:23
pecastro left
15:28
pecastro joined
|
|||
coldpress | Hi, what's the best way to concatenate two 2D arrays horizontally? | 15:32 | |
m: (map {[[&append]] $_}, map *.Array.List, [Z] [[1,2],[3,4]], [[1,2],[3,4]]).say | |||
camelia | ([1 2 1 2] [3 4 3 4]) | ||
15:33
Doc_Holliwood joined
15:36
domidumont joined
15:47
gordonfish left
15:48
fridim left
15:50
sjm_uk joined,
gordonfish joined
15:54
mowcat left
16:03
domidumont left
16:09
Doc_Holliwood left
16:20
domidumont joined,
rindolf joined
16:34
domidumont left
16:41
rindolf left
16:43
domidumont joined
17:04
domidumont left
17:07
rindolf joined
17:09
sena_kun joined
17:10
Altai-man left
17:21
domidumont joined
17:25
redhands joined
17:31
MasterDuke joined
17:40
domidumont left
17:46
maggotbrain left
17:51
Doc_Holliwood joined
18:00
hungrydonkey joined
18:04
redhands left
18:07
lucasb joined
18:22
ex_nihilo left
18:30
xinming left
18:31
xinming joined
18:45
jmerelo joined
|
|||
El_Che | ok, found workaround for ruby ffi | 18:54 | |
so release will happen once built | |||
19:03
xelxebar left,
xelxebar joined
19:04
sjm_uk left
19:10
sjm_uk joined,
samcv_ is now known as samcv
19:11
samcv left,
samcv joined
|
|||
jmerelo | hey, samcv | 19:14 | |
19:24
jmerelo left
19:28
Merfont left
19:29
Kaiepi joined
19:35
benjif joined
19:43
Sgeo joined
19:46
brtastic left
19:47
aborazmeh joined,
aborazmeh left,
aborazmeh joined
19:59
patrickb joined
|
|||
Geth | doc: JustThisGuyAZ++ created pull request #3743: Update Map.pod6 |
20:08 | |
20:24
rindolf left
20:33
xinming left
20:34
xinming joined
20:36
grumble is now known as SeasonsBeatings
20:37
patrickb left
20:51
mowcat joined
20:59
sjm_uk left
21:08
Altai-man joined
21:10
joahim3 joined
21:11
joahim3 left,
sena_kun left
21:17
Altai-man left
21:44
brtastic joined
21:51
brtastic left
22:08
gtodd joined
|
|||
El_Che | weekly: github.com/nxadm/rakudo-pkg/releas...g/v2020.12 | 22:12 | |
notable6 | El_Che, Noted! (weekly) | ||
22:18
xinming left
22:19
xinming joined
23:13
ggoebel left
23:19
aborazmeh left,
cpan-raku left
23:24
cpan-raku joined,
cpan-raku left,
cpan-raku joined
23:29
ggoebel joined
23:41
MasterDuke left
|