« first day (1657 days earlier)      last day (3517 days later) » 

user895378
16:00
Which is strange because that only attracts more fan girls. Kinda the opposite of what was intended, I think.
Ah, doing partial application is somewhat nicer in PHP 7
@DaveRandom I immediately read that to the tune, without even having noticed the RB reference above it.
posted on April 30, 2015 by kbironneau

/* by Frankie */

@NikiC Yep.
Thanks for upgrading our syntax in that regard :)
16:09
Mar 31 at 9:43, by Sergey Telshevsky
@tereško will ask for a review in a month or so :)
@rdlowrey That's not how you spell mistress...
user895378
@PeeHaa \o/
@SergeyTelshevsky , I have had no complaints about DasKeyboard. The quality seems exceptional and the that volume toggle is way too useful than it should have any right to be
/cc @ircmaxell @DanLugg @Danack
16:32
@NikiC no… I tried to support as much as possible… but …it's pure variables only
Can the following code be compressed at all? pastie.org/private/ihka8mzn3xjl79n0bee3dw
I'm not sure the $array[$num] = array(..) is great, should it be $array[$num][something] = 'value'; ?
@LeviMorrison did you look up transducers?
@ircmaxell I am very aware of transducers, yes.
These are ideologically similar but are different.
Transducers are oriented completely around the reducing function.
Rather I focus on composition of iterable things.
This has a few advantages:
Early exit in a transducer requires this weird Reduced object and some conditional logic in your transducer.
There's no such issue with my algorithms because you just return.
It's also simpler to explain (at least I think so).
@Jimbo looser :p
17:17
@NikiC okay… just added reference support because you really missed it :-D
Interesting question
2
Q: password_verify does not work when using hashed password from database

Steven TomkoI'm seriously trying to figure out why does my password_verify code isn't working for 4 days already and I'm getting really confused and mad... First of all I have to say that session is already started and everything other is working without problems. But when I try to create a password_verify...

@Machavity php version...
@bwoebi ... ... ...
$cb = &(&...$x) ~> $x[0];
doesn't it look nice?
I have an implementation level question .. I haven't tried anything though
17:25
@argentum47 That's the best way to ask people for help :-)
I have three models for now, User Answer, and Question. user has_many :questions , and question has_many answers .. and user has_many :answers through :questions, if a new answer is posted to the users question, the user will get a notification ... like in SO .. now, if he has seen it then the number of unseen notification will be 0 ... how to implement this thing ?
And what do "models" have to do with all this? What is a model?
I.e. what does your model do?
its a representation of a buisness logic ... I mean that MVC thing .. User class = users table in db.
@bwoebi um, that starting & should definitely not be supported
@NikiC why?
17:31
I get that you have a by-ref fetish, but adding by-reference returns to short lambda syntax in a hard to understand syntax is taking it a bit too far
@argentum47 Ah, MVC. Here's a guide to MVC
I have read that ...
@NikiC also syntactically ambiguous maybe?
like
if not in the parser, to humans
is &() ~> blah a reference to a closure, or a closure returning by-reference?
also, there's no need for references in functional code
so :p
@Andrea yup
@Andrea you only can reference variables?
17:33
@bwoebi I guess so, still
it's ugly and overcomplicates things
if it were an issue, parser would have complained^^
() ~> $foo, $foo ~> $bar, ($foo, $bar) ~> $baz and ($foo, $bar, ...$baz) ~> $qux are sufficient
I am not at this moment concerned about to or not to MVC ... just some idea about the implementation ... i can start something atleast.. :))
it'd be nice if we had a syntax that didn't differ from Hack's, but alas, I guess not
@argentum47 Read the last section again and do that instead of worrying about fake models
> The Underlying Lesson
17:35
@Andrea not my fault when they use a dumb token^^
I mean, where possible, I think I'd like it if we keep the same syntax when we take Hack's ideas, to avoid needless divergence
the SOLID principles ? I try to follow that all the time ..
also, call it T_MAGIC_ARROW
@Andrea I don't work at Zend.
17:37
Hey all, if any one has worked with symfony and doctrine (2) before, I would apprecaite any help in getting validators set up stackoverflow.com/questions/29974010/…
@bwoebi Actually I've found I quite dislike ~>
It's barely distinguishable from ->
And well, it's probably the least convenient to reach character on my keyboard :D
But you immediately recognize it in context anyway
Am I the only one that hates the whole "oh we'll use an arrow to define a function" thing? It breaks my visual parsing thing.
@Charles Writing functional code with function() {} is so damn ugly to the point of being impractical
Seriously, "here's a list of variables, OH BY THE WAY THEY ARE ARGUMENTS IN A FUNCTION, here's a function body"
17:41
even bison can parse it without lexer hack…
@NikiC Yeah but there has to be something that allows it to be read by mortals and not get confused as hell.
especially given that we use fat arrows in assoc arrays
@Charles map($list, $i ~> $i + 1); Seriously, there is nothing you can misinterpret here, right?
@NikiC Without knowing ahead of time that ~> creates a function, no, I'd parse that as a bitwise not and then a syntax error.
Yes, obviously I assume that programmers are familiar with the language they program in. Though the syntax is obvious to the point of not even needing to know about it
This is PHP we're talking about though.
17:44
@Charles so… You parse || as bitwise or and then syntax error?
The syntax is only obvious if you have exposure to functional programming languages.
@Charles I didn't… but it looks pretty obvious to me.
@NikiC btw. we need a new way to write bitwise not, yea?
@bwoebi hm?
@bwoebi It wasn't obvious to me when I first started reading up on functional languages. Reading functional code is an exercise in pain for me, it's just so amazingly hard to figure out waht the hell it's trying to do
@NikiC I mean… it's also bad to reach when you need a bitwise not…
17:47
@bwoebi I still don't get what you're saying
I literally was trying to figure out what was going on with the arrow and what it was trying to do with the variables pointing at an operation. The arrow is in the wrong place.
@NikiC oh well… forget it then
And yeah, we're out of common punctuation that'd make anything more sane.
What's the term often used to describe bad poetry?
Not contrived, but...
Depends on the level of bad.
Like "would be read on fplus" bad, or just amateurish?
17:50
doggerel?
user895378
I've always called ~> the "sperm operator" ...
7
Can we please make sort() return the sorted array?
@rdlowrey I'm suddenly in favor of it, just so we can say that phrase over and over.
@Charles I need to tell internals later that ~> is the sperm operator… I'll win the vote unanimously.
s/sperm/spermatozoon
17:59
@rdlowrey That's a pretty pregnant term man...
So… I've been measuring eager vs lazy evaluation
@LeviMorrison I've been measuring my desk, it's too big
I'm against throwing errors for methods and functions named as __*, imagine that we create a new __ method on 7.1, it would become impossible to write portable code between 7 and 7.1 cc @FlorianMargaine news.php.net/php.internals/86085
The eager seems to be about half the runtime of the lazy on really small data sets.
But this is a fairly small dataset.
I'm not sure how to generate a larger dataset that would actually be meaningful.
@DanLugg Get a smaller desk?
The lazy seems to get better as the dataset increases in size, as expected.
use ReflectionParameter as ParameterReflection;
^^ Somebody gonna kill me. Thank fuck for file-scope.
18:10
memory_get_usage() always seems to be the same on master right now.
return 42; ?
It should return a random number, right?
@DanLugg Try just the URL of the image
Not kosher but that's how SO chat rolls
18:40
http works (https doesn't)
Ahhh, https
18:56
Hey roomsters
Hey @PeeHaa
@marcio it was a joke
But it wasn't taken as such...
Pinging all @salathe's
@FlorianMargaine I assumed it was serious too, like all others :D
@marcio it was to show that there is a precedent, mostly, and there's nothing weird about having "reserved in doc"
19:05
yes, and this whole "let's make a fatal error after voting soft reservation" is insane
Technically - soft reservation is not what the RFC said.
@Danack it doesn't matter, we all know there was no engine error being proposed
"Backward Incompatible Changes

This breaks any and all cases where these new reserved words are used in class, interface or trait names."
but sara clarified that ^ I find these RFC lawyering tactics very annoying
tbh I don't care that much - but what she tried to clarify didn't clarify anything. The RFC should have been updated to more precise language before the vote, if what it says is not correct.
19:14
Does any onw know in Doctrine if you can generate multiple migrations for multiple entities with out create the entity, then create the migration, create the next entity and then create migration ... Can I create all my entities at ocne and then create a migration for each?
@Danack that's what I'm referring to, currently RFC text can't be updated after a certain stage because "laws" - an people only questioned this during the voting phase
and now somebody is trying to exploit it to create a fatal error
@marcio you know your way around doc editor by any chance?
cc @Danack halp
no idea
19:40
@PeeHaa Erm - I don't really 'know'. I tend to just do everything offline, as I keep breaking the manual when I use the online editor.
@Danack Meh. It's alright. I already pushed. I am just waiting now whether it worked :P
hmm .. I think I will try to put in some work in making that DI container that I have always wanted
@Danack Any idea how something is handled that is changed in between minor versions of several versions? As in something change in > 5.5.10 and > 5.6.2
I cannot seem to find a good example for some reason
@PeeHaa Maybe:
<function name='ldap_modify_batch' from='PHP 5.4 &gt;= 5.4.26, PHP 5.5 &gt;= 5.5.10, PHP 5.6 &gt;= 5.6.0'/>
like that?
In the versions.xml of the appropriate 'book'.
Close but nope :( @rdlowrey fixed locking stuff on windows. So the function itself is indeed available in php > whatever, but the changelog should state the change for the specific version
Sorry for being unclear :)
19:49
@PeeHaa Depending on the exact semantics of the change, if you can describe it as not working before a previous version, you could just use a caution block:
<caution>
   <para>
        Shits fucked up, yo'.
   </para>
  </caution>
Hmmm not sure whether that is warranted
The current docs already state it doesn't work on windows (which it does now)
Somewhere up there ^ stupid @LeviMorrison didn't implement linking to params :P
:) I just wish I could link to individual params in methodsynopsis
If it's just the wouldblock parameter, just note it in the param description block?
err sorry simpara
@Danack Yeah think I will do that
tnx
19:56
The stuff in the <entry>5.5.0/PECL 3.0.0</entry> doesn't appear to be parameterised, you can probably just put 5.5.10 / 5.6.2 in there.
(and then wait to hear if it broke anything...)
Yeah works for me \o/
@PeeHee you called?
Can't unsee: @microsoft #edge logo looks like a showerhead over a toilet: http://t.co/d3Xh8lOkTQ
@salathe Yes sir. @Danack already kinda gave me some pointer, but he tends to break shit :P Can you verify chat.stackoverflow.com/transcript/message/23026795#23026795 from <- there
I knew they were aiming at something
20:00
@Ocramius I hope you are not actually sitting on that thing to take a shit :P
would get wet?
@PeeHee so something changed in multiple minor versions?
@salathe Correct
@Ocramius That. And looks painful
@PeeHee and you're writing a changelog entry?
@salathe I was wondering whether I should or just write something in the param description
And if it needs to go in changelog how to target multiple versiosn
20:01
Always, always, always write a changelog entry
Comma-separated versions is fine, e.g. php.net/manual/en/…
Ah thank you fine sir. That was what I failed to find \o/
Have a beer on me
@PeeHee doc.php.net/tutorial/style.php and scroll down to "Chronology"
I knew we had that written down somewhere :)
Damn I also failed to RTFM :(
ty
RTFMM :P
20:04
@bwoebi the callback type augmentation thing works better than expected :D I'm still in doubt about it, but it's nice.
did you manage to solve the reduce/reduce conflict?
yeah… Thanks to @NikiC
noice
There was an issue with '(' T_VARIABLE ')'
so… had to change that to '(' expr ')'
and then throw a parse error for everything but a VAR_AST
20:09
these duplications with '&' seems suspect
Also, bison seems to really hate mid-rule expressions [well… I mean… usage of non-terminals with an expression]
@marcio true, forgot one case
@bwoebi looks pretty short, yay :)
@bwoebi there is zend_ast_is_list
@bwoebi looks like you don't care about ht value. Maybe use empty_element funcs? (those are precisely for "sets")
@NikiC but there isn't zend_ast_is_special
@NikiC never heard of them? Where are they defined?
@bwoebi zend_hash.h
@bwoebi nope, there isn't - gotta check that one as you do
@bwoebi The AST_VAR is missing a check that var_ast is an AST_ZVAL (and a string)
@NikiC can the var_ast be anything else than that?
20:14
@bwoebi yes, for variable variables
oh, they don't have their own var
yup
Just don't tell anyone that you're supporting (${'var'}) ~> {} :D
@NikiC nobody cares… that'll be one hidden feature^^
The people who look close enough at source will maybe find it, but they'll also understand that…
And the others… what they don't know… ;-)
@bwoebi Wondering now ... should we even support ($var) ~> {} at all? I mean, it's the same as $var ~> {}, might as well enforce a single syntax and avoid ambiguity
and I just noticed that you currently don't support the {} bit at all - do you plan to? For the not-single-expression case?
@NikiC not sure … isn't that what you should use function() { … } for?
It's trivial to add and won't cause parser issues because it's after the ~>, but not sure.
20:20
@bwoebi ~> has the advantage of implicit capture, for one
Usually short function expressions only support just that, one expression.
I'd prefer to always require ( ), but I have a weird taste for syntax
@LeviMorrison lol, I'd just wanted to say that usually both expression and block is supported ^^
Morning!
@marcio Oh, I agree with you. But it's just more comfortable
20:21
^^
morning @Chris
(parameter list) ~> <expr>
^ I expect it to look something like this.
So what @LeviMorrison @NikiC … ? ^^
@LeviMorrison that's also how it looks like
@bwoebi I'd support both expression and block usage.
@NikiC I wonder whether I should require an explicit return or do an implicit one
20:23
@bwoebi expression usage is implicit return, block usage explicit
Usually the arrow implies a return.
I'm going to say something that I expect to be smacked down, but I wanted to bounce it off you smart folks anyway. Claim: you should manually require files in unit tests rather than using an autoloader. Manual inclusion forces you to evaluate the number of collaborators and dependencies involved with a given SUT. Also, manual inclusion keeps your tests tightly constrained to the bare minimums of the SUT, where autoloaders muddy the water.
I really don't know why you'd allow {}
map($list, $x ~> $x + 1);
map($list, $x ~> { $tmp = $x + 1; return $tmp; });
Nikita and Levi disagree… And I'm watching.
20:24
@ChrisBaker no thanks
@bwoebi lol we always disagree
@NikiC Yeah… But you usually don't say the absolute contrary^^
@ChrisBaker Hypothetically you're correct, but in practice that would be a nightmare.
But what we both agree on, is that you should drop the &() ~> $x syntax. Right @Levi?
(For reference: This is the return-by-reference Bob insists on supporting)
xD
You're asking Levi! … lol
20:26
haven't we agreed to punish "&" as much as possible
@ChrisBaker But autoloaders save you from writing a list of includes on the top of each file. It's already annoying enough to always write a shitton of uses on the top of the file…
@marcio Looks like not everybody got the memo
@NikiC I have no idea what problems it causes…
@bwoebi please, adhere the movement
@marcio Each movement needs its counter-movement!
20:28
[censored]
Yeah definitely no return by reference
Don't even mention it.
Bas
Bas
Good evening /o
See, everyone agrees on that
@bwoebi I can confirm it is annoying. Especially having to remember to include interfaces before any classes. I've spent the afternoon trying to adhere to this self-imposed rule, and I found myself thinking about autoloaders. But then I was thinking that autoloader is cheating myself out of insight into each unit I'm testing, so I bailed on the autoloader idea. 3 more tests... now I'm thinking about it again.
@ChrisBaker Also, we rely to some degree on autoloaders because cyclic dependencies [like classes instantiated in a static method called after class definition]
20:31
To be honest cyclic dependencies are usually a case where you have a hidden dependency you need to extract out.
Not always the case though.
@NikiC I tried finding languages that support {} that have a short arrow syntax.
I'm at count 0.
Which languages support it?
@bwoebi Also, are you really adding support for (${'var'}) ~> …
@LeviMorrison that's a side effect I can't prevent without shift/reduce conflicts
will we add|do we have support for default arg values?
@marcio We could add it, I think.
I was thinking about not having it xD
20:34
I just mean it's feasible.
@bwoebi I've missed all the discussion; are they allowed for methods?
I still think that ():int ~> expr is great
@LeviMorrison What's allowed for methods?
public getTime() ~> $this->time;
no, just Closures
20:36
class short {
    public wow():int ~> $this->seconds;
}
@LeviMorrison rust for example (indirectly)
@NikiC I believe only if the block is an expression (like their if/else)
@LeviMorrison I think this is out of scope of that RFC.
@bwoebi I expected so; I was just asking.
// Before ~> I have
$algorithm = chain(
    filter(function($value) {
        return $value % 2 > 0;
    }),
    map(function($value) {
        return $value * 2;
    }),
    reduce(function($accumulator, $value) {
        return $accumulator + $value;
    })(0)
);
doesn't "($var) <- expr" makes more "sense" as ~> has an implicit return? this eliminates the ~ that is difficult to type for some people
20:39
@LeviMorrison well yes, in rust everything supports expression and block. If you want another example: Java
// After:
$algorithm = chain(
    filter(($value) ~>$value % 2 > 0;}),
    map(($value) ~> $value * 2;}),
    reduce(($accumulator, $value) ~> $accumulator + $value;})(0)
);
@NikiC Let's not use Java for syntax on about anything ever; how's that sound? ;)
Looking it up now.
@LeviMorrison Pretty stupid
I don't like Java either, but the fact is that PHP's syntax is virtually identical to Java syntax
Plus or minus a dollar here and there
Consumer<Integer> myConsumer = (y) ->
{
    System.out.println("x = " + x); // Statement A
    System.out.println("y = " + y);
    System.out.println("this.x = " + this.x);
    System.out.println("LambdaScopeTest.this.x = " +
        LambdaScopeTest.this.x);
};
That { on its own line makes me want to vomit.
So suppose the {} for blocks isn't too bad :)
I wouldn't accept it without blocks :X
(Just put the brace next to the ~>, please)
20:44
@LeviMorrison Of course, if you dislike Java so much, C# supports exactly the same
let's not hurt little Chinese fingers
Feb 13 at 0:47, by marcio
Dear sir, Please do not using {} , look at your keyboard.
can you see how different with () and {}

type () you will using your two fingers, but type {}, your little
finger will press them , two times.

This will hurt your little finger.
So, the wise guys design a better import solution,
https://wiki.haskell.org/Import
Really, most languages in PHP's "syntax class" that have lambdas support both expression and block syntax
Obviously Haskell does not, but that's not a reasonable comparison, given how blocks don't make much sense there anyway ;)
Can we make a list of interpreted languages that do it?
I know dart doesn't support it; unsure about many of the others.
In Python you often just write a list comprehension; do they even have a short method syntax?
@LeviMorrison And of course JS (i.e. ES 6) also supports it
I think Ruby requires {} but the content has to be an expression; checking now since I'm not much of a Rubyist at all
20:47
@LeviMorrison lambda x: x + 1
Do "blocks" work in python?
Obviously {} wouldn't be there, but can you do multi-statement lambdas?
oh, no. not that I'm aware of
@NikiC I honestly think ES 6 has some really dumb things
@@iterator <- seriously?
@LeviMorrison Good, maybe they can start taking some of the "that syntax is absurd" heat away from PHP.
@LeviMorrison not to mention they will destroy prototype adding classes
20:53
I use block anonymous functions all over the place in C# (for the day job) and would totally be +1 for having it in PHP :)
In my opinion the short syntax should be used for "short" expressions.
Blocks just seem against the point.
Just write function() {} if it's long…
they think classes are "syntactic sugar" :(
@LeviMorrison but then you will need "use ()"
@marcio Fine by me.
I really miss perl's concept of inline blocks and how they dealt with scope...
function map(callable $fn) {
    return function ($input) use ($fn) {
        foreach ($input as $key => $value) {
            yield $key => $fn($value);
        }
    };
}
function map(callable $fn) {
    return ($input) ~> {
        foreach ($input as $key => $value) {
            yield $key => $fn($value);
        }
    };
}
20:57
@LeviMorrison Wait, how does it access $fn?
@Charles You mean technically..?
@Charles shared scope
Or is that allowed?
Yeah, how would the scope work here?
@LeviMorrison I like the second, my plan is to move to short lambdas and don't come back
20:58
@marcio not shared scope, implicit value-binding
@NikiC last time I checked the room it was shared scope
@marcio Yep, last time it was. We managed to prevent that :D
@marcio do keep up :P
hehe, things change fast here

« first day (1657 days earlier)      last day (3517 days later) »