What I like:
- The new return "<-"
What I think should change:
- The concatenating assignment operator "%=" shouldn't change. It should stay the same ".="
- Accessing instance variables/methods should be by using '@' rather than '.' as that is becoming an implied standard and php folk are already used to using '.' for string concatenation.
- The setting of parameter types and defaults on methods is too heavy and not what people expect. I would put them back into method declaration.
eg.
@str title=null
class
# To become
class
fn constructor(str @title = null)
As @ would be the way to access instance variables what this means is the instance variable of title would be assigned the value that gets passed through the constructor.
# This is too much magic imo
@arr row
# List of integers.
[!_->empty: "$row cannot be empty."]
fn add_row(row)
# it should be something like this:
fn add_row(arr row)
!"$row cannot be empty." if row->empty
- This doesn't make a lot of sense: for row in .rows
html %= "<table>" | .render_row(row) | "</table>"
# I would prefer something like:
html .= @render_row(row) for row in @rows
html = "<table>{html}</table>"
Good work on what you have already achieved, with a bit of extra polish I think Snow can become very desirable.