🦋 Welcome to the former MAIN() IRC channel of the Raku Programming Language (raku.org). This channel has moved to Libera (irc.libera.chat #raku) Set by lizmat on 23 May 2021. |
|||
00:02
_ed joined
00:03
reportable6 left
00:05
reportable6 joined
00:08
_ed left
00:23
_ed joined
00:25
casaca joined
00:27
_ed left
00:29
_ed joined
00:33
_ed left
00:39
_ed joined
00:44
_ed left
00:55
_ed joined
01:01
_ed left
01:04
_ed joined
01:09
_ed left
01:11
rassoc joined,
_ed joined
|
|||
japhb | Anyone know if there's a generic document tree module for Raku? I'm looking for something where I can build up a tree of DOM-like nodes, and then have multiple renderers to turn that tree into different output formats (which may not be text files, but could also be binary streams, immediate mode GUI output, etc.). | 01:13 | |
Looking at e.g. the available Markdown modules shows that they all assume they're going to produce HTML output, and don't allow just semantically saying "This is a document with a title, made out of sections, each of which has a header and some content, which is built of blocks that might be paragraphs or tables or lists, ..." | 01:15 | ||
It's not a conceptual pain to make one, but I'd rather avoid creating Yet Another Way To Do It if there's something good already out there. | |||
01:19
_ed left
01:23
rassoc left
01:26
_ed joined
01:30
_ed left
01:35
_ed joined
01:39
_ed left
01:41
_ed joined
01:46
_ed left
01:49
_ed joined
01:53
_ed left
02:03
_ed joined
02:09
_ed left
02:11
bd3i joined
02:22
_ed joined
02:27
_ed left
02:37
monkey_ joined
02:56
_ed joined
03:00
_ed left
03:07
_ed joined
03:11
_ed left
|
|||
moon-child | japhb: i mean, that sounds kind of like pod6 | 03:14 | |
03:24
_ed joined
03:29
_ed left
03:31
_ed joined
03:39
_ed left
03:41
monkey_ left
04:05
_ed joined
04:09
_ed left
04:15
perlbot left,
simcop2387 left
04:32
ttubrian joined
04:33
bd3i left
04:34
ttubrian left
04:39
Doc_Holliwood joined
05:13
Doc_Holliwood left,
_ed joined
05:14
neshpion left
05:17
_ed left
05:22
Doc_Holliwood joined
05:29
_ed joined
05:33
_ed left
05:42
Eddward left
05:43
ufobat joined,
perlbot joined
05:45
simcop2387 joined
05:48
_ed joined
05:53
_ed left
06:02
reportable6 left
06:05
reportable6 joined
06:10
_ed joined
06:16
_ed left
06:17
lucerne joined
06:39
flareon joined
06:42
flareon left
06:43
flareon joined
06:52
ecocode_ left
07:01
flareon left
07:05
_ed joined
07:09
_ed left
|
|||
japhb | moon-child: Hmmmm, that's actually a decent point. I wonder if it has a decent API for just building up programmatically (as opposed to parsing Pod). | 07:13 | |
07:15
_ed joined
07:19
Doc_Holliwood left,
_ed left
|
|||
raydiak | m: my $p = Pod::Block::Para.new; $p.contents = "foo"; use Pod::To::Text; say pod2text $p | 07:32 | |
camelia | foo | ||
07:40
ecocode joined
07:44
flareon joined
07:49
_ed joined
07:54
_ed left
07:57
flareon left
07:58
flareon joined
08:05
_ed joined
08:07
Sgeo left
08:09
_ed left
08:21
_ed joined
08:26
_ed left,
flareon left
08:43
ecocode left
08:54
MoC joined
09:04
_ed joined
09:08
_ed left
09:44
ecocode joined
09:46
_ed joined
09:47
ComplYue[m] joined
09:50
_ed left
10:01
_ed joined
10:05
_ed left
10:22
Doc_Holliwood joined
10:28
tyil[m] left,
ComplYue[m] left
10:30
juanfra joined
10:35
demostanis[m] joined,
cnx joined,
AlexDaniel joined,
ComplYue[m] joined,
littlebenlittle[ joined,
tyil[m] joined,
CIAvash joined
10:48
_ed joined
10:55
_ed left
11:07
_ed joined
11:09
neula joined
11:12
_ed left
|
|||
lizmat | weekly: www.reddit.com/r/rakulang/comments...generator/ | 11:20 | |
notable6 | lizmat, Noted! (weekly) | ||
11:56
_ed joined
12:00
_ed left
12:02
reportable6 left
12:03
reportable6 joined
12:08
_ed joined
12:13
_ed left
13:00
_ed joined
13:01
guifa left
13:04
_ed left
13:05
slu joined
13:17
_ed joined
13:27
_ed left
13:28
Sgeo joined
13:41
_ed joined
13:46
_ed left
13:51
tejr left
13:52
tejr joined
13:57
elcaro left,
elcaro joined
14:01
RandalSchwartz left
14:03
RandalSchwartz joined
14:07
RandalSchwartz left
14:17
abraxxa left,
dogbert17 left,
_ed joined
14:22
_ed left
14:34
_ed joined
14:37
ufobat left
14:38
_ed left
14:49
_ed joined
14:51
eseyman left
14:53
_ed left
14:56
melezhik joined
|
|||
melezhik | . | 14:56 | |
14:56
eseyman joined
15:05
frost left,
_ed joined
15:09
_ed left
15:21
ufobat joined
15:34
MoC left
|
|||
cnx | hi, is there a way to supply a sub directly for the where clause? | 15:39 | |
15:44
Eddward joined
|
|||
lizmat | m: sub a($a -->True) { dd $a }; sub b($a where &a) { }; a 42 # cnx | 15:44 | |
camelia | 42 | ||
cnx | thanks! | 15:45 | |
lizmat | meh, that doesn't do what one expects | ||
m: sub a($a --> False) { dd $a }; sub b($a where &a) { }; a 42 | |||
camelia | 42 | ||
lizmat | hang on | ||
cnx | does where apply ~~? | 15:46 | |
I cannot seem to find the relevant documentation on what should be valid | |||
lizmat | no, it does work.. if you call the right sub :-) | ||
m: sub a($a --> True) { dd $a }; sub b($a where &a) { dd }; b 42 | 15:47 | ||
camelia | 42 sub b($a where { ... }) |
||
lizmat | m: sub a($a --> False) { dd $a }; sub b($a where &a) { dd }; b 42 | ||
camelia | Cannot resolve caller ACCEPTS(Sub+{Callable[Bool]}:D: Int:D); none of these signatures match: (Mu:U: Mu \topic, *%_) (Mu:U \SELF: Junction:D \topic, *%_) in sub b at <tmp> line 1 in block <unit> at <tmp> line 1 |
||
cnx | ^ this is what I got and why I asked, but I wasn't sure if it was my bug | ||
15:48
_ed joined
|
|||
lizmat | what does the sub specified in the where return? It should be something trueish to make dispatch work | 15:49 | |
cnx | this was it: | 15:50 | |
sub valid(Str:D $names --> Bool:D) { so /^\w+$/ && 2 < .chars == .comb.unique.elems given $names } | |||
when I used where { valid $_ } it works but it looks verbose | |||
15:51
donaldh joined
15:52
_ed left
|
|||
tonyo | you can use where &valid | 16:05 | |
m: sub valid(Str:D $names --> Bool) { so /^\w+$/ && 2 < .chars == .comb.unique.elems given $names }; sub r($x where &valid) { $x.say }; r "abc"; r "a"; | |||
camelia | abc Constraint type check failed in binding to parameter '$x'; expected anonymous constraint to be met but got Str ("a") in sub r at <tmp> line 1 in block <unit> at <tmp> line 1 |
||
16:06
_ed joined
|
|||
tonyo | m: sub valid(Str:D $names --> Bool) { so /^\w+$/ && 2 < .chars == .comb.unique.elems given $names }; sub r($x where &valid) { $x.say }; r "abc"; | 16:07 | |
camelia | abc | ||
cnx | why did specifying Bool:D instead causing the problem? | 16:10 | |
16:10
_ed left
|
|||
moritz | looks like a bug to me | 16:11 | |
16:33
donaldh left
16:37
_ed joined
16:42
_ed left
|
|||
cnx | this gets weirder when used with MAIN, it just consumes the #= doc | 16:47 | |
17:05
_ed joined
17:09
_ed left
17:11
_ed joined
17:14
ufobat left
17:15
_ed left
17:25
_ed joined
17:33
_ed left
17:38
neshpion joined,
chronon joined
18:02
reportable6 left
18:05
reportable6 joined
18:07
_ed joined
18:12
_ed left
18:21
dogbert17 joined
18:24
_ed joined
18:29
_ed left
18:31
Guest86 joined
18:33
Guest86 left
18:43
_ed joined
18:48
_ed left
18:54
_ed joined
18:58
_ed left
19:00
_ed joined
19:07
_ed left,
_ed joined
19:12
_ed left
19:13
_ed joined
19:21
anony_mouse joined
19:23
_ed left
19:37
_ed joined
19:45
_ed left
19:47
_ed joined
19:52
Guest73 joined,
_ed left,
Guest73 left
20:01
RandalSchwartz joined
20:05
_ed joined
20:10
_ed left
20:23
_ed joined
20:27
_ed left
20:50
neula left
21:10
_ed joined
21:15
_ed left
21:17
_ed joined
21:22
_ed left
21:28
jess joined
21:33
melezhik left
21:39
_ed joined
21:43
_ed left
21:53
_ed joined
21:58
_ed left
22:07
_ed joined
22:11
_ed left
22:24
m6502 joined
22:30
_ed joined
22:39
_ed left
22:51
_ed joined
22:55
_ed left,
Doc_Holliwood left
23:04
_ed joined
23:09
_ed left
23:13
_ed joined
23:16
m6502 left
23:18
_ed left
23:24
_ed joined,
melezhik joined
|
|||
melezhik | weekly: www.reddit.com/r/rakulang/comments...s_with_r3/ | 23:24 | |
notable6 | melezhik, Noted! (weekly) | ||
23:30
melezhik left,
sono joined
23:32
sono left
23:35
_ed left
|