On 6/4/2016 7:09 PM, Rasmus Schultz wrote: > Hi Richard, > > I can't review the implementation, but the RFC looks good - great > initiative! > > The only thing I would comment on, is the idea of packing essentially two > different functions into one - by default, the return value is a > machine-friendly type-name, but the $extended argument turns it into a > different function altogether, producing a human-readable type-description. > > It seems like you have two functions in one, and I personally would prefer > having two functions. > > Other than that, this looks like a nice replacement for e.g. this lengthy > switch-statement: > > https://github.com/mindplay-dk/readable/blob/master/src/readable.php#L30 > > Incidentally, this library creates "more readable" representations of e.g. > closures, displaying filename and line number, which would be another > nice-to-have, and another good reason to separate the human-readable > function from the machine-friendly function. (I wrote this library mostly > to create readable representations of e.g. invalid arguments so I can throw > exceptions with more helpful messages - it would be great if that was no > longer necessary.) >
Hi Rasmus, thanks for the very positive feedback and this is exactly the target I am aiming for with the proposal. I am more than open to the idea of splitting the functionality because after all I am a big friend of the Unix philosophy. The hard question to answer is, how to call that function? typeof_extended() is kind of weird ... I will definitely investigate. :) -- Richard "Fleshgrinder" Fussenegger
signature.asc
Description: OpenPGP digital signature