On Wed, Sep 10, 2008 at 14:55, Per Cederberg <[EMAIL PROTECTED]> wrote: > I've recently done some Python coding and found the % string formating > there very convenient. Now, as MochiKit is so inspired by Python, I > find it a bit odd that there is no generic string formatting similar > to the Python version. Is this just due to lack of time or is it a > deliberate omission?
IMO this kind of thing would make a good addition to MochiKit. I think it fits well with the utility-nature of mk. > Has anybody created a generic formatting function in JavaScript? Other > libraries? Or am I the only one seeing the need? If you google "javascript printf" you get a lot of implementations. I remember looking into it some time ago and eventually choosing something that I found to be very good - but I've long lost it and forgotten where I used it. Overall, this shouldn't be too hard to implement and MochiKit's registry technique might be of use. Ideally, if format strings are reused, some internal "compiled" version might be cached to improve performance. cheers, Arnar --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "MochiKit" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/mochikit?hl=en -~----------~----~----~----~------~----~------~--~---
