pelevesque |
Ya, they totally could be. |
00:36 |
|
|
That has been my problem since I started working on that algorithm. |
|
|
scullucs |
I think I have something. |
00:37 |
|
|
Gimme a couple of minutes. |
|
|
|
It works! |
00:39 |
|
|
After fighting for the last hour with s:pos(...), I finally figured out I needed s:continue(...). |
00:40 |
|
|
I'll put it in a gist (another few minutes). |
00:41 |
|
|
gist.github.com/lucs/aa34b9a6d6058...c0fd9b6138 |
00:44 |
|
pelevesque |
Geez lucs, I feel bad you spent so much time on this. |
00:45 |
|
scullucs |
Don't, because again, I learned something. |
|
|
pelevesque |
I'm gonna test it now, with repeating numbers too ( I noticed your test does not cover that case ). BTW, beautiful code as always. |
00:46 |
|
scullucs |
I'm pretty confident it'll be fine. (uh oh, setting myself up for "famous last words"?) |
00:47 |
|
pelevesque |
I didn't know about that c/continue adverb. Pretty sweet. |
00:48 |
|
scullucs |
Me neither 😠|
00:50 |
|
pelevesque |
It works. I just need to modify it to accept negative digits, but that is easy, just change the regex. I'm good to go. |
00:51 |
|
|
I tried with the A.I. a bunch of questions, but it never brought up c/continue at all. |
|
|
scullucs |
AI, shma-i. |
|
|
pelevesque |
It ain't all that smart. |
00:52 |
|
|
The A.I. Just told me Larry Wall is working on Perl 11 |
00:54 |
|
scullucs |
Heh. |
00:55 |
|
pelevesque |
An experimental language... 5 + 6 = 11 |
|
|
|
perl11.github.io |
00:56 |
|
scullucs |
They even have SPVM in there 🙂 |
00:59 |
|
pelevesque |
Ah, I had not noticed. It's a language. |
01:03 |
|
wambash |
m: my $orig-text = q:to{---} My number is 4, and another 3.2 and 4 again, and also 0 2 and 1.3 --- ; $orig-text.subst: /\d+[.\d+]? /, q{%s},:g andthen printf $_, (2.2, 0, 4, 4.4, 2, 0) |
05:02 |
|
Raku eval |
My number is 2.2, and another 0 and 4 again, and also 4.4 2 and 0 |
|
|