This channel is intended for people just starting with the Raku Programming Language (raku.org). Logs are available at irclogs.raku.org/raku-beginner/live.html
Set by lizmat on 8 June 2022.
00:05 kjp left 00:37 kjp joined 01:53 deoac joined
deoac The docs describe `.fmt` for type/Cool: "[fmt is the] equivalent to calling sprintf with $format as format and the invocant as the second argument." 02:00
m: printf('There are %d %s in a %s', 52, 'cards', 'deck') 02:01
camelia There are 52 cards in a deck
deoac m: (52, 'cards', 'deck').fmt('There are %d %s in a %s')
camelia Your printf-style directives specify 3 arguments, but 1 argument was supplied
in block <unit> at <tmp> line 1
deoac Is the documentation inaccurate? 02:02
02:28 deoac left 04:06 teatwo joined 04:09 tea3po left 04:37 razetime joined 05:31 siavash joined 05:55 razetime left 06:01 razetime joined 06:36 razetime left 07:28 ab5tract joined
gfldex m: (deoac).fmt('% asked a question.'); 08:07
camelia ===SORRY!=== Error while compiling <tmp>
Undeclared routine:
deoac used at line 1
gfldex m: <deoac>.fmt('% asked a question.'); 08:08
camelia ' asked a question.' is not valid in sprintf format sequence '% asked a question.'
in block <unit> at <tmp> line 1
gfldex m: <deoac>.fmt('%s asked a question.');
camelia ( no output )
gfldex This is what „as the second argument“ means.
m: <a b c>.fmt('%s %s %s'); 08:09
camelia Your printf-style directives specify 3 arguments, but 1 argument was supplied
in block <unit> at <tmp> line 1
gfldex It would make sense to | the argument when called on a list.
m: Slip.new(<a b c>).fmt('%s %s %s'); 08:10
camelia Your printf-style directives specify 3 arguments, but 1 argument was supplied
in block <unit> at <tmp> line 1
08:18 tea3po joined 08:21 teatwo left
gfldex m: \('a', 'b', 'c').fmt('%s %s %s'); 08:32
camelia Cannot resolve caller fmt(Capture:D, Str:D); Routine does not have any candidates. Is only the proto defined?
in block <unit> at <tmp> line 1
08:49 wafflus joined
siavash m: say <a b c>.fmt: '%s', ', ' 09:12
camelia a, b, c
siavash deoac: You are using `fmt` method on a list: docs.raku.org/type/List#method_fmt 09:13
10:07 wafflus left 12:21 siavash left, siavash joined 12:25 razetime joined 13:22 siavash left 18:05 razetime left 20:19 teatwo joined 20:22 tea3po left 20:38 habere-et-disper joined
habere-et-disper Why can I write : 20:46
m: say <Hello, World!>.antipairs.Hash{ 'World!' }
camelia 1
habere-et-disper But not as a method chain over 2 lines ?
m: (<Hello, World!>.antipairs 20:56
camelia ===SORRY!=== Error while compiling <tmp>
Unable to parse expression in parenthesized expression; couldn't find final ')' (corresponding starter was at line 1)
at <tmp>:1
------> (<Hello, World!>.antipairs⏏<EOL>
expecting any…
habere-et-disper                 .Hash{ 'World!' }).raku
How do I ask Camelia to take a line break ? 20:57
lizmat m: say "foo";␤ say "bar" 22:28
camelia foo
bar
lizmat habere-et-disper: ^^^ add a ␤ to your expression, and camelia will change that to a \n in your code 22:29
habere-et-disper So like : 22:30
m: m: <Hello, World!>.antipairs␤.Hash{ 'World!' }
camelia ===SORRY!=== Error while compiling <tmp>
Unexpected block in infix position (missing statement control word before the expression?)
at <tmp>:2
------> .Hash⏏{ 'World!' }
expecting any of:
infix
infix stop…
habere-et-disper Is that expected behaviour ? I was surprised. 22:32
lizmat habere-et-disper: looks like you found a grammar bug 22:34
habere-et-disper Okay -- thanks.
lizmat please file an issue for it :-) 22:35
grammar bugs have become very rare the past years :-) 22:36
habere-et-disper Sure -- in rakudo/rakduo ? 22:42
lizmat yes, please 22:50
habere-et-disper github.com/rakudo/rakudo/issues/5369 23:02
23:33 habere-et-disper left