🦋 Welcome to the MAIN() IRC channel of the Raku Programming Language (raku.org). This channel is logged for the purpose of keeping a history about its development | evalbot usage: 'm: say 3;' or /msg camelia m: ... | Log inspection is getting closer to beta. If you're a beginner, you can also check out the #raku-beginner channel!
Set by lizmat on 25 August 2021.
atweiden_air-- m: role A { has $.a = prompt('a: ') }; role B does A { has $.b = prompt('b: ') }; class AA does A { submethod TWEAK() { say('AA.TWEAK') } }; class AB is AA does B { submethod TWEAK() { say('AB.TWEAK') } }; AB.new.raku.say; 02:20
camelia a: AA.TWEAK
b: a: AB.TWEAK
AB.new(b => " »Um die siebente Stund‘, am Brückendamm.«", a => " »Am Mittelpfeiler.«", a => "»Wann treffen wir drei wieder zusamm?«")
atweiden_air-- why does this prompt twice?
2 repetitive rounds, i mean
m: role A { has $.a = prompt('a: ') }; role B does A { has $.b = prompt('b: ') }; class AA does A {}; class AB is AA does B {}; AB.new.raku.say; 02:22
camelia a: b: a: AB.new(b => " »Um die siebente Stund‘, am Brückendamm.«", a => " »Am Mittelpfeiler.«", a => "»Wann treffen wir drei wieder zusamm?«")
atweiden_air-- m: role A { has $.a = prompt('a: (Str)') }; role B does A { has $.b = prompt('b: (Str)') }; class AA does A {}; class AB is AA does B {}; AB.new.raku.say;
camelia a: (Str)b: (Str)a: (Str)AB.new(b => " »Um die siebente Stund‘, am Brückendamm.«", a => " »Am Mittelpfeiler.«", a => "»Wann treffen wir drei wieder zusamm?«")
atweiden_air-- I want to TWEAK() $!a in AB 02:26
this is fine, but repeats twice
m: role A {has $.a = prompt 'a (Str): '}; role B does A {has $.b = prompt 'b (Str): '}; class AA does A {}; class AB is AA does B {submethod TWEAK() {$!a = False}}; AB.new.raku.say;
camelia a (Str): b (Str): a (Str): AB.new(b => " »Um die siebente Stund‘, am Brückendamm.«", a => Bool::False, a => "»Wann treffen wir drei wieder zusamm?«")
atweiden_air-- not fine, $!a not declared in class AB 02:27
m: role A {has $.a = prompt 'a (Str): '}; role B {has $.b = prompt 'b (Str): '}; class AA does A {}; class AB is AA does B {submethod TWEAK() {$!a = False}}; AB.new.raku.say;
camelia ===SORRY!=== Error while compiling <tmp>
Attribute $!a not declared in class AB
at <tmp>:1
------> does B {submethod TWEAK() {$!a = False}}⏏; AB.new.raku.say;
expecting any of:
horizontal whitespace
postf…
atweiden_air-- DWIM without TWEAK() 02:28
m: role A {has $.a = prompt 'a (Str): '}; role B {has $.b = prompt 'b (Str): '}; class AA does A {}; class AB is AA does B {}; AB.new.raku.say;
camelia a (Str): b (Str): AB.new(b => " »Um die siebente Stund‘, am Brückendamm.«", a => "»Wann treffen wir drei wieder zusamm?«")
atweiden_air-- m: role A {has $.a = prompt 'a (Str): '}; role B does A {has $.b = prompt 'b (Str): '; submethod TWEAK() {$!a = False}}; class AA does A {}; class AB is AA does B {}; AB.new.raku.say; 02:29
camelia ===SORRY!=== Error while compiling <tmp>
Attribute $!a not declared in role B
at <tmp>:1
------> tr): '; submethod TWEAK() {$!a = False}}⏏; class AA does A {}; class AB is AA doe
expecting any of:
horizontal whites…
CIAvash atweiden_air--: `AB` does not have the `$!a` attribute, `AA` does, so it can access it via `$.a`. You can do at least three things: 1. make `$.a is rw`, and in AB do `$.a =False`. 2. move `TWEAK` method inside `AA`. 3. Avoid inheritance and do `class AB does B does A { method TWEAK { $!a = false } }`. 06:38
atweiden_air--: But I think it's best not to use prompt in attributes, and leave it inside `TWEAK`: `role R {has $.a; has $.b; method TWEAK { self!prompt_a; self!prompt_b; }; method !prompt_a { $!a = prompt 'a (Str): ' }; method !prompt_b { $!b = prompt 'b (Str): ' } }; class A does R {}; A.new.raku.say;` 06:39
atweiden_air--: or if you want to override things: `role R {has $.a; has $.b; method TWEAK { self!prompt_a; self!prompt_b; }; method !prompt_a { $!a = prompt 'a (Str): ' }; method !prompt_b { $!b = prompt 'b (Str): ' } }; class A does R { method TWEAK { self!prompt_b } }; A.new.raku.say;` 06:41
lizmat .tell Xliff please, if you notice any changes, please make an issue. A workaround is nice, but if we don't know about issues, they continue to exist :-( 08:12
phil1 Hello, I am trying to translate Dough Hoyte's football-game macro (cf. Let Over Lambda, p. 77), to Raku. 09:10
Here's my first attempt.
Uploaded file: uploads.kiwiirc.com/files/b48d7dc3...pasted.txt
When I run it, I get this message: "expecting any of: argument list" 09:12
Sorry, my uploaded file doesn't containt "use experimental :macros;". 09:13
Are macros within macros allowed in Raku? 09:14
And here's the original Lisp code: 09:15
Uploaded file: uploads.kiwiirc.com/files/7a0b9047...pasted.txt
phil1 Hello, I found a solution without macros. 09:26
Uploaded file: uploads.kiwiirc.com/files/4827162b...pasted.txt
Please ignore my question.
atweiden_air-- CIAvash i’ll take a look when i get a moment. thanks 12:22
Manifest0 Hi! 13:41
When we define a main function like "sub MAIN(Int $v)" shouldn't the type constraint be enforced when we invoke from the command line (in this example, shouldnt $v be Int and not IntStr)?
lizmat m: dd IntStr ~~ Int 13:42
camelia Bool::True
lizmat that's why an Int is also ok
Manifest0 m: dd IntStr ~~ Str 13:43
camelia Bool::True
Manifest0 This is problematic if i'm passing them to a new multi function 13:44
Manifest0 example: 13:47
Ambiguous call to 'sqlite3_bind(DBDish::SQLite::Native::STMT, Int, IntStr)'; these signatures all match:
(DBDish::SQLite::Native::STMT $stmt, Int $n, Int:D $i)
(DBDish::SQLite::Native::STMT $stmt, Int $n, Str:D $d)
(DBDish::SQLite::Native::STMT $stmt, Int $n, Real:D $d) 13:48
:-(
nine Manifest0: $v.Int 15:35
Or maybe declare it as sub MAIN(Int() $v) 15:36
hhcryfqnut syntax question: 16:43
stackoverflow.com/questions/718099...es-in-raku
lizmat hhcryfqnut: answered it 16:56
hhcryfqnut thanks! 17:09
lizmat you're welcome :-)
melezhik Hi community! I have dropped future design of SparkyCI - github.com/melezhik/sparkyci/blob/...ocs/dsl.md , would appreciate for comments 17:40
lizmat melezhik: perhaps also post on reddit ? 17:54
melezhik @lizmat, yeah maybe ... just decided to start with irc first ...
Still not sure where people visit more ... 17:55
Geth doc: dd2c13d77d | (Elizabeth Mattijsen)++ (committed using GitHub Web editor) | doc/Language/exceptions.pod6
Some tweaks on CATCH (#4050)

  * Some tweaks on CATCH
In resoponse to github.com/Raku/doc/issues/4049
  * typo
... (7 more lines)
19:10
linkable6 Link: docs.raku.org/language/exceptions