This reminds me of Perl 6, where you can return "undef but true" (to indicate a nil value that still evaluates to true in boolean context, roughly speaking), or Haskell Maybe monad. Don't ask me more about those; I don't really understand monads.
Pardon the tangent, but in Perl 5 what you call the instance of the class is up to you. Conventionally it's $self, and the constructor is often new(), but these can be whatever you want. Unless you use a special CPAN module that does the work for you, the common idiom in declaring methods is
sub method {
my $self = shift;
...
}
You could name it $myself, $this, or even $the_object if you wanted.
Most module system proposals so far suffer from the same problem: macros won't work properly. However, this is not my conclusion, but what many people have stated. It's not entirely clear to me what the exact problems are. Could someone elaborate?
And you are right, making modules and macros work together turns out to be harder than most people realize. Schemers have thought long and hard about the problem. It would be wise to look at the papers at
It doesn't matter how they are implemented (they can even be cons cells implemented as closures), as long as you can use the ordinary list functions to manipulate them. But this is the direction Arc is headed to anyway.
- If you get the layout, including both how it should look and how things should work, from an external source, or if there is substantial external input, use templates. It will save time and headache.
- If you are just about the only one responsible for the layout but support skins (for lack of a better word; the CSS part), use the HTML tag functions and macros embedded in Arc.
Since Arc is at this point targeted for exploratory programming, the former is an unlikely case.
What I would like to see, though, is a templating engine akin to HTML::Template [1] in Perl 5. It has the minimum of control structures and extra syntax on top of standard HTML, just enough to make it possible to use the template for dynamic content. All templating frameworks suffer from the same fault, though: they define a new but severely restricted embedded language that's mixed in an unpleasant way with the HTML source. The language embedded in Arc is a much cleaner way to do things.
Complex designed websites are pretty much impossible using Arc's current library. Well, unless you're a programmer/designer with a high pain threshold.
When Arc is no longer classified by whatever greek letter comes before alpha, it might be worth investing into a nice way to separate out some MVC/MTV/VH1/&c.