« first day (4535 days earlier)      last day (404 days later) » 

1:12 PM
@Crell "I... don't know if we considered something like that or not 3 years ago."
First-class callable syntax - 2021-05-20
Partial Function Application - 2020-04-22
Unless you have been up to time-travelling shenanigans, probably not.
> I wonder if there's a shorter name we could use than "partial" to make it more readable?
You don't make things more readable by making them shorter.....you might make them easier to embed as a parameter in a function call, but that is a different goal. And I have a very strong suspicion that one of the accidentally good features of PHP is that it doesn't make that easy.
From your example:
$size = $arr
|> amap(...)->partial(chr(...))
|> implode(...)->partial(',')
|> length(...);
I would find:
$remap = amap(...)->partial(chr(...));
$implode = implode(...)->partial(',');

$size = $arr
|> $remap
|> $implode
|> length(...);
easier to read....because it's longer and separates the setting up of the partials from the using them.
Oh and eventually if there is a native syntax for it, then anyone who wants the shorter one can use that.
 
 
6 hours later…
7:33 PM
hi @Craig Francis, is true, if we turn OFF the **mysqli_report()** then all run fine, just that is my Q:

how run the "PERFECT QUERY" **SHOW FIELDS FROM `table`;** using:

**mysqli_report(MYSQLI_REPORT_ALL);**
 
 
2 hours later…
9:05 PM
@Yamile It’s been a while since I’ve dug though that bit of code, but I don’t think you can, it’s checking to see if an index is being used (ref SERVER_QUERY_NO_INDEX_USED, but I don’t think that flag can be set for a SHOW FIELDS query.
 
9:21 PM
Should a language make a difference between properties that are state (like name, address, etc for a user class) and props that are dependencies (like a LoggerInterface)?
 
@OlleHärstedt what does "make a difference" mean in this context?
 
10:03 PM
@Danack I'm not sure! I don't know if any language makes a difference between things it borrows from the outside vs things it "owns" on the inside of the class, so to speak (unrelated to Rust's borrowing thing).
But injected dependencies "should" be readonly, while internal state "could" be readonly (but it's less important, because it's internal and possible more protected).
I guess a dependency is assumed to be shared between many objects? While state should not be.
public/private/protected - and "shared"? shared $logger = null;
Also related to capabilities. readonly is one example of a capability. I think. Or, restricting the write-capability.
 
@OlleHärstedt ok I get it. I think it's a useful concept, but probably it should live at the dependency injector level (assuming you use one) rather than the language level. Not sure if you've ever looked at Auryn, but one thing I've been putting of merging is properly separating DI contexts.
You could do what you're talking about by having all the 'services' setup and shared in the "app" level context, and then have state stuff in the separated context. You could probably also define what types are allowed to be setup in each of them, to prevent accidents, where user state is inappropriately shared.
Though also...there's a strong chance you just need to use more powerful factory types.
 
10:52 PM
Hmmm
Problem is, it's hard to enforce company-wide, with all sorts of skill levels.
That's why I was interested in the language level.
It's pretty telling that the readme does not mention types of dependencies. Car with Engine - in this example, engine is actually part of the state, or? At least I'd argue it's semantically different than a database connection or logger. Because it's a shared resource, maybe?
 
11:12 PM
This is where people start talking about "Record" types, which are basically classes that pass like arrays. Some languages have them.

Personally I don't see a need in PHP, as using classes for both but using them smartly differently is working just fine for me.
 
@OlleHärstedt "it's hard to enforce company-wide", although I understand what you mean in general, exactly what problem are you having that you are trying to solve is I can't see.
> It's pretty telling that the readme does not mention types of dependencies.
It kind of assumes it is being used as a single level injector, without any different levels of context. I also kind of disagree with some aspects of the readme....as whether something is a service locator or an injector depends on where you are standing.
 
11:28 PM
@Danack Readability is subjective. I find being able to read the configuration for each pipe step inline to be more convenient. Hence my interest in a more native syntax.
 
Fair, but if you're seeking to have a native syntax for it, then making what would eventually become the long version, be shorter than "->partial" would seem bad for people who prefer the verbose version.
 
Part of my concern is that I have little faith that we'd be able to get both Closure->partial and a direct syntax. Having one will make people get bored and not interested in the other (either direction), which is not a great outcome.
Personally I'm open to having both, I'm just not convinced we can get both.
 
Knowing the future is hard. You could also make an argument that the smaller difference in characters of a native syntax vs a verbose syntax, the less people would think it was needed.
 
11:50 PM
Closure->applyPartialArguments(...) :-)
In any case, character count is a factor in readability, but is not the only factor. I think that's a reasonably agreeable stance.
I need to go to dinner. TTYL.
 
Closure->applyPartialArgumentsByPositionAndNamed(...)
 

« first day (4535 days earlier)      last day (404 days later) »