|
|
|
|
|
by ieure
6002 days ago
|
|
Nice start. I was considering something simliar, but I just didn't care enough about PHP to work on it. Stuff that I'd like to see improved: 1. if/elseif/else syntax is pretty ugly. What are the chances of getting if/when/unless/cond? 2. Nicer array syntax. Maybe coopt the vector literal syntax, since PHP doesn't have anything similar: [1 2 3]. Failing that, quotes: '(1 2 3) -> array(1, 2, 3). Not sure how to handle cases where you would have something inside the quote that would eval, though. 3. Not thrilled with the superglobals/array syntax, which are more verbose (or the same, in the case of superglobals). 4. It isn't clear if/how this interacts with objects. Does it work like: (object->method arg1…argN)? What about static methods? |
|
1. Pretty likely, though I'm a little hesitant to replace the current syntax for if. The others shouldn't be hard to implement.
2. I've been planning to use the vector literal syntax. I've basically been lazy since PHP's array() construct makes it easy to cheat.
3. Indexing into arrays presents a problem. Pharen doesn't know what's a scalar, array, or function name at the moment so a special function for indexing is needed. One possible solution is to prefix an array's name, so it would be (:some_array 4) or something similar. I personally think the superglobal syntax is cleaner, if not more succinct. Any suggestions?
4. I haven't implemented an object system yet because I want to try something new here instead of simply copying PHP's syntax.