« first day (1661 days earlier)      last day (3290 days later) » 

4:01 PM
I think it'll end up as impossible or just too many cases to cover.
don't think by-variable will really work.
 
posted on May 04, 2015 by kbironneau

/* by Attakinsky */

 
4:21 PM
No… I'll give up… Either by-ref or by-val. But by-variable… if someone knows how to implement it… Please tell me.
I currently prefer by-ref. I haven't heart any convincing argument against it… IMO, the ($i ~> () ~> $i)($i) is reasonable.
[I know… some of you disagree… but yeah]
 
I don't like by-ref because it makes references
 
there's no way to do by-indirect in PHP userland…
 
To all Star Wars fans here, May The 4th Be With You! youtube.com/watch?v=4rQSJDLM8ZE
 
function foo(array $abc) {
    return $i ~> $abc[$i];
}
^^ that forks and copies $abc every time
 
@ircmaxell no?
 
4:24 PM
how no?
by definition $abc is not a reference and must have a refcount > 1
 
note that the refcounter is on the HashTable itself…
PHP 7 semantics…
 
eih
still
 
No, it won't fork.
It only forks when you assign something to $abc[$i]
 
no, I mean still, it's a reference (yuck)
 
It sounds like you'd hate references because they're called reference
 
user895378
4:28 PM
I dislike references because they force you as a programmer to be aware of other places your data may have been modified. This makes programming very difficult because you can't cognitively isolate all the sources of change in one scope.
 
user895378
I need things that keep my small brain from having to work too hard.
 
^^ that
 
@rdlowrey There are basically two usages of Closures.
The one usage is in-place. (where it's directly applied in that call and not stored anywhere for later use)
Other usage is Closures to be executed when something has finished, as callback for notification
For first usage references are useful.
For latter, they're just causing issues.
 
@bwoebi @bwoebi still needs a reference alloc and an indirection, for the record
 
@NikiC yes, references usually aren't on fast path etc. etc. I know…
But I wonder whether you really want to have short-hands for the latter case.
 
4:33 PM
@rdlowrey tell that to C++ programmers
 
@ziGi Nobody likes C++ except some eccentric people…
 
wut :D
 
yeah, it's doing the worst things like operator overloading, function overloading … some weird things with objects sometimes etc.
 
Anonymous
I am eccentric and I hate C++
 
maybe you are just an a-gap
 
4:36 PM
@ziGi no idea what that word means?
 
function foo() {
    $a = 1;
    $b = 2;
    return $x ~> $x + ($y ~> $y + $b)($a);
}
^^ is that supported?
meaning accessing 2 scopes up?
 
user895378
@bwoebi neither do i :)
 
Anonymous
Same here.
 
@ircmaxell should be.
 
kk
 
4:37 PM
@bwoebi it's a soft version of an a hole
 
@ircmaxell There's a little issue in that it also imports unneeded variables because anon classes use them. I need to limit it to shorthand-closures when walking the AST
@ziGi asshole you mean? pffffff…
 
what now?
 
Anonymous
@ziGi You should have gone with a "hershey highway"
 
@ircmaxell It imports sometimes too much, but that doesn't affect functionality
 
@bwoebi @ircmaxell irc log from #hhvm about short lambdas
 
4:39 PM
ah
 
> (6:16:44 PM) fred: feels like it would be consistent for one syntax to be automatically byref, one not
^ yeah… came to my mind too
I'm wondering if I should e.g. allow an $c = 10; ($a, $b) &~> $a + $c + $b; Which is then by-ref @NikiC
 
user895378
@Jean lol once upon a time I also requested a downvote for the very same reason
 
lol... done! thanks :D
 
Anonymous
@Jean You get a badge for poor answers?
 
@samaYo for deleting a -3 answer
 
4:42 PM
@samaYo peer pressure badge
 
@Jean no
 
Anonymous
Hmm, I need to get me one of those.
 
1 message moved to bin
 
Anonymous
Oh, wait ... I probably have one already :)
 
@NikiC part of me wonders if we shouldn't have 2 operators: $x ==> $x + 1 <- by-value $x =&> $x + 1 <-- by ref
 
4:44 PM
2 mins ago, by bwoebi
I'm wondering if I should e.g. allow an $c = 10; ($a, $b) &~> $a + $c + $b; Which is then by-ref @NikiC
 
lol
 
Anonymous
PHP7 new features are starting to make me feel like a PHP noob again. :/
 
@bwoebi @ircmaxell So basically the C++ way of doing things ^^
 
except that the binding is automatic
 
I can see the appeal -- though both of your syntax suggestions look like sigil salad to me ;)
@ircmaxell In C++ binding is also automatic
Or rather it supports both, but usually people use automatic binding
 
4:47 PM
ah ok
 
@bwoebi btw I think that last point from the irc log is pretty good (about reusing ==> if we do by-value and something else if we don't)
 
@NikiC Okay, then &>
 
yeah
 
@NikiC yep
@NikiC I just think if we do both, we shouldn't use ==>, I might confuse hack users why by-ref doesn't work at all…
[Also fyi @NikiC … You are crazy enough to not involve internals]
 
@bwoebi huh?
 
4:51 PM
@NikiC Well, most not-crazy people initially would involve internals…
 
@bwoebi That just means they haven't been on the internals list long enough
 
(Yes… you usually get crazy by being involved long enough in OSS… ^^)
Anyway… off for now… I'll think a bit about a separate operator for by-ref/by-val… that sound interesting :-)
 
I do like ==> and =&> tho :-)
some guy on irc is trying to argue for including block-scoped varaibles with the var keyword
 
:-P
> 12:59 <travelr> ircmaxell: another example: for(var $i...) { ... do somthing, need internal loop, for (var $i...) { .. no bug, it's another $i .. } ... }
o_O
 
5:01 PM
@ircmaxell Which is a reasonable request, right?
 
I don't know
I haven't seen an example yet that isn't a textbook case of spaghetti code
also he's saying you must do block scoping to do closures
 
@ircmaxell You don't need to, but it is benefitial
 
give me a case where it helps that isn't an example of horrible code in the first place?
and why is it beneficial?
 
Anonymous
Why can't we get methods and properties using the dot (.) operator. Seems like PHP is the only language that uses ->
 
Anonymous
echo (new foo).bar();
 
5:08 PM
@samaYo for very good reason
 
@ircmaxell the "closure loop problem"
 
@NikiC that's iteration scope tho, not even just block scope
@samaYo having a separate string contatination operator is incredibly beneifical in a loosely typed world.
 
Anonymous
I could live without concatenation in favor of that feature. :)
 
Anonymous
But that's just me.
 
ummm
 
5:10 PM
@ircmaxell yeah, there's some differences in how languages scope foreach loops.
It's either loop scope or iteration scope, where the latter avoids the problem
 
but I argue loop-scope (more generally block-scope) doesn't add much to a language such as PHP
in fact, I'd argue that block-scope is a poor replacement for function scope
 
I've found maximally-narrow scoping to be very useful in c++, but I agree that this doesn't necessarily translate to php
 
playing Deus Ex HR is kinda frustrating
 
if we were designing a language from scratch, sure. I'd be all for that. But given PHP, the skill of the average programmer, etc...
 
Of course, support for block scoping should be accompanied by the requirement that all variables need to be declared with it - accidentally assigning to typo'd variables is something I do run into regularly in php
 
5:15 PM
which makes it a completely new language
:-)
 
@ircmaxell * if it's used at all (or in strict mode, whatever) ^^
 
what you guys want is "strict php" .. which seems like the wrong direction to go
 
@ircmaxell but honestly, I didn't really run into scoping issues in php
 
^^ that
which is why I think, while this may not be a bad feature, it's not needed today
 
I don't think I ever ran into the foreach by-ref problem, which seems to be the most prominent scoping problem in php
 
5:19 PM
then again, things like function inlining and variable typing are far more valuable
 
Another thing lisp solves without even thinking about it :P
 
Anonymous
Sorry to intrust, what was the command to show the which php.ini is being used, using cli?
 
Anonymous
I did php --ini but it returned many lists.
 
Anonymous
Can't echo phpinfo(); because my php is busted.
 
php -i | grep "Loaded Conf" ?
 
Anonymous
5:34 PM
:)
 
Dammit
I'm voting to close this question as off-topic because... SQUIRREL! — salathe 33 secs ago
I forgot that gets posted as a comment
 
I was wondering lol
can always retract
 
Nah, SQUIRREL is as good a reason as any
 
http://stackoverflow.com/questions/30036374/php-unserialize-error-at‌​-offset-0-of-16-bytes-in
 
5:42 PM
What is invalid? — KETAN PATIL 1 min ago
Aaaaaah must resist to reply with "your mother"
 
Anonymous
Since we are talking about potatoes, ladies and gentlemen I present you Dan Quale, The 44th president of the United States of America :)
 
@samaYo Classic
 
@Worf old/known/watman
 
5:48 PM
nananananana watman
 
1 message moved to Orphan GIFs
 
hey guys, does anyone use firefox here?
 
Onyl when I have to
 
Anonymous
<- dev edition
 
@samaYo ahahahahahah en.wikipedia.org/wiki/Dan_Quayle#.22Potatoe.22 mirror climbing
 
5:52 PM
na na na na na na na na, a-gap
 
@Brunaldo only when i drive my delorean back to 2004
 
Haha a question tagged both "feature-request" and "chat". Good luck! — rightfold yesterday
I lolled cried @rightfold
 
You may be curious what I have been up to. It involves JS compilation and breaking copyright law.
 
s/sell/sells
 

« first day (1661 days earlier)      last day (3290 days later) »