|
02:20
sibl joined
04:15
sibl left
|
|||
| disbot11 | <jubilatious1_98524> ~ % raku -e 'flat (1,3,2).rotor: 3 => -2 andthen say ( * < * > * )(|$_) ;' True | 04:20 | |
|
05:06
stanrifkin joined
06:55
stanrifkin left
07:30
stanrifkin joined
07:59
sibl joined
08:10
atcroft left
08:25
atcroft joined
08:55
sibl left
|
|||
| disbot11 | <librasteve> ^^ nice ... OK if I use for the weekly Tips N Tricks? | 09:55 | |
|
11:28
habere-et-disper joined
|
|||
| disbot11 | <rcmlz> I needed someone to explain this code to me: chatgpt.com/share/69638aa3-739c-80...77f5333116 | 11:36 | |
| <rcmlz> This is a very Raku-ish one-liner expressing: “Does this list form a local maximum?” Or, more generally (for longer lists): “Do the rotor windows represent a peak pattern?” If you want, I can show a more idiomatic multi-element version or rewrite it in a more readable teaching style. | |||
| <rcmlz> I assume that ChatGPT got it right? | |||
| <rcmlz> I am wondering if this neat solution for "Does this list form a local maximum?" can also be evolved to an parallel solution - just in case the list under test is very, very long ... | 11:42 | ||
| <librasteve> looks like ChatGPT is stretching the definition of local max ... the window is only 3 wide (you can imagine that a proper test for local max would be more noise resistent) | 11:45 | ||
| <rcmlz> I see, it only works with 3 elements lists? But then I do not understand it ... | 11:47 | ||
| <rcmlz> So that one fails: raku -e 'flat (1,3,7,39,5,-1,-5).rotor: 3 => -2 andthen say ( * < * > * )(|$_) ;' | 11:48 | ||
| <rcmlz> But if it only works for 3-element-lists, then there are probably easier ways to find out, if this list forms a local maximum. | 11:50 | ||
| habere-et-disper | m: [RZ] (1,2),(3,4) | 11:51 | |
| Here the R seems to borrow the implicit comma list constructor from Z, but then refuses to do the same in infix form, requiring: | |||
| camelia | Potential difficulties: Useless use of [RZ] in sink context at <tmp>:1 ------> <BOL><HERE>[RZ] (1,2),(3,4) |
||
| habere-et-disper | m: (1,2) RZ (3,4) | ||
| camelia | ===SORRY!=== Error while compiling <tmp> Missing infix inside R at <tmp>:1 ------> (1,2) RZ<HERE> (3,4) expecting any of: infix infix stopper |
||
| habere-et-disper | m: (1,2) RZ, (3,4) | ||
| camelia | Potential difficulties: Useless use of RZ, in sink context at <tmp>:1 ------> (1,2) <HERE>RZ, (3,4) |
||
| habere-et-disper | Is this expected behaviour? | ||
| m: say [RZ] (1,2),(3,4) | |||
| camelia | ((3 1) (4 2)) | ||
| habere-et-disper | m: say (1,2) RZ, (3,4) | ||
| camelia | ((3 1) (4 2)) | ||
| habere-et-disper | m: say (1,2) RZ (3,4) | ||
| camelia | ===SORRY!=== Error while compiling <tmp> Missing infix inside R at <tmp>:1 ------> say (1,2) RZ<HERE> (3,4) expecting any of: infix infix stopper |
||
| disbot11 | <librasteve> @rcmlz - looks to me that this one liner is not very well defined in what it is trying to do (anyway I do not understand the intent) | 11:54 | |
|
12:07
habere-et-disper left
15:10
snonux left
15:11
snonux joined
|
|||