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:00
Heptite joined,
discord-raku-bot left
00:01
discord-raku-bot joined
00:04
sgrs left
00:16
discord-raku-bot left
00:32
discord-raku-bot joined
|
|||
gfldex | . | 00:32 | |
00:33
habere-et-disper left
00:43
sgrs joined
00:58
Kaiepi left
01:05
razetime joined
01:29
habere-et-disper joined
02:06
habere-et-disper left
02:12
Guest26 joined
|
|||
Guest26 | Hello! I'm attempting to build a simple hello world for raku and compile it as a jar, but i'm gettin the error "Unknown compilation target 'jar'". I am compiling my code with "raku --target=jar test.raku". I am running this on macOS 12.4 (Monterrey) and installed raku via homebrew | 02:16 | |
also, is there any documentation about raku-on-jvm generally? i have been struggling to find any | 02:23 | ||
02:33
sgrs left
03:04
Guest2668 joined
03:06
Guest2668 left,
ToddAndMargo left
03:12
Kaiepi joined
03:21
Guest26 left
03:53
Guest26 joined
04:25
razetime left
05:07
Heptite left
05:46
Guest26 left
09:44
Kaiepi left
|
|||
Nemokosch | Hello. I'm afraid you cannot synthesize standalone (quasi) executables with Rakudo | 09:55 | |
09:57
discord-raku-bot left
09:58
discord-raku-bot joined
10:05
Kaiepi joined
13:02
razetime joined
13:17
razetime left
13:25
razetime joined
13:43
habere-et-disper joined
14:39
sgrs joined
15:01
Heptite joined
15:31
razetime left
15:40
razetime joined
15:53
razetime_ joined,
razetime left
17:01
Kaiepi left
17:06
Kaiepi joined
17:14
Kaiepi left
17:15
razetime_ left
|
|||
habere-et-disper | How do I make a grammar return False instead of Nil? Trying to catch it in `actions` is too late, and I don't know what method (or phaser?) to use to do this inside the grammar. | 18:00 | |
Anton Antonov | Just you `so`. | 18:01 | |
E.g. `so Parser.parse('I love Croku')`. | 18:02 | ||
Just use `so`. | 18:03 | ||
habere-et-disper | The grammar is returning a bag, and an empty bag is valid too. So we have multiple falsy values that can be returned from the grammar. I only want complete grammar failure (ie Nil) to return False, everything else is fine to pass on. I thought his would be easier to do inside the grammar? | 18:07 | |
I am using an action and .made so the grammar is returning useful things I don't want cast into Boolean. | 18:09 | ||
(Unless Nil.) | |||
I have it working with `.parse( $source, actions => ... ).made // False` and I'm wondering if that False bit could go into the grammar? | 18:11 | ||
Anton Antonov | Where I can see your code? Can you post it here? Is it in some repository? | ||
habere-et-disper | Sure -- it's on Exercism. Thanks for taking a look -- I really appreciate it! :-) | 18:16 | |
exercism.org/tracks/raku/exercises...dispertire | |||
Anton Antonov | I am sorry, I cannot copy-&-paste that code. Please post it here. | 18:23 | |
18:27
Kaiepi joined
|
|||
habere-et-disper | gist.github.com/habere-et-disperti...35780e4afa | 18:33 | |
Raw (for copy&paste): | 18:36 | ||
gist.githubusercontent.com/habere-...ifier.raku | |||
Nemokosch | what does the argumentless flat do? | 18:54 | |
Kaiepi | the args are on the next line | 19:01 | |
no semicolon | |||
Nemokosch | no semicolon indeed but I wouldn't have expected this to be parsed like arguments | 19:05 | |
habere-et-disper | I know -- more raku magic! | 19:08 | |
Nemokosch | I don't know, I can't read those lines | 19:10 | |
habere-et-disper | It's the algorithm for calculating the isbn, which is taking the digits from the grammmar. There are two cases: straight ten digits, or nine with an X which we have to turn into a ten. | 19:13 | |
It's the `// False` bit at the end that I thought I could add to the grammar with a method. I'm adjusting the code from the book I have _Raku Fundamentals_. You can read that approach here: | 19:20 | ||
github.com/Apress/raku-fundamental...-ini/09.p6 | |||
Nemokosch | are you sure you want Z* ? | 19:42 | |
I don't know. Overall, the whole code is unrelatable for me. I think I also tried this task a while back, and I concluded I didn't want to do tasks that are improperly specified yet expect you to match their vague testing. | 19:46 | ||
habere-et-disper | I'm keen to hear about alternative approaches. What do you suggest in place of Z*? | 20:01 | |
How can I make this more relatable? | 20:02 | ||
Nemokosch | No idea, to be honest. I don't know what this is meant to be, and I remember I was absolutely dissatisfied with the specification of the task anyway. | ||
habere-et-disper | I have found it trying too. It's not setup for the beginner and that's where I'd like to see fundamental changes into a somatic approach to programming. Has anyone experienced dynamicland? | 20:11 | |
dynamicland.org/ | |||
Anton Antonov | @habere-et-disper Thanks for asking the ISBN grammar questions. I used that grammar to make test for my random sentence generator. | 20:12 | |
habere-et-disper | You're welcome ! :) What does your random sentence generator look like? | 20:16 | |
Anton Antonov | ``` | ||
> random-sentence-generation "grammar ISBN { | |||
token TOP { <tenner> | <niner-xray> } | |||
token tenner { [ <digit> '-' ? ] ** 10 } | |||
token niner-xray { [ <digit> '-' ? ] ** 9 X } | |||
}" --sep='' | tr -d 'DIGIT(' | tr -d ')' | |||
1-0-9-7-6-4-3-4-6-X | |||
5016122430 | |||
4-4-0-3-2-4-4-5-6-7- | |||
9-9-5-1-8-7-0-7-0-6- | |||
4-1-0-8-3-8-2-3-7-X | |||
4-5-9-3-1-2-6-5-8-X | |||
9112468149 | 20:17 | ||
6-8-0-9-7-7-1-1-5-5- | |||
5-5-4-5-2-7-1-7-8-0- | |||
8-8-3-4-6-4-3-6-0-5- | |||
``` | |||
habere-et-disper | Is this as a BASH script? | 20:23 | |
21:00
NemokoschKiwi joined
21:09
NemokoschKiwi left
21:37
sgrs left
21:41
discord-raku-bot left
21:42
discord-raku-bot joined
22:40
sgrs joined
23:38
habere-et-disper left
|