-
Notifications
You must be signed in to change notification settings - Fork 10
Namespaces #14
Comments
Namespaces are great, I think we should avoid the I think I was still considering if Blueberry should be compatible with old PHP, so for example, you could use But namespaces must be added, and if we are adding them I guess we could eventually change the generated arrays to For now, just implementing them with |
The problem with Also, what do you mean by "compile them to PHP
Old PHP, as in PHP 4? I'm pretty sure PHP 5's always had
That could be a compiler option. Although, well, PHP 5.3 has reached EOL. It's still very much in use, but it's not going to be an issue soon. Outputting |
Yeah, the proposed Yeah I see your point, we could certainly get away with using I'm not sure how many things we'd have to update to implement namespaces, but it shouldn't be too hard, most likely the grammar, identifiers and method calls. Also, I don't know if it's possible to do
In Blueberry, it's been a while! If it's not possible shouldn't be too hard to do though. |
Ooh, good point, I'm not sure that is possible. You'd have to do |
Now that there's a scope manager, maybe function calls can be smarter now. I'll check that out. Edit: Nevermind, it's already implemented 😋 |
Blueberry doesn't seem to handle this just now, so how should it? You could go for the most obvious approach of just adding
use
and use backslashes like PHP. On the other hand, there might be other approaches. We could use something other than the backslash, but that would mean you'd be typing, say,Foo::Bar
normally butFoo\Bar
in strings containing function names to be called... so it's probably not a good idea.The text was updated successfully, but these errors were encountered: