oh... "You must prepend '\' before global names (global class names, function names etc."
Wrong, global functions names don't need this. But then that makes it another exception ;-) On 27 jan, 13:09, Beerc <berces.las...@fomi.hu> wrote: > Don't mock the humpbacked, please :). > > The correct syntax is Windows-like, to ease the work of the PHP > interpreter: > namespaces\that\look\like\paths > > Quote: "Of course, it would be great if PHP used a ‘.’ period for > public methods, static methods, and namespaces. That would make it > consistent with Java, C#, JavaScript, Python and many other languages. > Unfortunately, PHP’s history and backwards compatibility makes that > difficult to achieve." > > According to PHP traditions, there are many exceptions in teh usage: > * Nested namespaces aren't allowed. > * Neither functions nor constants can be imported via the use > statement, use statements affects only namespaces and class names. > * You must prepend '\' before global names (global class names, > function names etc.). > * If you want to define a constant in a namespace, you will need to > specify the namespace in your call to define(), but class and function > names inside namespace are automatically prefixed with the namespace > name. > * The namespace declaration statement must be the very first statement > in the file. > > According to PHP traditions, there are some performance hits in teh > usage: > * Inside namespaces, calls to unqualified functions are resolved at > run-time. > * Inside namespaces, calls to unqualified or qualified class names > (not _fully_ qualified class names) are resolved at run-time. > * Calls to internal functions in namespaces are slower, because PHP > first looks for such function in the current namespace. > * Calls to static methods are slower, because PHP first tries to look > for corresponding function in namespace. > > On Jan 26, 4:57 pm, pistacchio <pistacc...@gmail.com> wrote: > > > you are right, desfrenes, it has namespace (indeed, it has gained > > namespaces only lately), but, talking about elegance, adding > > namespaces/that/look/like/paths is not what i consider a "wow" design > > decision :) > > > On Jan 26, 1:49 pm, desfrenes <desfre...@gmail.com> wrote: > > > > You're right, Python is (much more) elegant. But you're wrong, PHP has > > > namespaces. > > > > On 25 jan, 18:27, pistacchio <pistacc...@gmail.com> wrote: > > > > > python is a very elegant and mature language. php has gained a huge > > > > popularity more for the moment when it came out that for the goodness > > > > of the language itself. it has a broken object system, no namespaces > > > > and so on. -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.