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. |
|||
_elcaro_ | I always thought min and max on a Range was similar to Range.bounds. I'm also reminded of a time I was dealing with ranges where I had to do something along the lines of... my ($min, $max) = (.min + .excludes-min, .max - .excludes-max) given $range | 00:57 | |
00:58
MasterDuke joined
|
|||
nemokosch | I think if Ranges are conceptually continuous (which they seem to be - nothing special about integer bounds), the only sane choice is to report the bounds back | 00:58 | |
01:35
tbrowder__ left,
tbrowder__ joined
02:27
tea3po left,
tea3po joined
02:28
tea3po left,
tea3po joined
|
|||
bbrtj | perldoc.perl.org/5.36.1/perlfaq3#H...m-shrinks? does raku have the same problem? | 07:58 | |
nemokosch | I don't know if I miss something important or this is really just a description of a usual garbage collected environment | 08:37 | |
08:49
habere-et-disper joined
10:46
ab5tract left
|
|||
librasteve | bbrtj: good question ... I note that there is a test operator for this docs.raku.org/routine/request-garb...collection , so you could experiment by making a mega hash, going out of lexical scope and then calling that | 11:44 | |
my guess is that raku GC will apply to all raku objects and that a Hash is an object like any other (but I would defer to someone who knows the facts) | 11:45 | ||
I agree - this is what .bounds does | 11:48 | ||
Should minmax do the same as bounds - well I think the current minmax handles excluded ends in the expected way and fails if not is-int | 11:50 | ||
m: say (2..^9).minmax | 11:51 | ||
Raku eval | (2 8) | ||
librasteve | m: say (2..^9.3).minmax | ||
Raku eval | Exit code: 1 Cannot return minmax on Range with excluded ends in block <unit> at main.raku line 1 | ||
librasteve | m: say (2..^9.3).bounds | ||
Raku eval | (2 9.3) | ||
librasteve | So I would say that the right thing is to make min and max follow the same logic as minmax | 11:52 | |
lizmat | which is what github.com/rakudo/rakudo/pull/5300 does, right ? | 12:32 | |
habere-et-disper | Is something blocking the 2023.06 star release ? | 13:01 | |
This link points to 2023.05-01 still : | |||
rakudo.org/latest/star/src | |||
lizmat | I thought the Star release was already done? | 13:03 | |
suggest making an issue so we can figure out where it went wrong | |||
habere-et-disper | 👍 | 13:04 | |
Done. github.com/rakudo/star/issues/187 | 13:12 | ||
lizmat | habere-et-disper++ | 13:13 | |
13:41
habere-et-disper left
14:28
teatwo joined
14:31
tea3po left
|
|||
librasteve | nope | 16:31 | |
m: say minmax (2..^9) | |||
Raku eval | 2..8 | ||
librasteve | m: say max (2..^9) | 16:32 | |
Raku eval | 8 | ||
librasteve | m: say minmax (2..^9.3) | ||
Raku eval | 2..9 | ||
librasteve | m: say (2..^9.3).minmax | 16:33 | |
Raku eval | Exit code: 1 Cannot return minmax on Range with excluded ends in block <unit> at main.raku line 1 | ||
librasteve | weird, the sub version of minmax ought to fail | 16:34 | |
m: say max (2..^9.3) | |||
Raku eval | 9 | ||
librasteve | m: say (2..^9.3).max | 16:35 | |
Raku eval | 9.3 | ||
librasteve | and both the above max should fail imo | ||
anywho - I will try to take this thread over to the PR comment... | 16:38 | ||
16:53
ab5tract joined
17:11
ab5tract left
18:52
habere-et-disper joined
19:02
habere-et-disper left
19:25
ab5tract joined
19:57
guifa left
20:09
ab5tract left
|