« first day (4321 days earlier)      last day (610 days later) » 

2:06 AM
Thanks
 
 
6 hours later…
8:30 AM
@Crell This talk explains better what I was aiming to discuss with you.
The only operations I need to perform on my data is to check its integrity, authenticity, persist it, retrieve it, display it. These operations don't have to be bundled with the data. And I don't want my cpu "to perceive" it as I perceive it. Only to perform said operations well.
 
 
2 hours later…
10:31 AM
@Crell I remember we discussed match(true) and that the match limits pattern matching or something like that, recently I found similar feature of Kotlin that seems to be universal and address expression and statement uses with true validation and pattern matching kotlinlang.org/docs/control-flow.html#when-expression would it be stupid to propose copy of when and deprecate match and switch ?! :D
 
10:55 AM
o/
 
 
2 hours later…
12:36 PM
@brzuchal You mean... when = mtch and else = default? The construct is literally the same
 
@Girgias yes, with few differences, can be used as statement OR expression - with slightly different behaviour related to exhausitngness
also you can use that with (true)
when {
    x.isOdd() -> print("x is odd")
    y.isEven() -> print("y is even")
    else -> print("x+y is odd")
}
some pattern pmatching
fun hasPrefix(x: Any) = when(x) {
    is String -> x.startsWith("prefix")
    else -> false
}
when (x) {
    in 1..10 -> print("x is in the range")
    in validNumbers -> print("x is valid")
    !in 10..20 -> print("x is outside the range")
    else -> print("none of the above")
}
 
Pattern matching is pretty much orthogonal to that, as adding support for is/in is in some sense adding support for larger conditional expressions
 
ALSO what differs is that it can have multi-/single statement have blocks
 
And you can use match as a statement
@brzuchal That's just a current limitiation of match that can be lifted
 
Thing I'm nitpicking is that looks like well though all in one construct
 
12:40 PM
Yeah but we are never going to deprecate switch any time soon, because it's ubiquitous
 
no need for switch / match distinguish just one to rule them all
Yes unfortunately I am aware
 
I mean, if we would build stuff from scratch, I'd agree with you
But the exhaustiveness check is not possible in PHP due to how a application is assembled
 
1:22 PM
@brzuchal every German will be like: does not compute. no fun allowed.
 
 
1 hour later…
2:43 PM
@brzuchal There's really nothing there that we cannot evolve match into. Pattern matching would cover some of it (as in wiki.php.net/rfc/pattern-matching), a shorthand for match (true) would cover some, my short-functions RFC (wiki.php.net/rfc/short-functions) would have covered the "function that is just a when" case, Ilija still wants multi-line expressions although I'm skeptical, etc.
 
3:07 PM
Can I see my own history in the chat?
Yes, in my profile, nvm
 
It's limited, but yes
Using SO functionality, gotta remember a random word in a message to find something particular. Otherwise, chat history is parsable JSON
 
Got it, thanks :)
 
> gotta remember a random word in a message to find something particular.
That is where a diverſ vocabulary comes in handy...
Simply remember which slightly unusual word you used in that conversation, and it can be easier to find that conversation.
 
3:29 PM
I'm thinking of giving "compile a subset of PHP to <target>" another try
<target> this time being PHP+C polyglot code
Pholyglot :) :)
 
@Danack exactly that
 
 
1 hour later…
4:43 PM
 
 
2 hours later…
6:44 PM
@Crell do we need is before opening bracket? cannot it be part of the condition similar to when?
$result = match ($somevar) {
    is Foo => 'foo',
    is Bar => 'bar',
    is Baz|Beep => 'baz',
};
Then whenever you want can extend it with value match
 
@brzuchal That's one of the points Ilija and I have been debating. :-) I like the idea of allowing is to apply to all arms automatically, rather than having to repeat it for each one.
 
$result = match ($somevar) {
    is Foo => 'foo',
    is Bar => 'bar',
    is Baz|Beep => 'baz',
};
I mean with another branch that matches against a value like normal / standard one
 
You just posted that...
 
GOt some connection issues and was retrying to send
I think I'd personally prefer to have is on all branches as this is more visible to me
Second;y if you match with contstant values on the left the is will be visually pretty small
FOO = 'foo';
BAR = 'BaR';

$result = match ($somevar) {
    FOO => 'foo',
    BAR => 'bar',
};
I know it's match by value having consts as cases
but if I have is in front of each branch I'd know this is pattern matching by type
That can evolve and be extended with for eg matching by in
 
Subjective question. I expect "is on all" to be the common case, at which point it's easier to just say "is" once. But the engine shouldn't care, so it's not a hill I'll die on.
 
6:53 PM
$result = match ($somevar) {
    in 1..10 => 'foo',
    in 11..20 => 'bar',
    default => 'baz',
};
in ['foo', 'bar', 'baz'] could be interesting operator
we do lot of in_array
with is_array check
in pair
 
in was Nikita's sample feature for his old blog post on how to write patches for internals. :-) He specifically said it was because it was a silly thing to propose.
 
@Crell is there any conclusion on what went wrong with short functions?
 
Yeah, voters looked at it and went "meh, why?"
 
:/
 
Especially Nikita, and at that point so goes Nikita, so goes most votes.
 
7:58 PM
docbook XML question, the PHP manual files have things like &reftitle.install; ... what is the name for that? "entity reference"? "entity token"? "entity"? "token"? something else entirely?
anything that has an ampersand preceding it that is used as a reference that relies upon one of our .ent files to tell it what text to put in its place (assuming I summarized what I think these do, correctly)
 
8:41 PM
It's just an XML entity which is included
 
 
2 hours later…
10:38 PM
@Girgias is there any accuracy with phpstorm calling it "entity reference"? (Composing a list of ways phpstorm can improve support on PHP manual XML files, this is one of em)
 
@Tiffany tbf, I'm not sure it's worth it for them, php docs do some very weird things with assumptions that other docbook projects don't do
 
It may not, but I was asked :P
Probably won't go anywhere, but can't hurt
 
@Girgias That surprises me not even slightly.
 
@Crell :p
 
 
1 hour later…
11:50 PM
@JoeWatkins in Spain Spanish, how is the word "library" translated? Biblioteca?
I may have missed a diacritic or two...
 

« first day (4321 days earlier)      last day (610 days later) »