On 8/31/23 19:44, Dan Book wrote: > On Thu, Aug 31, 2023 at 7:23 PM Sam Kington <sam@illuminated.co.uk> wrote: > > On 31 Aug 2023, at 16:56, Paul LeoNerd Evans > <leonerd@leonerd.org.uk> wrote: >> We feel that these are weird cornercases that ideally should >> behave in >> a more flexible, predictable and consistent manner. It suggests >> that it >> would be nice to have a real builtin function to request that a value >> get squashed down to a plain string - by invoking the '""' >> overload if >> necessary. There's already a core OP_STRINGIFY to invoke here, so it >> seems simple enough to wrap it as a new builtin - builtin::stringify. >> If perl provided such a stringify function, then in the presence >> of the >> "please make join respect overloading" flag that one-argument >> specialcase can be removed, as now that special behaviour is no >> longer >> required. > > Frankly, I want this anyway, because I’m tired of remembering > whether $some_object->method->other_method->some_other_object > wants to be stringified with ->to_string, ->as_string, ->stringify > or whatever. > > (And because the object is something I got as a result of a bunch > of method calls, I can’t just wrap it in double quotes, because > interpolation won’t kick in.) > > > Agreed, both functions sound generally quite convenient > > -Dan +1Thread Previous | Thread Next