« first day (3583 days earlier)      last day (1358 days later) » 
00:00 - 21:0021:00 - 00:00

12:01 AM
I know what would be fun... ice cream at 1am, because why the heck not
Yay. Finally determined that K8S pod disruption budgets have to match the pod in the controller and not the controller itself \o/ that only took 2 hours
 
@Sara Haha yeah I'm way too expressional for no video
I talk with my hands all the time
But in the interview I kept catching myself staring off into the corner of the room because I didn't have anything to look at anyways haha
I had to keep reminding myself "Stare at the camera, they can see me"
 
I completely forgot I was on camera at the R11 meetup and started trying to comb my hair with a brush attached to a power drill... the funny thing was, I was using the actual live stream video of me to try and line it up with my hair.
 
That so sounds like something I would do
That being said, how does that even work??
 
Uh well... I had the drill pointing upwards with a spade bit on the end, and then I'd put the hole in the brush handle over the top of the spade so it spun around it (like a ¬) and was trying to spin it so it would brush my hair, but not be legit attached to the drill and rip my skull off if it got caught
 
12:17 AM
Was this supposed to be practical and I'm misunderstanding something or were you just playing around with a drill and a hairbrush :P
 
as if I have a clue why I come up with half the crazy stuff I do :D
 
Yeah one thing this pandemic has taught me is... remember when you're on video chat
 
Yup... I've stopped using my camera for company meetings for the most part for that reason. Deliberately keep the lens cap on
 
I feel awkward doing that idk why
But if I'm in rough shape I'll do it
 
@MarkR colorballs
 
12:32 AM
@Tiffany xD
 
I remember going afk then coming back and seeing you trying to brush your hair with the drill and I was like "what did I come back to..."
 
I wanted to participate but it was not one of my best days
I was actually excited for it though
 
did you see the youtube video at least?
 
Nope I didn't realize there was one
 
Aug 3 at 12:36, by Tiffany
@StatikStasis a thing
 
12:46 AM
Oh yeah you did share that with me before on Skype didn't you
Sorry I've been under a lot of stress in almost every aspect of my life lol
 
np
 
Wes
1:06 AM
morn
ing
 
really early morning for you
 
Wes
\o
 
I think I should go to bed
 
Nah, be a rebel, stay up till 7
 
1:29 AM
More people need to watch Hot Fuzz so I don't have to constantly explain the meaning of yarp/narp
 
1:40 AM
Hound goes Yarrrrrp
 
2:23 AM
There should be an array_diff function that works as the opposite of array_intersect
Or I guess I should say, the inverse of (instead of opposite)
 
 
2 hours later…
3:55 AM
YARP
anyone had experience with "SMF" - Simple Machines Forum?
 
4:48 AM
Narp :P
 
o.O
 
If statement comparison bug in foreach loop ・ Scripting Engine problem ・ #79941
 
@Tiffany I believe that should be "Narp?"
er.
 
I believe it should be every fooking chicken you got
 
Wes
5:50 AM
lol was watching @Danack's live stream and i though ooof there's a lot of background noise, and then just after that he starts speaking about background noise
felt like you could read my mind from the past
 
6:21 AM
morns
 
Wes
6:56 AM
\o
 
7:53 AM
\o/
 
- ot- any one know some room where it's possible to chatter of design oop aspect ?
 
8:17 AM
> The at() matcher has been deprecated. It will be removed in PHPUnit 10. Please refactor your test to not rely on the order in which methods are invoked.
@SebastianBergmann Do you have any recommendations on replacing at() usage in this kind of test? github.com/nikic/PHP-Parser/blob/…
Should I be writing custom mock functionality for this?
 
8:43 AM
@NikiC I forgot to send you a script, didn't I? :-/
They're on the way now
 
9:17 AM
@SebastianBergmann would you accept a patch to use automatic-releases in phpunit? It doesn't follow your CHANGELOG.md naming scheme, but I think it can be fixed long-term
 
9:44 AM
@Ocramius Thank you for offering to help, but I am fine with the semi-automation I have in place.
 
@SebastianBergmann cool cool, glad I asked upfront :D
 
@NikiC at() always confused me and should never have been implemented in the first place. That being said, in your case I would use an anonymous class that implements NodeVisitor and records the information you're interested in.
 
@SebastianBergmann That's what I was thinking as well ... only complication here is that I don't just need to record, but also return different values at different points
 
10:36 AM
@Wes I probably need to move if I want to be able to record with a quiet background. single glazed windows and shitty construction ftl.
 
Wes
@Danack not sure it was you tho
@BruceStackOverFlow why not here?
 
@cmb Is it common for Pipelines to hang? dev.azure.com/php-xdebug/Xdebug/_build/…
also, how do I open these up to the public?
I did manage the latter
It's still hanging :-/
 
10:57 AM
@Derick Looks like is not possible: github.com/php/php-src/commit/…
I wanted to organize a PHPTestFest before PHP 8.0's GA, but with this and gcov not working, won't be possible :(
 
That talks about coverage, not just the project
this room runs a gcov I think
no, that was lxr: heap.space
 
11:15 AM
b/c break: new\class now fails ・ Class/Object related ・ #79942
 
resolution: revert namespace tokens + @@ j/k :p
 
sometimes when I'm naming variables or whatever, I'll need to specify up" and down` (like arrow_up or whatever), and to have my code line up neatly, I'll often abbreviate down as dn.
That was an irrelevant piece of information.... until I just realized that dn is up, upside-down. 😲 🤯
 
11:31 AM
@Wes Ok but, I did not want to be off-topic
 
Wes
it's on topic here
 
@Wes because my questions they are oop specific not only php. Btw good! :-)
 
cmb
@Derick I don't think that it's common, but I have not much experience with Azure Pipelines in general, and none with OSX pipelines.
 
yeah, looks it was wonky a little. The pipeline did finally get cancelled after the agent didn't react for 5 minutes, os that's good.
 
I follow the group of elephants-object do you know?
Where discussing general oop arguments ...
So my doubt is, following the CQS "principle" how to design the return object of the query method?
 
Wes
11:38 AM
your question is unclear
 
Ok in the cqs approch we are two type of method the command (return void) the query method
to get the result of the command execution
Right ?
 
ok
 
Wes
yes
 
ok, my doubt is how to design which class?
obv depends but in general way the query method as you decide which object return
new o already presents in the codebase
more clear ?
more extreme, for me, return a boolean value it's bad
for example, because the semantic it's null.
So I think, ok, I create a return TrueValid, FalseValid, Etc Object
but this object, it's strange and maybe itsn't correct
 
Wes
why do you think boolean is bad
 
11:51 AM
... So I look for a resource: blog, article, chat, etc. That speaks of these aspects
 
cmb
TIL, that the LHS of instanceof can be the name of a class (doesn't appear to be documented; neither in PHP manual nor in lang-spec). However, that yields slightly different results than using an object.
 
@BruceStackOverFlow how is a "boolean" object better than boolean, it will not contain anymore information, but will be more bulky. boolean is usually enough as a primitive type, other languages do have object for them like Java with Boolean, but they offer some extra functionality, which I doubt you need in your case.
 
@Wes because it's binary answer, and in the major situation this leads to writing more code to make the next decision
@mega6382 exact
 
Wes
how is using boolean causing you to writing more code
 
cmb
that's similar to null objects, which allow to eschew null checks (well, as of PHP 8 you could use ?->)
 
11:58 AM
@cmb IIRC we "decided" (I can't cite a reference for this) to not document it as it's pointless.
Though it is briefly mentioned on php.net/oop5.changelog
 
@cmb I am confused, wouldn't that just be treated as a simple string, can you provide an example on 3v4l ?
 
clarify isn't bad always! in a general way
For me it's a question, not an affirmation. I trying to figure out where I'm wrong
 
@BruceStackOverFlow can you provide an example where it would be wrong?
 
Wes
also this is likely not documented @cmb 3v4l.org/Ds2YG
if RHS is an object, it evaluates to get_class($rhs)
 
@mega6382 I try...
I try to reverse the question, can you an example where it's better use a boolean ?
Btw
the boolean it's only an example just to explain more clear
this for example ?
https://3v4l.org/20upF
...
but repeat boolean it's just an example
 
cmb
12:11 PM
@salathe ah, thanks, but supporting literals is not what my issue was about. Actually, @mega6382 is right; it's just checking whether a string is an instance of a class, and that evaluates to false.
 
I interested to learn how to design the return object from query method with cqs approach
 
Huh?
 
@cmb I'm confused about what your TIL observation was.
 
@salathe i think it was this 3v4l.org/MLWfK
 
12:19 PM
I don't think so, because that's documented. :/
 
to which I said that LHS in just a string, doesn't matter if that is a class name, because it is just a string.
which I believed cleared it up for him
 
cmb
I was confused by user note 125252: 3v4l.org/T2r6W
the comment was misleading :/
 
@cmb yeah, it's just wrong.
So you no longer think "that the LHS of instanceof can be the name of a class"?
 
@salathe that is correct, right? it will not be treated as a class name?
 
Sorry what is correct?
It's too damn Friday for this.
 
12:24 PM
that it will just be treated as a literal and will return false, like mentioned in the changelog.
 
Yes. Regardless of the contents of the string.
 
cmb
ACK
 
cool, just as I initially thought.
@salathe sorry to bother you with this, but I recently created a request for vcs for phpdoc, I thought if you could please look into it. :)
 
@Derick Can you explain to me what "Difficulties with Userland Parsers" means? I've heard of this claim that <<>> is somehow easier to parse but I really can't understand why that would be the case.
 
@mega6382 I'd rather not, to be honest. Nothing personal against you, but the docs project has to continue without me.
 
12:31 PM
are you not managing it anymore? I thought you were the lead on it.
 
@IluTov maybe we should remove that, its based on the phpvs ppl argument, which is pretty weak.
The new row about tokens and forward compatibility combined cover the same more objectively
 
@beberlei So is it about using token_get_all() in <8.0 PHP versions? What does ppl mean?
 
@NikiC wrt to zend_throw_exception_hook changes, as now a zend_object* gets passed in, how do I now read properties with zend_read_property(ce, ***), as that requires a zval* still? I don't think you can get to the zval* from the zend_object* ?
 
@salathe I didn't know, its a shame because I believe that you were great, but you gotta do what you gotta do. :)
 
12:43 PM
@Derick create a temporarily zval with ZVAL_OBJ
Or use Z_OBJ_HT_P(exception)->read_property() if you don't need fake_scope. The underlying API works on zend_object
 
OK
kinda of an annoying change - what's the reason for this API change?
 
@Derick To avoid doing the zval wrapping in other places
 
k
 
We could change the zend_read_property APIs as well, but that would probably impact extensions non-trivially...
Most other places have migrated to using zend_object*
 
does the Z_OBJ_HT_P(exception)->read_property() also work with PHP 7.2 and up?
 
12:46 PM
@Derick Not the way you want to
It does work, but it accepts a zval prior to PHP 7.4
Or was it PHP 8.0? Actually it might work exactly as you want ^^
 
so there are then 3 cases :-/
hah, care to check?
 
@Derick just checked, it only changed in PHP 8
That makes me think that we actually should change the zend_read_property API
 
IMO that'd be more consistent...
 
It makes little sense that we change half the API to accept zend_object in PHP 8, but not the other half
 
Another question but on Php and for today stop :-)
why the spl lib it's used very little ?
 
12:49 PM
@NikiC OK - I'm wondering whether I should make a change in Xdebug now, or wait until that's done.
 
@Derick wait :)
 
how long? ;-)
 
@BruceStackOverFlow Which part of the library, because there are parts that are very, very, very commonly used?
 
right iterator etc I agree ... but
like \SplEnum ? \SplString \Splbool ?
 
They're not in the SPL, they're in the SPL Types PECL extension. :P
 
12:53 PM
arg
>Warning
>This extension is EXPERIMENTAL. The behaviour of this extension including the names of its >functions and any other documentation surrounding this extension may change without notice in a >future release of PHP. This extension should be used at your own risk.
 
@BruceStackOverFlow Despite having SPL in the name, those are not part of SPL :)
@Derick I can work on that now
 
exact sorry
 
@NikiC I'll set a timer ;-)
 
@BruceStackOverFlow Two pieces of advice. i) avoid using the SPL ii) stop worrying about abstract problems. Get on with writing some code that does something useful, then think about how to make it better later.
 
ok @Danack
 
12:55 PM
Some parts of SPL are very specialised and don't have much useful purpose (I'm thinking of RecursiveTreeIterator, for example), other parts are horribly "designed" APIs (e.g. DirectoryIterator, the whole exception hierarchy), others are super useful (Countable, spl_autoload_register), etc.
 
Not sure if I can do this or not, but I tried asking in the JavaScript chat for help to a simple question, but those narps are useless. Is anyone here knowledgeable of sorting/grouping array to then loop over it?
 
@zgoforth put a code example somewhere, then just ask your question, rather than asking to ask.
 
Thats what I did and that chat, but those narps never answer, and if they have something to say its flirting back and forth over completely unrelated topics. Unreal.
.then(([r1, r2, r3]) => {
      const objItems = r1.concat(r2,r3);
      console.log(JSON.stringify(objItems));
      console.log(objItems);
      var tableContent =
        '<table id="deliverablesTable" style="width:100%" border="1 px"><thead><tr colspan = "5"><td><strong>Program</strong></td>' +
        "<td><strong>To</strong></td>" +
        "<td><strong>Date Submitted</strong></td>" +
        "<td><strong>Approved</strong></td>" +
        "<td><strong>Notes</strong></td>" +
        "<td><strong>Deliverable</strong></td>" +
 
@zgoforth Please, use a pastebin or equivalent
 
My apologies, but that is my table that is currently sorted/grouped by Program attribute, I want to then group inside of the Program by the deliverable. How can I achieve this? There are going to be way more than two deliverables per program, but of the two Deliverable topics that will remain the same count.
Here is the output i.stack.imgur.com/6NTo5.png
 
1:02 PM
@zgoforth I think you can use a custom sort function, to do the compare as you want it: stackoverflow.com/questions/5002848/…
but also....you should break your code up into pieces. One piece to process the data, one to render it to html etc.
Trying to read that many lines of code at once gives me a headache.
 
I was thinking creating another variable sortedObj1, and rendering it thought the Object.keys function like how I did for the sortedObj variable
@Danack Noted.
2
Q: Sort/Group an Array by 2 different Attributes

zgoforthI have a grouped/sorted array based on its "Program" attribute which is great. But now I need to sort by a different attribute (Deliverable) inside of that grouping, is that possible? And if so how can I accomplish that? Here is a picture of my table. See how it is organized by Program? Inside o...

Should have just posted this instead of that code, my apologies
 
"This patch changes the zend__property family of functions to accept zend_object as well." — "As well?" They can now accept arguments of both?
 
@Derick nope, made that more clear
tbh I'm not sure if we should do this
It did get rid off a couple unnecessary zvals in internal usage
But it's probably going to be a significant break for extensions
 
It was going to break anyway?
 
@Derick custom object handlers would break, yes, but not any code just interacting with properties
 
cmb
also, we're already in beta phase
 
1:36 PM
I didn't think that the API/ABI was fixed until RC1?
 
It's not, just maybe still not great to do major breaks now ^^
 
I started getting rid of unnecessary zvals in APIs but realized I had higher priority items and stopped.
 
I would like to know soon whether you want to do this or not, so that I can get to continue with Xdebug...
 
@Derick heh, you can just fix xdebug and then fix it again later :P
@Sara @GabrielCaruso Any thoughts on github.com/php/php-src/pull/5953?
 
I would like not to have to do that, if it's changing in the next day
 
1:49 PM
I feel it's necessary to provide a different point of view about the events zgoforth just described happening in the JavaScript chat. He pasted that block of code in the room accompanied with a question, and then pinged me (and only me), even though I haven't chatted in that room in over a month. As per room policy, I asked him not to ping random people...
in JavaScript, 1 hour ago, by zgoforth
Didn't "randomly" ping you. You are the only one active seeing if you would be able to help me. Why is everyone so anal in this chat
in JavaScript, 1 hour ago, by zgoforth
Aaand as I figured. Useless
 
@Cerbrus Even without your explanation, his message alone, is very entitled and rude
 
I'm sorry, but then you're just not going to have a good time in the JS chat
 
@Cerbrus Are you saying that to me?
 
Thanks @Alesana
 
oh lol okay I'll take it as a no :P
 
1:51 PM
Nah, that was a continuation of my explanation
 
Okay haha just had to make sure my message wasn't misunderstood
 
FWIW, the same is true in here.
 
I figured it wouldn't hurt to provide some context, as this isn't the first time someone went to another room to complain about JS chat room rules being enforced
@Derick I'd say it's just common sense, even
 
"common sense" isn't quite what you expect...
 
It's surprisingly uncommon xD
 
2:05 PM
@nikic Is there a best practice for caching AST object graphs returned by Parser::parse()?
 
@Alesana lol
@Cerbrus is js room still active, I thought they moved to discord or something.
 
kinda, lots of regulars moved
 
@SebastianBergmann uh, serialize?
 
@NikiC hahahahah, I was tottally about to add that on the sly. Got tired of writing { zval tmp; ZVAL_OBJ(&tmp, zo); add_property_zval(...); }
 
@NikiC Getting a weird new segfault now in case I have more arguments to a function that it wanted. I used to have:

if ((i < arguments_wanted) || ((zdata->func->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE) && (i < arguments_sent))) {
if (ZEND_CALL_ARG(zdata, fse->varc+1)) {
ZVAL_COPY(&(fse->var[fse->varc].data), ZEND_CALL_ARG(zdata, fse->varc+1));
}
} else {
ZVAL_COPY(&(fse->var[fse->varc].data), ZEND_CALL_VAR_NUM(zdata, zdata->func->op_array.last_var + zdata->func->op_array.T + i - arguments_wanted));
 
2:11 PM
@NikiC Okay. Just wanted to make sure that I did not overlook anything provided out-of-the-box. Thanks!
 
Which is slightly different, but deffo related
 
In less shite formatting: pastebin.com/knK8bRBU
 
((actually reads patch)))
Yes, this too.
And 8.0 is the right time to break this API
But while we're talking, I want to add add_((next_)?index|assoc)_zend_object() and some related convenience functions
Was surprised to notice we don't have them yet.
 
@Sara +1. Would call them just add_*_object
 
2:16 PM
m'kay
That's fair, we have add_*_resource(), not add_*_zend_resource() after all
 
@Derick ZEND_CALL_ARG cannot be null
 
What changed in this API then?
 
This code looks pretty weird to me, it smells of off by one errors in the variadic handling
 
the code is pretty weird, I give you that
            if (ZEND_ARG_IS_VARIADIC(&op_array->arg_info[i])) {
                fse->var[fse->varc].is_variadic = 1;
            }
            if (ZEND_ARG_IS_VARIADIC(&op_array->arg_info[i]) && !hit_variadic) {
                fse->var[fse->varc].is_variadic = 1;
                hit_variadic = 1;
            }
that for example, makes no sense at all
 
@Derick This kind of code really should be dealing with VARIADIC at all, especially not incrementing anything based on that
 
2:24 PM
really not be dealing?
 
The problem might be that the call trampoline likely has the variadic flag set now, while previously it didn't
 
hmm
Maybe I am not understanding something here
(likely)
 
3:06 PM
Is there a more type-specific version of GC_ADDREF for zend_object* ? ZOBJ_ADDREF or something? The former is fine, I just like to be expressive where possible.
 
@Sara nope
 
@NikiC If you have any suggestion on how to improve this, let me know ;-)
There was definietly something needed for a variadic, as it wasn't ever included in ZEND_CALL_NUM_ARGS I think?
 
3:24 PM
@NikiC Didn't think so. Thakns.
 
4:13 PM
Sigh, which idiot decided to make the index into ZEND_CALL_ARG 1-based?! Mother forker.
#define ZEND_CALL_ARG(call, n) \
    ZEND_CALL_VAR_NUM(call, ((int)(n)) - 1)
(That'd be Dmitry)
in 2014
 
Isn't it because 0 stores the number of args?
I guess you could put that at -1 or something like we do for the return info in arginfo.
 
right, you don't expect that API to be 1-based
 
@Derick PHP generally uses 1-based argument numbers in lots of places :(
 
@NikiC No wonder you saw an "off by one" error in my variable gathering code
which btw, is trash, and I'm rewriting
it also does seem that the "variadic" does take up a space in the arguments list?
it's to signal the IS_VARIADIC bit, I suppose
ugh, I think I need to add named argument support here too
 
@Alesana I was one of the lead developers of Drupal 8, then had a falling out with the community because Drupal leadership are closed-minded bigots who feel faking a rape accusation is the right way to respond when called out for being bigots. Also, Drupal 7 and Drupal 8 are essentially entirely different systems, so which of those you're looking at makes a huge difference.

If you still have questions after that introduction, I can try to answer. :-)
 
4:56 PM
@NikiC Is there a reason nearly all functions that return ZEND_RESULT_CODE return int instead?
 
@Crell Thanks for reaching out. Yeah I kinda heard what happened, that's insane that those type of things would have any bearing whatsoever on your development projects
I was considering a few different job offers, one of them was with Drupal, but I decided that it wouldn't be the best decision for my career even if I did enjoy working with it
I just accepted a job offer for Magenta and Larave about 10 minutes ago
 
heh, OK.
Oh, congrats!
 
I negotiated from $X and moving to NYC up to $X+15k and working remote
Thanks! I'm super excited
 
Noice! Well done. :-)
Agency, large corp internal team...?
 
Congrats @Alesana
 
5:04 PM
Not moving to NYC is probably worth even more than the $15k bump. ;-)
 
Thanks guys! It's a large corporation, one of the bigger ones in the world
Yeah seriously haha
They're not big in technology though so there's just 2 devs (plus me) and a project manager
It's in the entertainment industry, so they said sometimes it feels like they're an agency for the different people who have contracts with the company
I won't disclose the company until I start there though :P
 
Too negative of a message to leave like that, sorry. Congrats @Alesana and sorry for double ping.
 
Totally fair. If your small team needs a host, well, Magento Cloud is my company under the hood. ;-)
 
@Tiffany Thanks! I think for me what it was is that the last year and a half I spent migrating legacy monolithics into Laravel microservices, and most the companies I was talking to are in the process of doing that. I think it was really just the luck of the draw
@Crell They use Magento
 
Hence why I namedrop it. ;-) (Platform.sh hosts all kinds of stuff, including Laravel and Magento, and Magento Cloud is a Magento-focused whitelabel of us.)
 
5:07 PM
Cool, I'll see if they're looking for something like that when I start
 
(I'm in Devrel, so namedropping is part of my job.)
 
@Alesana so I guess I'll keep practicing with laravel
 
@Crell I like how you namedrop while explaining why you namedrop, very tactiful
 
Laravel is huge in the US. Symfony is bigger in Europe. Between the two I favor Symfony but both have very deep resources.
<-- is a pro.
 
Breaking out of negative thinking is tough, but like anything, it also takes practice. I guess.
 
5:11 PM
I want to get more into Symfony. I hear the certification is pretty hard to get, compared to the Laravel one I just got
But we use Magento and Laravel where I'll be working so no time for that
@Tiffany I've also spent almost every waking hour the past 2 weeks on job searching, doing coding tasks for interviews, etc...
And I've been getting like 5 hours of sleep a night
So it's not like I just lifted a finger to find a job :P
 
I have a friend who has connections in infosec, so I may end up switching to that... he sponsored me for a ticket to a virtual conference from the Diana Initiative
 
You can do Symfony work without certifications, certainly. But yes, AIUI it's intended to be "easy if you're already a solid Symfony expert, very hard if not."
 
mornings
 
@Alesana to be early 20s again :/
 
@Tiffany I couldn't have done it without Vyvanse I just got prescribed tbh
 
5:16 PM
I may push to be switched back to a low dose of Vyvanse
 
I can't wait to see my psychiatrist and when she asks how it's working I'll be like, weeellll I quit my job and got a much better one xD
Yeah I'm on a pretty low dose, for some reason my body doesn't tolerate anything like it used to
 
goodnews.gif
 
Strattera just isn't doing enough for me
 
Yeah :/
I'm also taking this new antidepressant that is the first one out of like 6 different ones that my body tolerates. I don't know if it's working or not though because I started it at the same time as the Vyvanse
 
I've been on Wellbutrin for awhile and it's been working pretty well. I used to be on Effexor but fork SNRIs.
A medication shouldn't have withdrawals almost as bad as hard drugs
 
5:21 PM
I tried both and my body said nope
SNRIs were even worse for me
But on any of them I got really irritable and agitated and just wasn't fun to be around
 
I will not go back on SSRI/SNRI again. NDRI seems to work for me with mostly mild side effects and I don't have to deal with brain zaps if I happen to miss refilling in time
Brain zaps, nausea and vertigo were the worst with Effexor
@Alesana what should I focus on with laravel?
 
Yeah bleh
I actually have time to relax a little bit now that I'm not job searching
Sunday do you wanna do a peer coding thing?
 
Sure
 
We can go over all the important parts
 
@PeeHaa About to do a mid-day stream. Back to Days Gone for right now.
 
5:29 PM
@Danack From what I remember, Swift has a model where a function either can throw an error, or cannot. And then it has a system for handling errors when calling another function, where you can either 1) propagate any thrown error (caller must be marked as throwing), 2) get the function's the return value as an Optional type (so it'll be empty if it throws), 3) panic (abort) if the caller throws. Rust has an error-handling system that's functionally the same but a bit different syntactically.
 
@Andrea thanks. Does swift have anything like:
function foo(string $bar){
    return $bar();
}
and fit support for 'errors or cannot' into things like that?
 
@StatikStasis :( buried in work right now
 
@Danack Swift definitely has so-called “first-class functions” yes. I am not sure how they handle throwability in that case but I would assume it's no different. I will check though.
 
ta.
 
@PeeHaa No worries- may be a few. Setting up pro account for streamlabs so I can start multi streaming to both YouTube at Twitch.
 
5:38 PM
:D pro streamer+++!
 
Ha! Just paying for the "service name."
 
@Danack docs.swift.org/swift-book/LanguageGuide/ErrorHandling.html doesn't say anything special about callbacks so I assume it's the same. Also oops sorry, I should've mentioned there is try-catch
I assume the callback must marked as throwing if it intends to throw, and the caller must also be marked if it wants to throw. But the thing is that Swift makes it easy to translate between different modes: if the callback throws, the caller could choose to panic if that happens, or it could return an optional, or handle the error. likewise the callback could not throw, but the caller could translate it returning an optional into throwing an error.
 
 
1 hour later…
6:59 PM
@Danack Yes, but they don't do callbacks as strings, they have dedicated function types for that. Closures that throw must also be marked with throws as @Andrea mentioned.
struct ExampleError: Error {}

func foo(callback: () throws -> ()) throws {
    try callback()
}

try foo {
    throw ExampleError()
}
You even need the try keyword on the function call that throws to make it more explicit that it can throw.
foo could of course also not throw and instead handle the error of callback directly.
 
7:51 PM
pecl/php segmentation fault (core dumped) after pecl install --force ・ PECL ・ #79943
 
 
1 hour later…
8:57 PM
Can we just tell everyone that using Closure::fromCallable(string) is 3x faster, whether or not that's true? Maybe we can trick people into letting us kill bare strings as callables.
 
@Sara: Even three times faster then call_user_func(string) ?
 
00:00 - 21:0021:00 - 00:00

« first day (3583 days earlier)      last day (1358 days later) »