in reply to Re: Packing unsafe string for later context-based escaping
in thread Packing unsafe string for later context-based escaping

Thanks for your reply!

I believe I could write it in Python as well. The __str__ method would handle stringification (concrete method selection in our case). Scoping can be implemented in any language that has destructors (__del__ in Python's case) by using guard variables. Ditto C++ (via operator const string & IIRC).

UPDATE I was totally wrong about Python's scoping, looks like it's done another way.

Not sure how it can be done in Java and Javascript, though.

And... I'm a bit ashamed to ask, but... What is CUFP?

  • Comment on Re^2: Packing unsafe string for later context-based escaping

Replies are listed 'Best First'.
Re^3: Packing unsafe string for later context-based escaping
by Eily (Monsignor) on Jan 05, 2016 at 19:30 UTC

    No need to be, I didn't use the full name. It's Cool Uses for Perl where people talk about cool things that perl allows you to do, though sometimes it relies on features shared among high level languages, which explains my post.

    Indeed there are ways to obtain the same result with objects and destructors, pretty nice solution as well actually.

      Ouch. Now I'm twice as ashamed for googling instead of scrolling the freaking page up! :))))))