« first day (4476 days earlier)      last day (469 days later) » 

1:40 AM
@Sjon what basic encoding are you using on 3v4l? as it doesn't seem to be UTF-8
 
2:12 AM
@Girgias I never had problems with ASCII which at least is a subset of UTF-8.
 
 
3 hours later…
4:57 AM
@Crell Considering the example from wiki.php.net/rfc/tagged_unions
enum Distance {
    case Kilometers(public int $km);
    case Miles(public int $miles);
}
You may have a function which is capable of only measuring in Distance::Kilometers
Maybe that is a weak example, lemme find better
For eg. Maybe::Some and Maybe::None if your interface never returns Maybe::None and there is always for instance at least default value that can be returned then you may want your return type to be Maybe::Some only!
I believe it's the same manner as why we do have false return type - to be able to express the return value/type as much precise as possible.
function getResponsibleUser(): Maybe {}
if you know there is a default user behind the implementation but you have to handle Maybe::None case in match, for what reason? to be able to throw an exception which will never happen?
You'll also have to make some gymnastics to test the failure case here, what if the implementing class is a concrete final one and you cannot mock it?
You end up with dead code actually
Because your static analysis told you you have to handle the Maybe::None cause that's one of the return values - this is the place where I see specific enum case type just like we have false type
 
 
4 hours later…
9:28 AM
@Girgias it should be utf8 afaik - what specifically are you looking at?
 
10:14 AM
@beberlei But thanks, added your test as regression test for that bug.
 
 
3 hours later…
1:39 PM
@Sjon Okay, it's just the live preview environment
Just doing: <?php
$s = "あいうえお";
var_dump($s);
In the live environment will show gibberish in the output
 
@Gordon \o/
@StatikStasis oooh love it!
 
@StatikStasis o/
Ohai o/
 
Also- congrats!!
 
2:06 PM
Thanks! <3
 
2:35 PM
@Girgias Do you really think the string increment feature needs to go? :-/
At least I think this should probably be its own discussion.
 
@bwoebi I think it's better if it does, does it need to no. The behaviour is kinda broken except in the narrow case it works. It is possible to keep it but it reduces to some extent the value in the whole proposal.
If the string increment should be kept, then it should become stricter.
 
@Girgias It's my favorite way to implement an increasing counter
Also fwiw - range('a', 'z') also works
i.e. for ($i = $start; $i <= $end; ++$i) yield $i; is currently generally symmetric to range($start, $end).
mirroring the ++ semantics here
If it's for the sake of consistency to --, I'd actually rather reconsider decrementing alphanumeric strings.
Everything else the RFC changes are mostly sort of broken features bringing consistency and value.
 
I'm not saying it can't be useful, but one of the objectives it to remove one of the type juggling context to make it easier to reason as a whole. If in the end the increment still exists for string, than there is still going to be a discrepancy between ++ and -- and you still need to be aware about that specific handling about strings. Which IMHO reduces the value of the proposal
 
But removing alphanumeric behaviour … is just a BC break for the sake of it, it worked since the dawn of time … and now you remove it?!
 
@bwoebi Feel free to try to pass that when that got rejected unanimously.
@bwoebi No, it's not just for the sake of it. It's to reduce the number of type junggling contexts which makes it easier to reason about the language and makes $v++ interchangeable with $v += 1.
Can this be split out of this discussion yes, but I'd rather have a cohesive proposal with a main goal and see how the sentiment is about that, before resign myself to need to have this oddity in the language.
 
2:51 PM
@Girgias trying to understand why it was rejected - but apparently all discussion on ML revolved around the behaviour of decrement of "a".
 
@bwoebi NGL isn't the "easy" solution here to just look at what Raku does in that case? As it implements it
 
@Girgias I don't care much about the unicode part, but that handling seems sensible to me.
 
@Girgias re array_sum|product: "Arrays that mix scalar values and objects may now produce different results, for example:" shoould probably rather be "arrays that contain objects may now produce different results …"
 
it's essentially the same as PHP except that it only considers the first alphanumeric sequence in a string. Which is also fine by me.
 
Is this a good exception message improvement?

```
001+ The MyDateTime object (inheriting DateTime) has not been correctly initialized by its constructor
002+ The MyDateTime object (inheriting DateTime) has not been correctly initialized by its constructor
003+ The MyDateTimeZone object (inheriting DateTimeZone) has not been correctly initialized by its constructor
001- The DateTime object has not been correctly initialized by its constructor
002- The DateTime object has not been correctly initialized by its constructor
 
3:00 PM
@TimWolla Ah indeed, thanks for spotting that.
 
@Derick I'd say, yes. But perhaps add some hint for the fix "… by calling parent::__construct()" or so.
 
@Girgias ah, yes that's a known issue unfortunately
 
@TimWolla Yeah, that's a good idea.
 
@Sjon Okay :( I'll just need to keep that in mind when I look at the output
 
@Girgias It's a miniscule piece of js code but I haven't got it working properly, checkout livePreviewPush @ 3v4l.org/s/my.js
 
3:04 PM
Oh Jquery :D
 
nope its vanilla
 
Ah, you implemented a sort of $() function, that's what put me off :)
 
yeah - that's the only jquery feature I actually like ;)
 
@Sjon now, if only the 3v4l page wouldn't serve minified JS, but something you could use the in-browser debugger with
(or had a toggle to not use the minified JS?)
 
maybe a sourcemap would help - I've never really looked into it but that might work
 
3:09 PM
that'd help too yeah :-D
 
I would just serve the original JS, saves a build step and the difference after gzip should likely be minimal anyway.
 
its 8289 vs 9311 so not insignificant
but the absolute numbers aren't that high either....
 
Yeah, that's what I mean. The script is already quite small by itself and the 900 byte difference is completely dwarved by loading the editor.
In fact self-hosting the editor would likely improve the performance more than the minification, because you don't need to perform another DNS query for the jsdeliver CDN.
 
 
2 hours later…
4:46 PM
Meh, why does get_attribute_value() not support named params :-D
 
 
4 hours later…
9:06 PM
@Sjon Ever considered an editor option with vim key bindings for 3v4l? :D
 
 
3 hours later…
11:48 PM
@Crell I think the engine can definitely optimize that, usually it wouldn't be an issue, but for applications that rely heavily on functional concepts, it would be a real performance killer if $($x) behaved exactly like static fn() => $x;, in Ara, this is expected, it compiles to PHP so that's really the only option we have, but for PHP, i would expect it to be optimized.
@Crell I think so, and jumping to pipe operator directly without addressing the other things mentioned in that document is wrong in my opinion, so these should be sorted out first, doesn't mean accepted, but discussed at least.
and i think the previous PFA RFC only addressed function/method calls, but not other operators, e.g $$->foo(); should be the same as fn($x) => $x->foo();, and $$ + 1, should be the same as fn($x) => $x + 1;, covering function/method calls at first is nice, but i think cover all possible operations ( well, most of them ) is even better, as it allows you to create a function from basically any expression.
and allows for really cool things, such as:

```
$result = $("Hello World")
|> htmlentities($$)
|> str_split($$)
|> array_map(strtoupper($$), $$)
|> array_filter($$, $$ != 'O');
```
 

« first day (4476 days earlier)      last day (469 days later) »