Re: smarty custom functions namespaces
boots <[email protected]> Thu, 21 Jul 2005 20:57:44 -0700 (PDT)
| Newsgroups | gmane.comp.php.smarty.devel |
|---|---|
| Message-ID | <[email protected]> |
Fair enough -- but when PHP was still a template language, I think that the idea was that business-logic was going to be implemented in a lower-level language like C and plugged into the runtime as a module. So the language didn't need fancy features under that model. For certain environments I'm sure that is still a good choice. Yet for many, that is a tough development proposition. Luckily, PHP (which I'm sure you agree is not a 1st class GP language) is more or less suitable for implementing many sorts of business logic and it boasts a development cycle somewhat less cumbersome -- and more accessible -- than developing PHP modules in a lower-level language. So PHP "evolved" and moved up the food-chain and in doing so, helped a lot of people. Yet at the same time, it is now more complicated than a pure template solution needs to be. While I agree that without dilligence Smarty can feature creep into pointlessness, I suggest it probably won't because there isn't the same pressure driving it to do so. Smarty is addressing the space that PHP vacated. I think a more interesting question is whether PHP can survive in the space it moved into. There are a lot of languages with longer credentials that live at that layer. Besides, PHP isn't all chocolate and sunshine...it too has ugly warts. Anyways, it probably doesn't matter -- it will all be Lisp one day. Or perhaps XLisp once the W3C gets involved. Best regards. --- Andrei Zmievski <[email protected]> wrote: > Ah, but there is a subtle albeit crucial difference. PHP started out > as a template language and evolved into a general purpose scripting > one. And once you are at the "general-purpose" level, you can no > longer contain the explosion of possibilities. Smarty may end on the > same route. > > -Andrei > > > On Jul 21, 2005, at 10:56 AM, boots wrote: > > > --- Andrei Zmievski <[email protected]> wrote: > > > >> Yes, and that's what scares me about Smarty. > >> > >> -Andrei > >> > > > > Hi Andrei. I was kidding, you know....but I'm only half-kidding > when I > > ask what your take is on the famous principle that every language > > eventually evolves into Lisp? More seriously, it is good to fight > the > > feature creep but things like namespaces really have nothing > > exclusively to do with PHP or Rasmus' hypothesis. > > > > I think your comment is insightful in that it highlights a critical > > point: some people misuse Smarty and try to build business-logic > > with a > > "template" language. It is reminiscent of how some people misuse > PHP > > and try to build desktop applications with a "web" languange -- > > despite > > Rasmus' objections to such. > > > > > > > >> On Jul 21, 2005, at 9:30 AM, boots wrote: > >> > >> > >>> You know full well that PHP does not have namespaces :) > >>> > >>> --- Andrei Zmievski <[email protected]> wrote: > >>> > >>> > >>>> Do you people realize that you are proving Rasmus's theorem with > >>>> every such thing? I am speaking of "Every template language > >>>> > >> evolves > >> > >>>> until it turns into PHP". > >>>> > >>>> -Andrei > >>>> > >>>> On Jul 21, 2005, at 3:19 AM, Michael Davey wrote: > >>>> > >>>> > >>>>> Hi, > >>>>> > >>>>> I've added a crude form of namespaces to my private copy of > >>>>> > >> Smarty. > >> > >>>>> A template function like: > >>>>> > >>>>> {namespace:test} > >>>>> > >>>>> ...causes the test() function in the smarty_function_namespace > >>>>> class to be called. > >>>>> > >>>>> I'm planning to use this feature in TikiWiki to provide > >>>>> accessor-like template functions to access various data: > >>>>> article::title, article::description and so on. I though that > >>>>> > >> this > >> > >>> > >>> > >>>>> might be of more general use, so here is a patch for this > >>>>> > >> morning's > >> > >>> > >>> > >>>>> CVS snapshot of Smarty. > >>>>> > > > > > > __________________________________________________ > > Do You Yahoo!? > > Tired of spam? Yahoo! Mail has the best spam protection around > > http://mail.yahoo.com > > > > -- > > Smarty Development Mailing List (http://smarty.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > -- > Smarty Development Mailing List (http://smarty.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > ____________________________________________________ Start your day with Yahoo! - make it your home page http://www.yahoo.com/r/hs -- Smarty Development Mailing List (http://smarty.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php