🦋 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.
Geth doc: b8015f0e45 | (Tom Browder)++ (committed using GitHub Web editor) | doc/Language/glossary.pod6
specify the required quoting contructs
00:21
linkable6 Link: docs.raku.org/language/glossary
Geth doc: 950f1c252c | (Tom Browder)++ (committed using GitHub Web editor) | doc/Type/Real.pod6
make a bit clearer where rounding takes place
12:14
linkable6 Link: docs.raku.org/type/Real
uzl[m] In Scheme, you can make a distinction between simple data types (booleans, numbers, etc.) and compound data types (vectors, lists, etc.). Does such a distinction make sense in Raku? 13:51
moritz you can make such distinctions 13:56
does it make sense? depends on what you want to do with it
uzl[m] I guess I meant it from a conceptual (and/or possible pedagogical) viewpoint: You've these simple and indivisible data types on one hand and these other compound data types created by combining other data types on the other. 14:05
moritz yes, that kinda makes sense 14:16
Altai-man_ uzl[m], imo, this distinction is bad (from pedagogical point of view), because 1)everything is object; 2)it is is not an object, thus native, it is a bit more advanced for total novices to think about. 14:27
I mean, you can say that List is complex and Int is simple, but it'd be classification for classification which kind of hides the idea they are the same kind of thing 14:28
in lisps, as far as I know, some things are atoms (evaluated to themselves), but in raku you can do `1 but False` and boom. 14:30
rypervenche Can I use an object as a Type constraint in my subroutine? If so, how do I use it? 15:25
err, class rather, not object. I'm still very new to OOP. 15:26
leont Not sure I get the question
rypervenche I'm changing an array of hashes to an array of objects in a script. I'd like to make sure that the return type in a function is a specific object. My wording my be wrong. 15:27
lucasb sub foo(SomeType $obj) {...} # like this?
Altai-man_ m: class A {}; sub (A $foo) { say $foo };
camelia WARNINGS for <tmp>:
Useless use of anonymous sub, did you forget to provide a name? (line 1)
Altai-man_ m: class A {}; sub a(A $foo) { say $foo }; a(A.new);
camelia A.new
lucasb sub foo(--> SomeType) {...} # then, like this maybe 15:28
rypervenche sub dmenu ( Protocol:D @input, Str $prompt ) --> Protocol { }; Something like this.
Protocol is my class.
Altai-man_ you can surely do it
rypervenche Hmm, maybe I did something wrong then. I'll look into it. 15:30
Ahh, my --> wasn't inside the parentheses. 15:31
leont You can also use sub foo() returns Bar {} 15:36
rypervenche Got it. :) 16:30
Do :D and :U work with objects as well?
leont They work in any type declaration 16:44
Not sure exactly how you mean this
rypervenche I guess, does it make sense that an object can be defined or undefined? 16:46
Or is an object by definition defined? 16:47
Or does that nomenclature not even work for objects and classes?
lizmat rypervenche: you saw my GPaRW presentation? 16:49
rypervenche lizmat: Yes. That was the one I was referring to :) 16:50
lizmat then you should know that an object is an instantiation of a class, and a class is a type ?
rypervenche I understand that. I just didn't know if :D and :U could fit into the equation anywhere, for example when specifying return types. 16:52
Xliff m: my $a = 0; my @a = ( ($a += 2), 1 ); @a.say;
leont It can make sense to use them there, yes
camelia [2 1]
lizmat ok, :U is for types, :D is for objects, :_ is don't care 16:53
rypervenche Ahhhh
lizmat originally from "Undefined" and "Defined"
rypervenche THat makes perfect sense then.
El_Che lizmat: book? (watching the q&a) 17:41
lizmat yeah... :-) 17:42
Doc_Holliwood m: say (1, 1, * + * ... Inf)[1000000] 20:00
camelia MoarVM panic: Memory allocation failed; could not allocate 64 bytes
rypervenche Note to self: Don't run that command again on my little laptop. 20:07
Doc_Holliwood did it freeze your system? 21:02
rypervenche Yeah, ate up all my RAM. 21:30